From 412b5f0d535fd6d5ef8df15d8b2567cc48f6dd8d Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 11 Mar 2026 20:11:26 +0000 Subject: [PATCH] server/tailsql: make ControlURL configurable Signed-off-by: Kristoffer Dalby --- cmd/tailsql/tailsql.go | 7 ++++--- server/tailsql/options.go | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/tailsql/tailsql.go b/cmd/tailsql/tailsql.go index 3e4a067..4c22527 100644 --- a/cmd/tailsql/tailsql.go +++ b/cmd/tailsql/tailsql.go @@ -128,9 +128,10 @@ func runLocalService(ctx context.Context, opts tailsql.Options, port int) error func runTailscaleService(ctx context.Context, opts tailsql.Options) error { tsNode := &tsnet.Server{ - Dir: os.ExpandEnv(opts.StateDir), - Hostname: opts.Hostname, - Logf: logger.Discard, + Dir: os.ExpandEnv(opts.StateDir), + Hostname: opts.Hostname, + ControlURL: opts.ControlURL, + Logf: logger.Discard, } if flags.DebugLog { tsNode.Logf = log.Printf diff --git a/server/tailsql/options.go b/server/tailsql/options.go index 1de2099..67faf0e 100644 --- a/server/tailsql/options.go +++ b/server/tailsql/options.go @@ -39,6 +39,10 @@ type Options struct { // If true, serve HTTPS instead of HTTP (tsnet). ServeHTTPS bool `json:"serveHTTPS,omitempty"` + // The URL of the coordination server to use (tsnet). + // If empty, the Tailscale default is used. + ControlURL string `json:"controlURL,omitempty"` + // If non-empty, a SQLite database URL to use for local state. LocalState string `json:"localState,omitempty"`