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

TS_SERVE_CONFIG is ignored when HTTPS is not enabled #14495

Open
Brokolis opened this issue Dec 29, 2024 · 1 comment · May be fixed by #14538
Open

TS_SERVE_CONFIG is ignored when HTTPS is not enabled #14495

Brokolis opened this issue Dec 29, 2024 · 1 comment · May be fixed by #14538

Comments

@Brokolis
Copy link

What is the issue?

When I tried to use the TS_SERVE_CONFIG environment variable (documentation referenced below) to set a serve config when deploying Tailscale in K3s (Kubernetes), the serve config was not being set (as observed by tailscale serve status --json and inspecting tailscaled.state file, and serve itself not working). No error message is being displayed either. After investigating, I believe I found the offending code with a relevant TODO item, referenced below.

Tailscale currently fails to start if the file referenced by TS_SERVE_CONFIG is missing or malformed, but not when it is being ignored. I think at the very least, Tailscale should show an error message or even fail to start, if this issue is more complicated than simply removing the if statement.

For anyone wondering, the current workaround is to use cat config.json | tailscale serve set-raw, but set-raw is an undocumented feature that might be gone anytime.

In any case, thank you very much for this software! Tailscale is really convenient to use and I am willing to hack around it if it means that I can avoid other less convenient alternatives.

References:

Steps to reproduce

No response

Are there any recent changes that introduced the issue?

No response

OS

No response

OS version

No response

Tailscale version

1.78.3

Other software

No response

Bug report

No response

@EpicureanDigitalEngineer

For those arriving here and looking for a workaround when using tailscale through a docker compose file to serve a non-HTTPS set of services, the following has worked for me as part of the tailscale service directive:

    post_start:
      - command: [sh, -c, "cat /config/ts-serve.json | tailscale serve set-raw"]

where ts-serve.json is your configuration file

irbekrm added a commit that referenced this issue Jan 5, 2025
…in tailnets with HTTPS disabled

Fixes an issue where, if a tailnet has HTTPS disabled, no serve config
set via TS_SERVE_CONFIG was loaded, even if it did not contain
an HTTPS endpoint.
Now serve config provided to containerboot is considered invalid
for tailnets with no HTTPS only if there is an HTTPS endpoint defined in the config.

Fixes #14495

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
irbekrm added a commit that referenced this issue Jan 5, 2025
…ain HTTPS endpoint in tailnets with HTTPS disabled

Fixes an issue where, if a tailnet has HTTPS disabled, no serve config
set via TS_SERVE_CONFIG was loaded, even if it does not contain an HTTPS endpoint.
Now for tailnets with HTTPS disabled serve config provided to containerboot is considered invalid
(and therefore not loaded) only if there is an HTTPS endpoint defined in the config.

Fixes #14495

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
irbekrm added a commit that referenced this issue Jan 5, 2025
…ain HTTPS endpoint in tailnets with HTTPS disabled

Fixes an issue where, if a tailnet has HTTPS disabled, no serve config
set via TS_SERVE_CONFIG was loaded, even if it does not contain an HTTPS endpoint.
Now for tailnets with HTTPS disabled serve config provided to containerboot is considered invalid
(and therefore not loaded) only if there is an HTTPS endpoint defined in the config.

Fixes #14495

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants