Skip to content

Commit 6bd6ea5

Browse files
committed
fix(gateway): narrow serve+none guard to tailscaleMode=serve only
The new auth.mode=none guard was dead code for the funnel path because the preceding funnel guard (line 125) already rejects funnel+non-password. Narrow the condition from tailscaleMode !== "off" to tailscaleMode === "serve" so the guard matches only the configuration it actually covers, and update the error message and test assertion accordingly. Addresses Greptile review feedback on PR #50631.
1 parent 33f58e5 commit 6bd6ea5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/gateway/server-runtime-config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ describe("resolveGatewayRuntimeConfig", () => {
264264
tailscale: { mode: "serve" },
265265
}),
266266
).rejects.toThrow(
267-
"tailscale serve/funnel requires gateway auth — refusing to start with auth.mode=none when tailscale is active",
267+
"tailscale serve requires gateway auth — refusing to start with auth.mode=none when tailscale serve is active",
268268
);
269269
});
270270

src/gateway/server-runtime-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ export async function resolveGatewayRuntimeConfig(params: {
127127
"tailscale funnel requires gateway auth mode=password (set gateway.auth.password or OPENCLAW_GATEWAY_PASSWORD)",
128128
);
129129
}
130-
if (tailscaleMode !== "off" && authMode === "none") {
130+
if (tailscaleMode === "serve" && authMode === "none") {
131131
throw new Error(
132-
"tailscale serve/funnel requires gateway auth — refusing to start with auth.mode=none when tailscale is active",
132+
"tailscale serve requires gateway auth — refusing to start with auth.mode=none when tailscale serve is active",
133133
);
134134
}
135135
if (tailscaleMode !== "off" && !isLoopbackHost(bindHost)) {

0 commit comments

Comments
 (0)