Repository navigation
AFFiNE, Immich, Kaneo, Karakeep, KitchenOwl and 4 more: keep TS_AUTHKEY out of the containers that load .env - #435
Merged
Conversation
…EY out of the containers that load .env Nine stacks load the whole .env file into their containers with env_file, so 17 containers besides the sidecar receive the Tailscale auth key. Set TS_AUTHKEY to an empty value in the environment of each of them. environment takes precedence over env_file, so every other variable that users put in .env still reaches the containers. Also covers LubeLogger, NetBox, Pocket ID, and Tandoor Recipes. Update the "reads the whole .env file" deviation in each README, and add a rule for new stacks to CONTRIBUTING.md.
jackspiering
marked this pull request as draft
November 22, 2026 22:37
7 of 9 tasks
jackspiering
marked this pull request as ready for review
November 23, 2026 08:11
crypt0rr
approved these changes
Nov 23, 2026
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.
Description
Nine stacks load the whole
.envfile into their containers withenv_file. As a result, 17 containers besides the sidecar receiveTS_AUTHKEY, which only thetailscalecontainer needs. The READMEs already list this as a deviation.This PR sets
TS_AUTHKEYto an empty value in theenvironmentof each of those containers.environmenttakes precedence overenv_file, so every other variable still reaches the containers. Several READMEs tell users to add settings to.env, for exampleDISABLE_SIGNUPSfor Karakeep and the OIDC values for KitchenOwl. Replacingenv_filewith an explicit list would have dropped such settings without warning.application,affine_migrationapplication,immich-machine-learningapplication,postgresweb,meilisearchkitchenowlapplicationnetbox(andnetbox-workerthrough the YAML anchor),postgres,redis,redis-cacheapplicationapplicationAlso:
.envfile" deviation now says thatTS_AUTHKEYis the exception.environmentand avoidenv_file: .env. A stack that keepsenv_filesetsTS_AUTHKEY=and lists the deviation.tailscale-*sidecars are left alone. They are Tailscale containers and need the key.Related Issues
Verification
docker compose config --quietfrom each of the 9 changed service directories, with dummy values for required variables.TS_AUTHKEYin a scratch copy of.env, and compared the full Compose models. They are identical except thatTS_AUTHKEYis now empty in the 17 containers above. Thetailscalecontainer keeps the key.TS_AUTHKEYis empty, and other.envvalues such asTRUST_PROXYare still set. The sidecar still has the key and joined the Tailnet./.well-known/openid-configurationreturned HTTP 200 through Tailscale Serve. The other 8 stacks were not started. Their change is the same environment override, which the rendered models confirm.rumdl check --config .markdownlint.yml .(0.3.0) andgit diff --check origin/mainpass.Impact on existing users
TS_AUTHKEY. The other containers lose a variable that they never read.Checklist
Additional Context
TS_AUTHKEY. It belongs incompose-validation.yml, which CI: check that containers on the sidecar network restart with it #428 and CI: check the service list both ways, the service files, and the README headings #429 also change, so it can follow once they are merged.env_filealso shares the other secrets of a stack with every container. For example, NetBox's PostgreSQL and Valkey containers receive NetBox'sSECRET_KEY, and each of them also receives the passwords of the others. Trimming that needs a per-stack variable list.