tailscale / golink

A private shortlink service for tailnets
BSD 3-Clause "New" or "Revised" License
1.24k stars 80 forks source link

"duplicate node key" when running two golink services on the same machine with different hostnames #28

Open vielmetti opened 1 year ago

vielmetti commented 1 year ago

My goal: use one machine to run two different instances of "golink", so that I can have two independent sets of bookmarks.

This didn't work out of the box - I created a new key, started up the second instance with the -hostname flag, and then got the error message on the console Duplicate node key.

My suspicion is that I'm running into this:

tailscale data files in the tsnet-golink directory inside [os.UserConfigDir](https://pkg.go.dev/os#UserConfigDir)

and that I have to set two separate os.UserConfigDir paths to keep the two things distinct.

willnorris commented 1 year ago

Today, there are two ways you could get a different state directory... run the second instance as a different user, so that there is a different user config directory (basically what you're pointing out above), or copy the golink binary and rename it something else. tsnet includes the binary name in the state directory so that two different tsnet programs can side by side.