Skip to content

Commit e5d51e6

Browse files
committed
golink: add a --config-dir flag to override the default
By default, the directory chosen by tsnet is based on the name of the binary. Allow the operator to set it explicitly, to avoid confusing deployments. Signed-off-by: M. J. Fromberger <[email protected]>
1 parent 43d714d commit e5d51e6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

golink.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ var (
6262
useHTTPS = flag.Bool("https", true, "serve golink over HTTPS if enabled on tailnet")
6363
snapshot = flag.String("snapshot", "", "file path of snapshot file")
6464
hostname = flag.String("hostname", defaultHostname, "service name")
65+
configDir = flag.String("config-dir", "", `tsnet configuration directory ("" to use default)`)
6566
resolveFromBackup = flag.String("resolve-from-backup", "", "resolve a link from snapshot file and exit")
6667
allowUnknownUsers = flag.Bool("allow-unknown-users", false, "allow unknown users to save links")
6768
)
@@ -176,6 +177,7 @@ func Run() error {
176177
// create tsNet server and wait for it to be ready & connected.
177178
srv := &tsnet.Server{
178179
ControlURL: *controlURL,
180+
Dir: *configDir,
179181
Hostname: *hostname,
180182
Logf: func(format string, args ...any) {},
181183
RunWebClient: true,

0 commit comments

Comments
 (0)