Repository navigation
refactor(gateway)!: group listener settings under [listeners.*] - #1587
Merged
Merged
Conversation
This was referenced Nov 15, 2026
kvinwang
force-pushed
the
refactor/gateway-listeners-config
branch
from
November 15, 2026 17:02
d61d992 to
8dfcd94
Compare
The gateway's RPC listener was configured at the top level of gateway.toml, and its admin and debug listeners in [core.admin] and [core.debug], mixed with admin auth and a proxy setting. Move them, as in the KMS, to [listeners.guest] (address, tls with mutual), [listeners.admin] (with its auth) and [listeners.debug] (insecure_enable_debug_rpc becomes enabled), with [listeners.default] inherited by each: the Rocket settings that were at the top level, and proxy_protocol. insecure_localhost_backend moves to [core.proxy], since it governs proxied app traffic. Old locations are refused at startup. The listener config helpers move from the KMS to load_config, shared by both. Update the gateway image entrypoint, dev-stack, the gateway test configs (e2e, cluster, proxy) and docs. Signed-off-by: Kevin Wang <wy721@qq.com>
Also note that proxy_protocol needs a TCP listener: one bound to a Unix socket fails to start with it, so it must override an inherited proxy_protocol = true. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
refactor/gateway-listeners-config
branch
from
November 15, 2026 17:12
8dfcd94 to
dfa1280
Compare
kvinwang
added a commit
that referenced
this pull request
Nov 16, 2026
#1585 and #1587 moved the listener settings of the KMS and the gateway under [listeners.*] and refuse the old locations at startup, so every fixture that rendered [rpc], [core.admin], [core.onboard] address/port, the gateway's top-level address and [tls], [core.admin] or [core.debug] would fail to start. Render the new sections for the candidate binaries; the upgrade matrix keeps the old ones for released KMS images. Also update the configuration inventory. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 16, 2026
Runs the product tests added for launch tickets (#1577), the dstack-mr lite check and dstack-verifier-wasm (#1555), the SEV-SNP key provider (#1526), the PROXY header reader (#1582) and the refusal of old listener settings (#1585, #1587). A row matching no test fails. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 16, 2026
The fixture inserted it after the first "[core.proxy]" line, which in the #1587 gateway.toml ends a comment in [listeners.default], so the gateway used the system resolver and tc-gw-proxy-prot-005 saw no query. Signed-off-by: Kevin Wang <wy721@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1585.
Breaking: the gateway refuses a config that uses the old listener settings; update
gateway.tomltogether with the gateway image (the image's own entrypoint, which writes it, is updated here).The gateway's RPC listener was configured at the top level of
gateway.toml, and its admin and debug listeners in[core.admin]and[core.debug], mixed with admin auth and a proxy setting. As in the KMS (#1585):[listeners.default]workers,keep_alive,log_level,ident, ...),proxy_protocol[listeners.guest]address,tls(withmutual); CVMs register here and peers sync over itaddress,[tls][listeners.admin]enabled,address,auth_token,htpasswd_file,insecure_no_auth[core.admin][listeners.debug]enabled,address[core.debug](insecure_enable_debug_rpc)[core.proxy]insecure_localhost_backend[core.debug]; it governs proxied app traffic, not a listenerThe Rocket settings now in
[listeners.default]used to apply only to the RPC listener; admin and debug now inherit them too (e.g.workers = 8instead of the CPU count).Old locations are refused at startup, naming the new ones, e.g.
tls -> listeners.guest.tls, core.admin -> listeners.admin. The helpers that build a listener's config and refuse the old locations move from the KMS toload_config, shared by both.[core.proxy](app traffic) and[core.wg](WireGuard) stay: they are not Rocket listeners.Updated: the gateway image
entrypoint.sh(also used by the full-stack test's current gateway image),tools/dev-stack.sh, the gateway test configs (test-run/e2e/configs,test-run/cluster/lib.sh,test-run/proxy/gwconfig.py),gateway/docs/cluster-deployment.md,docs/dstack-gateway.mdand the security best practices.Testing
[tls],[core.admin],[core.debug] insecure_localhost_backendand a top-levelproxy_protocolare refused with their new locations.cargo testpasses fordstack-gateway(334),dstack-kms(96) andload_config; clippy with the CI flags andcargo fmt --checkpass.e2e/configs/gateway-{1,2,3}.toml, the cluster harness's generated config, the proxy harness's generated config) loads in the new gateway binary: startup gets past config loading and listener setup and stops at WireGuard interface creation, which needs root on this host. The gateway was not run end to end locally, and the gateway e2e CI does not run on a PR stacked on a feature branch; it runs once this reachesnext.Verified on TDX
Run on the tdxlab TDX host with real TDX CVMs (guest OS dstack 0.6.0), from one local build of #1580, #1582, #1585 and #1587 merged with #1583 and #1588: the official 0.6.3 KMS and gateway images with these binaries (and the gateway's new
entrypoint.sh). The KMS ran in a CVM with a local key provider and a webhook auth backend (allow all but one app; this KMS's root epoch 0 registered); haproxy withsend-proxy-v2fronted the guest listeners of the KMS and the gateway.entrypoint.shwrites ([listeners.guest]with its mutual TLS,[listeners.admin]with the token), withproxy_protocoladded to[listeners.guest]: an app CVM registered and brought up WireGuard; the admin listener required the token.