-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support for Serve and Funnel #117
Comments
Correction: TS_SERVE_CONFIG is only supported while running within a Docker container. I don't imagine people are going to be using this ansible role to configure tailscale in a Docker container. |
Another idea is to require all of the available arguments to be specified. Enabled would accept 5? and disabled would accept 2. It can be argued that this tailscale serve 3000 Is much harder to understand compared to the command fully written out tailscale serve --bg --https=443 --set-path=/ http://127.0.0.1:3000 Here are some more examples
|
Another idea is to just pass in the raw commands # tailscale serve --bg --http=80 --set-path=/ http://localhost:8000
tailscale_serve_commands:
- "tailscale serve --bg --http=80 --set-path=/ http://localhost:8000" This provides the most flexibility, but it's not using the usual Ansible yaml code structure. |
So supporting all of the serve and funnel arguments would be quite complex.
Looking at https://tailscale.com/blog/reintroducing-serve-funnel, here are some of the possible configurations for using these commands.
As a user, I appreciate that there are a lot of different ways to configure serving and funnel traffic. As a maintainer of this ansible role, it is annoying to try to figure out how to standardize these commands and flags in a way that makes sense for ansible.
An alternative option is providing a JSON file via the
TS_SERVE_CONFIG
env var. The description for this env var, as mentioned here https://tailscale.com/kb/1282/docker#ts_serve_config, saysSo as an example, if I want to serve traffic on :80 and forward it to my application, I can create the following JSON file
/serve-config/tailscale-serve-config.json
And set the environment variable like so
And then upon starting, Tailscale will pick this up and start serving traffic as directed.
The only problem with this approach is this JSON file is responsible for storing ALL serving and forwarding traffic information. There isn't a way to specify multiple files for serving traffic. So if traffic is already being served via a different JSON file and this file is instead placed there, then the previous serving configuration is essentially deleted.
Since it doesn't seem like there is a documented way of building this JSON file and thus some sort of backwards compatibility guarantee, I feel the only option is to allow the user to pass in a JSON structure via and ansible var and then have it be set at the proper location.
The only other thing I could do is document some command commands on their JSON outputs for users to try and experiment on their own. For example, given the Tailscale example commands above, I could provide the equivalent JSON structures for the user to test for themselves.
The text was updated successfully, but these errors were encountered: