fix: use TS_AUTHKEY and TS_LOGIN_SERVER environment variables

- docker-compose.yml: read authkey and login server from env
- README.md: updated instructions to use env vars instead of editing the file
- Added .gitignore for secrets and Tailscale state
This commit is contained in:
peskyadmin
2026-08-02 10:25:51 -04:00
parent 117aac11fb
commit 35e840f329
3 changed files with 12 additions and 2 deletions

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
# Secrets and environment files
.env
.env.*
*.key
tskey-*
authkey*
# Tailscale data (never commit state)
tailscale/tailscale-data/

View File

@@ -33,7 +33,7 @@ ts-{{service}}/
mkdir -p tailscale/tailscale-data
```
3. Configure Tailscale
- Replace `{{YOUR_TAILSCALE_AUTHKEY}}` in the docker-compose.yml with your actual Tailscale auth key
- Make sure `TS_AUTHKEY` and `TS_LOGIN_SERVER` are set in your environment (or a local .env file) before running docker compose.
- Optionally, update the file in `tailscale/config/serve.json` if you need specific Tailscale serve configurations
- CAUTION: Changing `"${TS_CERT_DOMAIN}:443": false` to `true` will expose the service to the internet

View File

@@ -4,7 +4,8 @@ services:
hostname: {{service}}
container_name: {{service}}-ts
environment:
- TS_AUTHKEY={{YOUR_TAILSCALE_AUTHKEY}}
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_LOGIN_SERVER=${TS_LOGIN_SERVER}
- TS_STATE_DIR=/var/lib/tailscale
- TS_SERVE_CONFIG=/config/serve.json
volumes: