Fix egress network internet leak, tinyproxy group config, surface real fetch errors
- docker-compose.yml: mark 'egress' network internal: true. Every Docker bridge network gets outbound NAT to the internet by default, not just 'default' - missing this meant sde-meeting-toolkit still had a direct route out despite being off 'default'. Confirmed via a real smoke test run (Check 2 failed before this fix). - egress-proxy/tinyproxy.conf: 'Group nogroup' doesn't exist on Alpine, only 'nobody'. Fixed to 'Group nobody' for both User and Group. - server.js: surface err.cause alongside err.message when the Anthropic call fails. undici wraps the real reason in a generic 'fetch failed' TypeError; without this the actual cause was invisible in both the API response and the logs.
This commit is contained in:
@@ -73,3 +73,10 @@ networks:
|
||||
external: true
|
||||
egress:
|
||||
driver: bridge
|
||||
# Without this, Docker still gives this network a NAT route to the
|
||||
# public internet (every bridge network gets one by default, "default"
|
||||
# isn't special) - which defeats the whole point. internal: true means
|
||||
# nothing on this network, including sde-meeting-toolkit, has any route
|
||||
# out except through egress-proxy, which also sits on "default" and IS
|
||||
# meant to have one.
|
||||
internal: true
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# other outbound request from the app is refused here, not just unrouted,
|
||||
# so a compromised app container still can't reach anything else.
|
||||
User nobody
|
||||
Group nogroup
|
||||
Group nobody
|
||||
|
||||
Port 8888
|
||||
|
||||
|
||||
@@ -341,7 +341,12 @@ function proxyToClaude(req, res, user) {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
sendJson(res, 502, { error: 'Could not reach the Anthropic API: ' + err.message });
|
||||
// undici's fetch wraps the real reason in a generic "fetch failed"
|
||||
// TypeError, with the actual cause one level down in err.cause.
|
||||
// Surface both, or "fetch failed" alone tells you nothing.
|
||||
const detail = err.cause ? (err.message + ' - ' + err.cause.message) : err.message;
|
||||
console.error('Anthropic API call failed:', detail);
|
||||
sendJson(res, 502, { error: 'Could not reach the Anthropic API: ' + detail });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user