Security: require agent API key; same-origin API behind login

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MetatronCube Ops 2026-11-02 15:13:59 +00:00
parent 717e45c11f
commit 96eaf9e67f
2 changed files with 4 additions and 0 deletions

View File

@ -2,3 +2,6 @@ DATABASE_URL="postgresql://postgres:postgres@localhost:5432/mtc_reverse_proxy?sc
PORT=4000 PORT=4000
FRONTEND_ORIGINS="http://localhost:5173,http://127.0.0.1:5173" FRONTEND_ORIGINS="http://localhost:5173,http://127.0.0.1:5173"
REVERSE_PROXY_TIMEOUT_MS=15000 REVERSE_PROXY_TIMEOUT_MS=15000
# key for the Hestia-Nginx-Reverse-Proxy agents (same on every server)
AGENT_API_KEY=

View File

@ -421,6 +421,7 @@ router.post("/services/:id/reverse-proxy", async (req, res, next) => {
method, method,
headers: { headers: {
"content-type": "application/json", "content-type": "application/json",
...(gateway && process.env.AGENT_API_KEY ? { "x-api-key": process.env.AGENT_API_KEY } : {}),
}, },
body: method === "GET" ? undefined : JSON.stringify(body || {}), body: method === "GET" ? undefined : JSON.stringify(body || {}),
signal: controller.signal, signal: controller.signal,