@solongate/proxy 0.16.1 → 0.17.1
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.
- package/dist/index.js +29 -1
- package/dist/init.js +29 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -462,7 +462,29 @@ EXAMPLES
|
|
|
462
462
|
function readHookScript(filename) {
|
|
463
463
|
return readFileSync3(join(HOOKS_DIR, filename), "utf-8");
|
|
464
464
|
}
|
|
465
|
+
function unlockProtectedDirs() {
|
|
466
|
+
const dirs = [".solongate", ".claude", ".cursor", ".gemini", ".antigravity", ".openclaw", ".perplexity"];
|
|
467
|
+
for (const dir of dirs) {
|
|
468
|
+
const fullDir = resolve2(dir);
|
|
469
|
+
if (!existsSync3(fullDir)) continue;
|
|
470
|
+
try {
|
|
471
|
+
if (process.platform === "win32") {
|
|
472
|
+
execSync(`icacls "${fullDir}" /remove:d *S-1-1-0 /T /Q`, { stdio: "ignore" });
|
|
473
|
+
execSync(`attrib -R /S /D "${fullDir}"`, { stdio: "ignore" });
|
|
474
|
+
execSync(`icacls "${fullDir}" /reset /T /Q`, { stdio: "ignore" });
|
|
475
|
+
} else {
|
|
476
|
+
try {
|
|
477
|
+
execSync(`chattr -i -R "${fullDir}"`, { stdio: "ignore" });
|
|
478
|
+
} catch {
|
|
479
|
+
}
|
|
480
|
+
execSync(`chmod -R u+w "${fullDir}"`, { stdio: "ignore" });
|
|
481
|
+
}
|
|
482
|
+
} catch {
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
465
486
|
function installHooks(selectedTools = []) {
|
|
487
|
+
unlockProtectedDirs();
|
|
466
488
|
const hooksDir = resolve2(".solongate", "hooks");
|
|
467
489
|
mkdirSync2(hooksDir, { recursive: true });
|
|
468
490
|
const guardPath = join(hooksDir, "guard.mjs");
|
|
@@ -522,6 +544,8 @@ function installHooks(selectedTools = []) {
|
|
|
522
544
|
const fullDir = resolve2(dir);
|
|
523
545
|
if (existsSync3(fullDir)) {
|
|
524
546
|
try {
|
|
547
|
+
execSync(`icacls "${fullDir}" /remove:d *S-1-1-0 /T /Q`, { stdio: "ignore" });
|
|
548
|
+
execSync(`icacls "${fullDir}" /deny *S-1-1-0:(OI)(CI)(W,D,DC,WDAC,WA,AD) /T /Q`, { stdio: "ignore" });
|
|
525
549
|
execSync(`attrib +R /S /D "${fullDir}"`, { stdio: "ignore" });
|
|
526
550
|
} catch {
|
|
527
551
|
}
|
|
@@ -535,10 +559,14 @@ function installHooks(selectedTools = []) {
|
|
|
535
559
|
execSync(`chmod -R a-w "${fullDir}"`, { stdio: "ignore" });
|
|
536
560
|
} catch {
|
|
537
561
|
}
|
|
562
|
+
try {
|
|
563
|
+
execSync(`chattr +i -R "${fullDir}"`, { stdio: "ignore" });
|
|
564
|
+
} catch {
|
|
565
|
+
}
|
|
538
566
|
}
|
|
539
567
|
}
|
|
540
568
|
}
|
|
541
|
-
console.log(" OS-level
|
|
569
|
+
console.log(" OS-level DENY protection applied (icacls/chmod)");
|
|
542
570
|
} catch {
|
|
543
571
|
}
|
|
544
572
|
console.log("");
|
package/dist/init.js
CHANGED
|
@@ -169,7 +169,29 @@ var HOOKS_DIR = resolve(__dirname, "..", "hooks");
|
|
|
169
169
|
function readHookScript(filename) {
|
|
170
170
|
return readFileSync(join(HOOKS_DIR, filename), "utf-8");
|
|
171
171
|
}
|
|
172
|
+
function unlockProtectedDirs() {
|
|
173
|
+
const dirs = [".solongate", ".claude", ".cursor", ".gemini", ".antigravity", ".openclaw", ".perplexity"];
|
|
174
|
+
for (const dir of dirs) {
|
|
175
|
+
const fullDir = resolve(dir);
|
|
176
|
+
if (!existsSync(fullDir)) continue;
|
|
177
|
+
try {
|
|
178
|
+
if (process.platform === "win32") {
|
|
179
|
+
execSync(`icacls "${fullDir}" /remove:d *S-1-1-0 /T /Q`, { stdio: "ignore" });
|
|
180
|
+
execSync(`attrib -R /S /D "${fullDir}"`, { stdio: "ignore" });
|
|
181
|
+
execSync(`icacls "${fullDir}" /reset /T /Q`, { stdio: "ignore" });
|
|
182
|
+
} else {
|
|
183
|
+
try {
|
|
184
|
+
execSync(`chattr -i -R "${fullDir}"`, { stdio: "ignore" });
|
|
185
|
+
} catch {
|
|
186
|
+
}
|
|
187
|
+
execSync(`chmod -R u+w "${fullDir}"`, { stdio: "ignore" });
|
|
188
|
+
}
|
|
189
|
+
} catch {
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
172
193
|
function installHooks(selectedTools = []) {
|
|
194
|
+
unlockProtectedDirs();
|
|
173
195
|
const hooksDir = resolve(".solongate", "hooks");
|
|
174
196
|
mkdirSync(hooksDir, { recursive: true });
|
|
175
197
|
const guardPath = join(hooksDir, "guard.mjs");
|
|
@@ -229,6 +251,8 @@ function installHooks(selectedTools = []) {
|
|
|
229
251
|
const fullDir = resolve(dir);
|
|
230
252
|
if (existsSync(fullDir)) {
|
|
231
253
|
try {
|
|
254
|
+
execSync(`icacls "${fullDir}" /remove:d *S-1-1-0 /T /Q`, { stdio: "ignore" });
|
|
255
|
+
execSync(`icacls "${fullDir}" /deny *S-1-1-0:(OI)(CI)(W,D,DC,WDAC,WA,AD) /T /Q`, { stdio: "ignore" });
|
|
232
256
|
execSync(`attrib +R /S /D "${fullDir}"`, { stdio: "ignore" });
|
|
233
257
|
} catch {
|
|
234
258
|
}
|
|
@@ -242,10 +266,14 @@ function installHooks(selectedTools = []) {
|
|
|
242
266
|
execSync(`chmod -R a-w "${fullDir}"`, { stdio: "ignore" });
|
|
243
267
|
} catch {
|
|
244
268
|
}
|
|
269
|
+
try {
|
|
270
|
+
execSync(`chattr +i -R "${fullDir}"`, { stdio: "ignore" });
|
|
271
|
+
} catch {
|
|
272
|
+
}
|
|
245
273
|
}
|
|
246
274
|
}
|
|
247
275
|
}
|
|
248
|
-
console.log(" OS-level
|
|
276
|
+
console.log(" OS-level DENY protection applied (icacls/chmod)");
|
|
249
277
|
} catch {
|
|
250
278
|
}
|
|
251
279
|
console.log("");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "MCP security proxy — protect any MCP server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|