Repository navigation
cmd/tclipd: support reading TS_AUTHKEY from a file - #113
Open
RyanDraves wants to merge 1 commit into
Open
RyanDraves wants to merge 1 commit into
RyanDraves wants to merge 1 commit into
Conversation
The published image is based on gcr.io/distroless/static and so has no shell, and tsnet reads TS_AUTHKEY directly from the environment. Together these mean there is no way to supply the authkey as a Docker or Kubernetes secret, which is delivered as a mounted file: the usual trick of reading the file in an entrypoint needs a shell that isn't there. Resolve the "file:" prefix already used by the Tailscale container images, so TS_AUTHKEY=file:/run/secrets/tclip_authkey reads the key from that path. Surrounding whitespace is trimmed, since secret files conventionally end in a newline. A missing or empty file is fatal rather than falling through to an interactive login the operator would never see. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The published image is based on gcr.io/distroless/static and so has no
shell, and tsnet reads TS_AUTHKEY directly from the environment. Together
these mean there is no way to supply the authkey as a Docker or Kubernetes
secret, which is delivered as a mounted file: the usual trick of reading
the file in an entrypoint would require the missing shell.
Resolve the "file:" prefix already used by the Tailscale container images,
so
TS_AUTHKEY=file:/run/secrets/tclip_authkeyreads the key from that path.Surrounding whitespace is trimmed, since secret files conventionally end in
a newline. A missing or empty file is fatal rather than falling through to
an interactive login the operator would never see.
Test plan: I build the docker image and confirmed docker compose secrets work
as specified in the README example.
AI usage: Claude generated the commit. I reviewed and cleaned up its writing.