test(deploy): Doctor must check the client-address configuration the API runs
Behind the reference proxy the API runs in trusted-proxy mode, but compose.proxy.yaml gives those variables to `api` only. The documented Doctor command runs as `migrate`, so it validated an empty configuration and reported "Direct client-address mode" for an installation that trusts its proxy. That is what the first production installation saw. Fails today: - deploy.test.ts: the proxy overlay gives `migrate` no client-address environment; - doctor.test.ts: the check does not say whose configuration it read; - smoke-deploy.sh: Doctor through the proxy overlay does not report trusted-proxy mode (Docker). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
committed by
The_River
co-authored by
Claude Opus 5.5
parent
fa493365bd
commit
54ac6ab83f
@@ -958,6 +958,21 @@ describe("Ekklesia Doctor diagnostics", () => {
|
||||
expect(report.result).toBe("ready-with-warnings");
|
||||
});
|
||||
|
||||
it("says whose client-address configuration it checked: this process's, not a running API's", async () => {
|
||||
for (const clientAddress of [
|
||||
undefined,
|
||||
{ header: "x-forwarded-for", mode: "trusted-proxy" as const, trustedProxies: ["10.0.0.1"] },
|
||||
{ header: "x-forwarded-for", mode: "trusted-proxy" as const, trustedProxies: ["bad"] },
|
||||
]) {
|
||||
const report = await diagnoseEkklesia(
|
||||
{ ...options(), ...(clientAddress ? { clientAddress } : {}) },
|
||||
dependencies(),
|
||||
);
|
||||
const details = check(report, "identity.client-address").details;
|
||||
expect(details.some((detail) => detail.includes("environment Doctor runs with"))).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("passes client-address configuration with an explicitly configured trusted-proxy mode", async () => {
|
||||
const report = await diagnoseEkklesia(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user