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:
2026-09-29 18:46:19 -07:00
parent 77203955a5
commit dc1f6b81e9
3 changed files with 14 additions and 2 deletions

View File

@@ -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 });
}
});
}