fix(gateway): auto-bind to 0.0.0.0 inside container environments

This commit is contained in:
openperf
2026-04-06 18:26:59 +08:00
committed by Peter Steinberger
parent 4a91b4f3a5
commit c857e93735
9 changed files with 445 additions and 32 deletions

View File

@@ -16,6 +16,7 @@ import type { ServiceConfigAudit } from "../../daemon/service-audit.js";
import type { GatewayServiceRuntime } from "../../daemon/service-runtime.js";
import { resolveGatewayService } from "../../daemon/service.js";
import { trimToUndefined } from "../../gateway/credentials.js";
import { defaultGatewayBindMode } from "../../gateway/net.js";
import {
inspectBestEffortPrimaryTailnetIPv4,
resolveBestEffortGatewayBindHostForDisplay,
@@ -260,7 +261,9 @@ async function resolveGatewayStatusSummary(params: {
const portSource: GatewayStatusSummary["portSource"] = portFromArgs
? "service args"
: "env/config";
const bindMode: GatewayBindMode = params.daemonCfg.gateway?.bind ?? "loopback";
const statusTailscaleMode = params.daemonCfg.gateway?.tailscale?.mode ?? "off";
const bindMode: GatewayBindMode =
params.daemonCfg.gateway?.bind ?? defaultGatewayBindMode(statusTailscaleMode);
const customBindHost = params.daemonCfg.gateway?.customBindHost;
const { bindHost, warning: bindHostWarning } = await resolveBestEffortGatewayBindHostForDisplay({
bindMode,