Skip to content

Conversation

@sekunho
Copy link

@sekunho sekunho commented Dec 6, 2025

Hey 👋

This adds the ability for caddy-tailscale to set the auth_key directive using the provided file's contents. The file:<PATH> syntax is akin to what is being used in the CLI.

tailscale {
  auth_key "file:/path/to/authkey"
}

If it's not prefixed with file:, it falls back to the default behavior where it treats it as the actual authkey value.

@@ -0,0 +1 @@
tskey-auth-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure where else to put this but this is only relevant for the test. 😅

@willnorris
Copy link
Member

Hey, thanks for the contribution! It turns out this actually isn't need though, since caddy provides this support natively as a global placeholder. This syntax is only slightly different from what you have. Try this:

{
  tailscale {
    ephemeral
    auth_key {file./tmp/key}
  }
}

:80 {
  bind tailscale/
  respond OK
}

@sekunho
Copy link
Author

sekunho commented Dec 6, 2025

Oh wow wait I had no idea this was a thing. Thank you!!

@sekunho sekunho closed this Dec 6, 2025
@sekunho sekunho deleted the feat-file-authkey branch December 6, 2025 03:35
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.

2 participants