Spaces:
Running
Running
Fix Caddy routing syntax for MCP auth and bind Codeman to loopback
Browse files- config/Caddyfile.example +2 -2
- entrypoint.sh +1 -0
- services/25-codeman.sh +1 -1
config/Caddyfile.example
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
not header Authorization "Bearer @man.g"
|
| 6 |
not header X-API-Key "@man.g"
|
| 7 |
}
|
| 8 |
-
|
| 9 |
-
|
| 10 |
}
|
| 11 |
|
| 12 |
handle /mcp* {
|
|
|
|
| 5 |
not header Authorization "Bearer @man.g"
|
| 6 |
not header X-API-Key "@man.g"
|
| 7 |
}
|
| 8 |
+
handle @mcp_unauth {
|
| 9 |
+
respond "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32000,\"message\":\"Unauthorized: Bearer token or X-API-Key required.\"},\"id\":null}" 401
|
| 10 |
}
|
| 11 |
|
| 12 |
handle /mcp* {
|
entrypoint.sh
CHANGED
|
@@ -40,6 +40,7 @@ done
|
|
| 40 |
# 2. Persistent Caddyfile on /data (user-editable):
|
| 41 |
# Always sync from template to apply latest routing rules and remove stale directives
|
| 42 |
cp /app/config/Caddyfile.example /data/Caddyfile
|
|
|
|
| 43 |
|
| 44 |
# 3. Enforce Browser Lockdown
|
| 45 |
rm -rf /root/.cache/ms-playwright /root/.cache/puppeteer /tmp/.cache/ms-playwright 2>/dev/null || true
|
|
|
|
| 40 |
# 2. Persistent Caddyfile on /data (user-editable):
|
| 41 |
# Always sync from template to apply latest routing rules and remove stale directives
|
| 42 |
cp /app/config/Caddyfile.example /data/Caddyfile
|
| 43 |
+
caddy fmt --overwrite /data/Caddyfile 2>/dev/null || true
|
| 44 |
|
| 45 |
# 3. Enforce Browser Lockdown
|
| 46 |
rm -rf /root/.cache/ms-playwright /root/.cache/puppeteer /tmp/.cache/ms-playwright 2>/dev/null || true
|
services/25-codeman.sh
CHANGED
|
@@ -40,4 +40,4 @@ if [ -z "$CMD" ] || [ ! -x "$CMD" ]; then
|
|
| 40 |
CMD="npx -y aicodeman@latest"
|
| 41 |
fi
|
| 42 |
|
| 43 |
-
exec $CMD --port 3000 --host
|
|
|
|
| 40 |
CMD="npx -y aicodeman@latest"
|
| 41 |
fi
|
| 42 |
|
| 43 |
+
exec $CMD --port 3000 --host 127.0.0.1 >> "$LOG" 2>&1
|