@yawlabs/caddy-mcp 2.3.1 → 2.3.2
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/bin/caddy-mcp.mjs +9 -4
- package/package.json +3 -3
package/bin/caddy-mcp.mjs
CHANGED
|
@@ -180,7 +180,7 @@ function sandboxFlags() {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
const env = ["CADDY_ADMIN_URL","CADDY_API_TOKEN","CADDY_LOAD_TIMEOUT","CADDY_MAX_RETRIES","CADDY_TIMEOUT"];
|
|
183
|
+
const env = ["CADDY_ADMIN_URL", "CADDY_API_TOKEN", "CADDY_LOAD_TIMEOUT", "CADDY_MAX_RETRIES", "CADDY_TIMEOUT"];
|
|
184
184
|
|
|
185
185
|
const flags = ["--permission", netFlag, `--allow-env=${env.join(",")}`];
|
|
186
186
|
return flags;
|
|
@@ -276,7 +276,8 @@ if (mode === "node") {
|
|
|
276
276
|
const { writeSync } = await import("node:fs");
|
|
277
277
|
writeSync(
|
|
278
278
|
2,
|
|
279
|
-
"caddy-mcp: CADDY_MCP_RUNTIME=oam but no runnable oam binary was found.\n" +
|
|
279
|
+
"caddy-mcp: CADDY_MCP_RUNTIME=oam but no runnable oam binary was found.\n" +
|
|
280
|
+
shimNote +
|
|
280
281
|
"Install from https://oamjs.org, set OAM_BIN=/path/to/oam, or use CADDY_MCP_RUNTIME=node.\n",
|
|
281
282
|
);
|
|
282
283
|
process.exit(1);
|
|
@@ -354,7 +355,6 @@ if (mode === "node") {
|
|
|
354
355
|
}
|
|
355
356
|
|
|
356
357
|
if (child) {
|
|
357
|
-
|
|
358
358
|
// If oam cannot be executed at all (deleted between the stat and the spawn,
|
|
359
359
|
// wrong arch, permission), fall back rather than failing the whole server.
|
|
360
360
|
// `spawned` prevents falling back AFTER the child started, which would
|
|
@@ -397,7 +397,12 @@ if (mode === "node") {
|
|
|
397
397
|
// graceful shutdown the console's own Ctrl-C just started, skipping the
|
|
398
398
|
// child's process.on("exit") cleanup. The console has already notified the
|
|
399
399
|
// child, so on Windows the timer below is the only kill we issue.
|
|
400
|
-
|
|
400
|
+
// 5s, not 2s. This is a HARD kill of a server that may be mid-shutdown --
|
|
401
|
+
// flushing a large config, finishing a TLS provision -- and the cost of
|
|
402
|
+
// waiting too long (a wedged child lingers a few extra seconds) is far
|
|
403
|
+
// smaller than the cost of cutting a legitimate shutdown short. The window
|
|
404
|
+
// only ever elapses when the child has NOT exited on its own.
|
|
405
|
+
const ESCALATE_AFTER_MS = 5000;
|
|
401
406
|
let escalation = null;
|
|
402
407
|
for (const sig of ["SIGINT", "SIGTERM"]) {
|
|
403
408
|
process.on(sig, () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yawlabs/caddy-mcp",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"mcpName": "io.github.YawLabs/caddy-mcp",
|
|
5
5
|
"description": "MCP server for managing Caddy web servers via the admin API",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"build": "tsup && tsc -p tsconfig.build.json",
|
|
29
29
|
"dev": "tsup --watch",
|
|
30
30
|
"test": "vitest run",
|
|
31
|
-
"lint": "biome check src/",
|
|
32
|
-
"lint:fix": "biome check --write src/",
|
|
31
|
+
"lint": "biome check src/ bin/ scripts/",
|
|
32
|
+
"lint:fix": "biome check --write src/ bin/ scripts/",
|
|
33
33
|
"typecheck": "node scripts/typecheck.mjs",
|
|
34
34
|
"typecheck:tsc": "tsc --noEmit",
|
|
35
35
|
"test:ci": "npm run build && npm test",
|