@solongate/proxy 0.82.46 → 0.82.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  // src/global-install.ts
2
- import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync } from "fs";
2
+ import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync, chmodSync } from "fs";
3
3
  import { resolve, join, dirname } from "path";
4
4
  import { homedir } from "os";
5
5
  import { fileURLToPath } from "url";
@@ -12,7 +12,11 @@ function lockFile(file) {
12
12
  try {
13
13
  if (process.platform === "win32") {
14
14
  try {
15
- execFileSync("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE)"], { stdio: "ignore" });
15
+ execFileSync("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE,WDAC,WO)"], { stdio: "ignore" });
16
+ } catch {
17
+ }
18
+ try {
19
+ execFileSync("icacls", [file, "/grant", "*S-1-3-4:(RX)"], { stdio: "ignore" });
16
20
  } catch {
17
21
  }
18
22
  try {
@@ -29,6 +33,10 @@ function lockFile(file) {
29
33
  execFileSync("chattr", ["+i", file], { stdio: "ignore" });
30
34
  } catch {
31
35
  }
36
+ try {
37
+ chmodSync(file, 292);
38
+ } catch {
39
+ }
32
40
  }
33
41
  } catch {
34
42
  }
@@ -37,6 +45,10 @@ function unlockFile(file) {
37
45
  if (!existsSync(file)) return;
38
46
  try {
39
47
  if (process.platform === "win32") {
48
+ try {
49
+ execFileSync("icacls", [file, "/remove:g", "*S-1-3-4"], { stdio: "ignore" });
50
+ } catch {
51
+ }
40
52
  try {
41
53
  execFileSync("icacls", [file, "/remove:d", "*S-1-1-0"], { stdio: "ignore" });
42
54
  } catch {
@@ -59,6 +71,10 @@ function unlockFile(file) {
59
71
  execFileSync("chattr", ["-i", file], { stdio: "ignore" });
60
72
  } catch {
61
73
  }
74
+ try {
75
+ chmodSync(file, 420);
76
+ } catch {
77
+ }
62
78
  }
63
79
  } catch {
64
80
  }
@@ -274,7 +290,7 @@ function installGlobalQuiet() {
274
290
  installAntigravityGuard(p, join(p.hooksDir, "guard.mjs").replace(/\\/g, "/"));
275
291
  } catch {
276
292
  }
277
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") lockProtected();
293
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") lockProtected();
278
294
  return { ok: true, message: "guard installed (open a new session)" };
279
295
  } catch (e) {
280
296
  return { ok: false, message: e instanceof Error ? e.message : String(e) };
@@ -464,7 +480,7 @@ async function runGlobalInstall(opts = {}) {
464
480
  console.log(` Registered Antigravity CLI guard \u2192 ${p.antigravityHooksPath}`);
465
481
  } catch {
466
482
  }
467
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") {
483
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") {
468
484
  lockProtected();
469
485
  console.log(" Locked protection files (OS-level read-only/immutable).");
470
486
  }
package/dist/index.js CHANGED
@@ -6206,7 +6206,7 @@ __export(global_install_exports, {
6206
6206
  uninstallGlobalQuiet: () => uninstallGlobalQuiet,
6207
6207
  unlockProtected: () => unlockProtected
6208
6208
  });
6209
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, mkdirSync as mkdirSync3, rmSync as rmSync2 } from "fs";
6209
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, mkdirSync as mkdirSync3, rmSync as rmSync2, chmodSync } from "fs";
6210
6210
  import { resolve as resolve3, join as join4, dirname } from "path";
6211
6211
  import { homedir as homedir2 } from "os";
6212
6212
  import { fileURLToPath } from "url";
@@ -6217,7 +6217,11 @@ function lockFile(file) {
6217
6217
  try {
6218
6218
  if (process.platform === "win32") {
6219
6219
  try {
6220
- execFileSync2("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE)"], { stdio: "ignore" });
6220
+ execFileSync2("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE,WDAC,WO)"], { stdio: "ignore" });
6221
+ } catch {
6222
+ }
6223
+ try {
6224
+ execFileSync2("icacls", [file, "/grant", "*S-1-3-4:(RX)"], { stdio: "ignore" });
6221
6225
  } catch {
6222
6226
  }
6223
6227
  try {
@@ -6234,6 +6238,10 @@ function lockFile(file) {
6234
6238
  execFileSync2("chattr", ["+i", file], { stdio: "ignore" });
6235
6239
  } catch {
6236
6240
  }
6241
+ try {
6242
+ chmodSync(file, 292);
6243
+ } catch {
6244
+ }
6237
6245
  }
6238
6246
  } catch {
6239
6247
  }
@@ -6242,6 +6250,10 @@ function unlockFile(file) {
6242
6250
  if (!existsSync3(file)) return;
6243
6251
  try {
6244
6252
  if (process.platform === "win32") {
6253
+ try {
6254
+ execFileSync2("icacls", [file, "/remove:g", "*S-1-3-4"], { stdio: "ignore" });
6255
+ } catch {
6256
+ }
6245
6257
  try {
6246
6258
  execFileSync2("icacls", [file, "/remove:d", "*S-1-1-0"], { stdio: "ignore" });
6247
6259
  } catch {
@@ -6264,6 +6276,10 @@ function unlockFile(file) {
6264
6276
  execFileSync2("chattr", ["-i", file], { stdio: "ignore" });
6265
6277
  } catch {
6266
6278
  }
6279
+ try {
6280
+ chmodSync(file, 420);
6281
+ } catch {
6282
+ }
6267
6283
  }
6268
6284
  } catch {
6269
6285
  }
@@ -6478,7 +6494,7 @@ function installGlobalQuiet() {
6478
6494
  installAntigravityGuard(p, join4(p.hooksDir, "guard.mjs").replace(/\\/g, "/"));
6479
6495
  } catch {
6480
6496
  }
6481
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") lockProtected();
6497
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") lockProtected();
6482
6498
  return { ok: true, message: "guard installed (open a new session)" };
6483
6499
  } catch (e) {
6484
6500
  return { ok: false, message: e instanceof Error ? e.message : String(e) };
@@ -6666,7 +6682,7 @@ async function runGlobalInstall(opts = {}) {
6666
6682
  console.log(` Registered Antigravity CLI guard \u2192 ${p.antigravityHooksPath}`);
6667
6683
  } catch {
6668
6684
  }
6669
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") {
6685
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") {
6670
6686
  lockProtected();
6671
6687
  console.log(" Locked protection files (OS-level read-only/immutable).");
6672
6688
  }
package/dist/tui/index.js CHANGED
@@ -9,7 +9,7 @@ var __export = (target, all) => {
9
9
  };
10
10
 
11
11
  // src/global-install.ts
12
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync5, existsSync as existsSync2, mkdirSync as mkdirSync4, rmSync } from "fs";
12
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync5, existsSync as existsSync2, mkdirSync as mkdirSync4, rmSync, chmodSync } from "fs";
13
13
  import { resolve as resolve2, join as join6, dirname } from "path";
14
14
  import { homedir as homedir6 } from "os";
15
15
  import { fileURLToPath } from "url";
@@ -20,7 +20,11 @@ function lockFile(file) {
20
20
  try {
21
21
  if (process.platform === "win32") {
22
22
  try {
23
- execFileSync("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE)"], { stdio: "ignore" });
23
+ execFileSync("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE,WDAC,WO)"], { stdio: "ignore" });
24
+ } catch {
25
+ }
26
+ try {
27
+ execFileSync("icacls", [file, "/grant", "*S-1-3-4:(RX)"], { stdio: "ignore" });
24
28
  } catch {
25
29
  }
26
30
  try {
@@ -37,6 +41,10 @@ function lockFile(file) {
37
41
  execFileSync("chattr", ["+i", file], { stdio: "ignore" });
38
42
  } catch {
39
43
  }
44
+ try {
45
+ chmodSync(file, 292);
46
+ } catch {
47
+ }
40
48
  }
41
49
  } catch {
42
50
  }
@@ -45,6 +53,10 @@ function unlockFile(file) {
45
53
  if (!existsSync2(file)) return;
46
54
  try {
47
55
  if (process.platform === "win32") {
56
+ try {
57
+ execFileSync("icacls", [file, "/remove:g", "*S-1-3-4"], { stdio: "ignore" });
58
+ } catch {
59
+ }
48
60
  try {
49
61
  execFileSync("icacls", [file, "/remove:d", "*S-1-1-0"], { stdio: "ignore" });
50
62
  } catch {
@@ -67,6 +79,10 @@ function unlockFile(file) {
67
79
  execFileSync("chattr", ["-i", file], { stdio: "ignore" });
68
80
  } catch {
69
81
  }
82
+ try {
83
+ chmodSync(file, 420);
84
+ } catch {
85
+ }
70
86
  }
71
87
  } catch {
72
88
  }
@@ -217,7 +233,7 @@ function installGlobalQuiet() {
217
233
  installAntigravityGuard(p, join6(p.hooksDir, "guard.mjs").replace(/\\/g, "/"));
218
234
  } catch {
219
235
  }
220
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") lockProtected();
236
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") lockProtected();
221
237
  return { ok: true, message: "guard installed (open a new session)" };
222
238
  } catch (e) {
223
239
  return { ok: false, message: e instanceof Error ? e.message : String(e) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.82.46",
3
+ "version": "0.82.47",
4
4
  "description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
5
5
  "type": "module",
6
6
  "bin": {