fix: honor admin.tls.enabled in dual-port mode#92
Merged
christianromeni merged 1 commit intoMay 20, 2026
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
|
Sorry for the slow response on this - sat here almost a week. Merged today and released as v0.0.19. Repro, root cause, and tests were all solid. Thanks for the careful write-up. |
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.
Problem
server.admin.tls.{enabled,cert,key}exists in the config schema and is enforced byvalidate.go, but enabling it has no effect — the admin server is always started in plain HTTP. The Helm chart, the deployment docs, and the struct's own godoc all describe it as a working feature.Repro with
voidllm.yaml:After startup:
docs/deployment/reverse-proxy.md:63says "VoidLLM supports TLS on the admin port (server.admin.tls) but not on the proxy port" — but the wiring to make that true never landed.Cause
TLSConfighas been in the schema since1dea0e1(v0.0.1) with validation that rejects empty cert/key when enabled (internal/config/validate.go:88-95). However, the only other readers in the repo before this PR are insidevalidate()itself —cfg.Server.Admin.TLSis never consumed by any listener. The admin goroutine inApplication.startListening(internal/app/routes.go:154) unconditionally calls plainListen(adminAddr), sotls.enabled: trueis silently a no-op.Fix
In dual-port mode, branch on
cfg.Server.Admin.TLS.Enabledand pass cert/key to Fiber v3 viaListenConfig:Cert/key paths appear only in the error log on TLS startup failure; the boot-time INFO log only adds
admin_tls=<bool>so ops can confirm state.Single-port mode (where admin shares the proxy port) does not apply TLS —
docs/deployment/reverse-proxy.mdalready recommends external termination for the proxy. Configuringtls.enabled: truewhile in single-port mode now emits oneWARNat startup ("admin TLS configured but ignored in single-port mode") instead of silently dropping it.Backward-compatible:
tls.enabled: false(the default) is runtime-identical. The only log delta is the newadmin_tls=falseattribute on the existing "starting servers" line.Test plan
Added
internal/app/admin_tls_test.gowith three tests using an in-test self-signed RSA-2048 cert written tot.TempDir():TestAdminTLS_Enabled— admin port accepts TLS, returns 200 on HTTPS/healthz; plain HTTP against the same port fails.TestAdminTLS_Disabled— admin port serves plain HTTP; TLS handshake against the same port fails (regression guard for the default config).TestAdminTLS_SinglePortWarn— single-port mode withtls.enabled: trueemits the warn; disabled does not.Validated locally:
go test ./...— all packages greengo vet ./...— cleangofmt -l internal/app— cleancurl -k https://localhost:9443/healthzagainst a running server with TLS enabled returns 200; plainhttp://…fails handshake