diff --git a/README.md b/README.md index 42fe797..f1c96d5 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ environment variables. All of them are optional. | `-use-funnel` | `USE_FUNNEL` | `false` | If set, expose individual pastes to the public internet with [Funnel](https://tailscale.com/kb/1223/funnel). | | `-hide-funnel-users` | `HIDE_FUNNEL_USERS` | `false` | If set, don't display the username and profile picture of the user who created the paste in funneled pastes. | | `-http-port` | `HTTP_PORT` | unset | If set, expose individual pastes on a HTTP server running on the given port. | +| `-control-url` | `TSNET_CONTROL_URL` | unset | If set, a custom control server to use, e.g. for Headscale users. | ## Deploying diff --git a/cmd/tclipd/main.go b/cmd/tclipd/main.go index 9610667..b74ce88 100644 --- a/cmd/tclipd/main.go +++ b/cmd/tclipd/main.go @@ -41,6 +41,7 @@ var ( useFunnel = flag.Bool("use-funnel", hasEnv("USE_FUNNEL"), "if set, expose individual pastes to the public internet with Funnel, USE_FUNNEL in the environment") hidePasteUserInfo = flag.Bool("hide-funnel-users", hasEnv("HIDE_FUNNEL_USERS"), "if set, display the username and profile picture of the user who created the paste in funneled pastes") httpPort = flag.String("http-port", envOr("HTTP_PORT", ""), "optional http port to start an http server on, e.g for reverse proxies. will only serve funnel endpoints") + controlUrl = flag.String("control-url", envOr("TSNET_CONTROL_URL", ""), "optional alternate control server URL to use, for e.g. headscale") //go:embed schema.sql sqlSchema string @@ -672,9 +673,10 @@ func main() { os.MkdirAll(filepath.Join(*dataDir, "tsnet"), 0700) s := &tsnet.Server{ - Hostname: *hostname, - Dir: filepath.Join(*dataDir, "tsnet"), - Logf: func(string, ...any) {}, + Hostname: *hostname, + Dir: filepath.Join(*dataDir, "tsnet"), + Logf: func(string, ...any) {}, + ControlURL: *controlUrl, } if *tsnetLogVerbose {