hassio-addons / addon-tailscale

Tailscale - Home Assistant Community Add-ons
MIT License
195 stars 74 forks source link

Ablity to specify endpoint port for easy port forwarding #388

Open rafajrichard opened 1 month ago

rafajrichard commented 1 month ago

Problem/Motivation

Currently, the Docker environment variable "PORT=xxx" is not configurable, which causes the port to change on every restart of the container. This creates an issue for users who need to set a specific port for the endpoint and enable port forwarding for Tailscale without going through a DERP proxy.

Expected behavior

There should be a configuration option to set the Docker environment variable "PORT=xxx" so that users can define a specific port. This would allow for a consistent endpoint port across reboots which would allow straightforward port forwarding.

Actual behavior

The Docker environment variable "PORT=xxx" is configurable. This results in the endpoint port changing on every reboot of the container, complicating the setup for port forwarding and Tailscale integration, as the port must be manually adjusted each time.

Steps to reproduce

Set up the Docker container without the ability to specify the "PORT" environment variable. Reboot the Docker container. Observe that the port changes on every reboot.

Proposed changes

Add a configuration option in the Docker setup to allow users to specify the environment variable "PORT=xxx". This will enable users to set a consistent endpoint port, preventing changes on container reboots, and facilitate port forwarding for Tailscale.

lmagyar commented 1 month ago

Duplicate of #372 (closed without fix)

Strange as it is, but it is true, this is required. I've made some experiments, and TS "just works" is not (always) true. Without fixing and forwarding the UDP port, TS add-on behind a "normal" non-CGNAT-ed ISP WAN (userspace-networking is enabled or not), was never able to establish a peer-to-peer connection to a CGNAT-ed phone, even pinging the phone for minutes. With fixed and forwarded UDP port, it is on peer-to-peer connection nearly immediately.

And it is true for my Win TS client also. So it seems to be TS or router/ISP related root cause. But worth a fix.

UPDATE: Tested on another location, different router, different ISP, same HA/add-on versions, same issue, so the root cause seems to be TS related.

PR will follow...

github-actions[bot] commented 3 weeks ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

lmagyar commented 3 weeks ago

Not stale, there is a PR waiting for decision whether it should be a plain config option or a network port.