Spaces:
Running
Running
debug: grep Postiz source for Redis key patterns in debug-logs
Browse files- health-server.js +23 -0
health-server.js
CHANGED
|
@@ -2020,6 +2020,27 @@ const server = http.createServer((req, res) => {
|
|
| 2020 |
redisSection += `(redis-cli error: ${e.message})`;
|
| 2021 |
}
|
| 2022 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2023 |
const out = [
|
| 2024 |
credSection,
|
| 2025 |
"",
|
|
@@ -2030,6 +2051,8 @@ const server = http.createServer((req, res) => {
|
|
| 2030 |
"",
|
| 2031 |
redisSection,
|
| 2032 |
"",
|
|
|
|
|
|
|
| 2033 |
"=== BACKEND ERROR LOG (last 150 lines) ===",
|
| 2034 |
errLog,
|
| 2035 |
"",
|
|
|
|
| 2020 |
redisSection += `(redis-cli error: ${e.message})`;
|
| 2021 |
}
|
| 2022 |
|
| 2023 |
+
// Grep Postiz source for Redis key patterns + x.provider content
|
| 2024 |
+
let sourceSection = "=== POSTIZ SOURCE: Redis key patterns ===\n";
|
| 2025 |
+
try {
|
| 2026 |
+
const { execSync } = require("child_process");
|
| 2027 |
+
const rc2 = (cmd) => { try { return execSync(cmd, { timeout: 10000 }).toString().trim(); } catch(e) { return "(err: " + e.message.slice(0,80) + ")"; } };
|
| 2028 |
+
const grepRedis = rc2("grep -rn 'ioRedis.set\\|redis.set' /app/apps/backend/src /app/libs --include='*.ts' 2>/dev/null | grep -v node_modules | grep -E 'login:|external:|refresh:' | head -20");
|
| 2029 |
+
sourceSection += `Redis set calls with login:/external: prefix:\n${grepRedis || "(none found)"}\n\n`;
|
| 2030 |
+
// Find and show x.provider.ts generateAuthUrl
|
| 2031 |
+
const xProvFile = rc2("find /app -name 'x.provider.ts' -not -path '*/node_modules/*' -not -path '*/.next/*' 2>/dev/null | head -1");
|
| 2032 |
+
sourceSection += `x.provider.ts path: ${xProvFile || "(not found)"}\n`;
|
| 2033 |
+
if (xProvFile && !xProvFile.startsWith("(err")) {
|
| 2034 |
+
const xContent = rc2(`grep -n 'generateAuthUrl\\|codeVerifier\\|oauth_token\\|ioRedis\\|redis' "${xProvFile}" | head -40`);
|
| 2035 |
+
sourceSection += `x.provider.ts relevant lines:\n${xContent || "(none)"}\n`;
|
| 2036 |
+
}
|
| 2037 |
+
// Also check integrations controller
|
| 2038 |
+
const ctrlSearch = rc2("grep -rn 'external:\\|login:\\|codeVerifier\\|generateAuthUrl' /app/apps/backend/src --include='*.ts' 2>/dev/null | grep -v node_modules | head -30");
|
| 2039 |
+
sourceSection += `\nIntegrations controller Redis/codeVerifier usage:\n${ctrlSearch || "(none)"}\n`;
|
| 2040 |
+
} catch(e) {
|
| 2041 |
+
sourceSection += `(error: ${e.message})`;
|
| 2042 |
+
}
|
| 2043 |
+
|
| 2044 |
const out = [
|
| 2045 |
credSection,
|
| 2046 |
"",
|
|
|
|
| 2051 |
"",
|
| 2052 |
redisSection,
|
| 2053 |
"",
|
| 2054 |
+
sourceSection,
|
| 2055 |
+
"",
|
| 2056 |
"=== BACKEND ERROR LOG (last 150 lines) ===",
|
| 2057 |
errLog,
|
| 2058 |
"",
|