somratpro commited on
Commit
4e795a9
Β·
1 Parent(s): fd7a1c1

debug: add /app/read-x-provider endpoint to inspect provider source

Browse files
Files changed (1) hide show
  1. health-server.js +27 -0
health-server.js CHANGED
@@ -1868,6 +1868,33 @@ const server = http.createServer((req, res) => {
1868
  return;
1869
  }
1870
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1871
  // ── /app/debug-logs β€” Temporary endpoint for debugging ───────────────────
1872
  if (pathname === "/app/debug-logs") {
1873
  try {
 
1868
  return;
1869
  }
1870
 
1871
+ // ── /app/read-x-provider β€” Show x.provider.ts source from container ─────
1872
+ if (pathname === "/app/read-x-provider") {
1873
+ try {
1874
+ const { execSync } = require("child_process");
1875
+ const rc = (cmd) => { try { return execSync(cmd, { timeout: 10000 }).toString().trim(); } catch(e) { return "(err: " + e.message.slice(0,120) + ")"; } };
1876
+ // Find all x.provider files
1877
+ const found = rc("find /app -name 'x.provider.*' -o -name 'twitter.provider.*' 2>/dev/null | grep -v node_modules | grep -v .next");
1878
+ const lines = ["=== X/Twitter Provider Files ===", found || "(none found)", ""];
1879
+ // Also search for 'external:' usage in backend source
1880
+ const externalUsage = rc("grep -r 'external:' /app/apps /app/libs --include='*.ts' --include='*.js' -n 2>/dev/null | grep -v node_modules | grep -v .next | grep -v dist | head -30");
1881
+ lines.push("=== 'external:' Redis key usage in source ===", externalUsage || "(none)", "");
1882
+ // Show content of x.provider file
1883
+ const xProviderFile = rc("find /app -name 'x.provider.ts' -not -path '*/node_modules/*' -not -path '*/.next/*' 2>/dev/null | head -1");
1884
+ if (xProviderFile && !xProviderFile.startsWith("(err")) {
1885
+ lines.push(`=== Content of ${xProviderFile} ===`);
1886
+ const content = rc(`cat "${xProviderFile}"`);
1887
+ lines.push(content.slice(0, 8000));
1888
+ }
1889
+ res.writeHead(200, { "Content-Type": "text/plain; charset=utf-8" });
1890
+ res.end(lines.join("\n"));
1891
+ } catch(e) {
1892
+ res.writeHead(500, { "Content-Type": "text/plain" });
1893
+ res.end("Error: " + e.message);
1894
+ }
1895
+ return;
1896
+ }
1897
+
1898
  // ── /app/debug-logs β€” Temporary endpoint for debugging ───────────────────
1899
  if (pathname === "/app/debug-logs") {
1900
  try {