Fix MITM
This commit is contained in:
+12
-1
@@ -1,7 +1,18 @@
|
||||
// All intercepted domains + URL patterns per tool
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const IS_DEV = process.env.NODE_ENV === "development";
|
||||
|
||||
// Resolve lsof absolute path — packaged apps / sudo secure_path may strip /usr/sbin from PATH
|
||||
const LSOF_BIN = (() => {
|
||||
if (process.platform === "win32") return null;
|
||||
for (const p of ["/usr/sbin/lsof", "/usr/bin/lsof", "/sbin/lsof"]) {
|
||||
try { fs.accessSync(p, fs.constants.X_OK); return p; } catch { /* try next */ }
|
||||
}
|
||||
return "lsof"; // last-resort fallback (depends on PATH)
|
||||
})();
|
||||
|
||||
const TARGET_HOSTS = [
|
||||
"daily-cloudcode-pa.googleapis.com",
|
||||
"cloudcode-pa.googleapis.com",
|
||||
@@ -53,4 +64,4 @@ function getToolForHost(host) {
|
||||
return null;
|
||||
}
|
||||
|
||||
module.exports = { IS_DEV, TARGET_HOSTS, URL_PATTERNS, MODEL_SYNONYMS, MODEL_PATTERNS, LOG_BLACKLIST_URL_PARTS, getToolForHost };
|
||||
module.exports = { IS_DEV, LSOF_BIN, TARGET_HOSTS, URL_PATTERNS, MODEL_SYNONYMS, MODEL_PATTERNS, LOG_BLACKLIST_URL_PARTS, getToolForHost };
|
||||
|
||||
Reference in New Issue
Block a user