~bigbes/sr-ht-dolt

8583f3a605bd36fbeb448a3605a327fdd8ca6545 — Eugene Blikh 30 days ago 2dfab04
doltsrht: pass full os.Args to server.New so -b binds the web listener

getopt skips argv[0] as the program name, so os.Args[1:] made it swallow the
first real flag (-b) and silently fall back to defaultWebAddr (localhost),
leaving the web UI unreachable from Traefik. Match compare/upstream: pass os.Args.
1 files changed, 6 insertions(+), 1 deletions(-)

M cmd/doltsrht/main.go
M cmd/doltsrht/main.go => cmd/doltsrht/main.go +6 -1
@@ 136,7 136,12 @@ func main() {

	// server.New parses -b/-d/-m/-p and runs crypto.InitCrypto (needs
	// [sr.ht]network-key + [webhooks]private-key; missing keys panic here).
	srv := server.New(serviceName, defaultWebAddr, conf, os.Args[1:])
	// Pass the full os.Args: core-go's getopt skips argv[0] as the program name
	// itself (like every upstream sourcehut daemon). Passing os.Args[1:] makes
	// getopt swallow the first real flag (e.g. -b) as the program name, so the
	// web bind silently falls back to defaultWebAddr (localhost) — unreachable
	// from Traefik/other containers.
	srv := server.New(serviceName, defaultWebAddr, conf, os.Args)

	cfg, err := resolveSettings(conf)
	if err != nil {