Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow port to be configured with direct assignment #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrishoage
Copy link

Closes: #84

Rational:

In some environments (like docker) it is desirable to expose the tailscale port to increase direct connection success. By default ts-net when encountering a 0 port will pick a port at random. This is difficult for docker since the ports are not known.

This work extends the node config to allow a node to gain a specific port, allowing for exposing in docker (or any other time where a user may wish to expose the port)

Steps to test:

  1. Check out branch and run xcaddy build --with github.com/tailscale/caddy-tailscale=$(pwd)

  2. Run the following caddyfile with TS_AUTHKEY in environment

{
  tailscale {
    ephemeral

    test-caddy {
      port 41650
    }
    other-caddy {
      port 41651
    }
    more-other-caddy {
      port 41652
    }
  }
}

:80 {
  bind tailscale/test-caddy
  respond OK
}
:80 {
  bind tailscale/other-caddy
  respond OK
}

:80 {
  bind tailscale/more-other-caddy
  respond OK
}
  1. Verify port and that caddy serves correctly

curl http://test-caddy

Signed-off-by: Chris Hoage <iam@chrishoage.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow configuration of port for tsnet to facilitate direct connections when run in containers
1 participant