From 9e4c2bb4e5b8993eb64ded8216a8ccf3bea6c7ba Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Fri, 29 Dec 2023 21:36:35 -0600 Subject: [PATCH] update variable names to match official image --- README.md | 4 ++-- docker-compose-example/.env_template | 2 +- docker-compose-example/docker-compose.yml | 2 +- image/start.sh | 2 +- k8s-example/deployment.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 45b6837..c35cee3 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ Expected environment variables: | --- | --- | --- | | `TS_AUTHKEY` | `tskey-auth-somestring-somelongerstring` | used for unattened auth of the new node, get one [here](https://login.tailscale.com/admin/settings/keys) | | `TS_HOSTNAME` | `my-app` | optional Tailscale hostname for the new node | -| `TS_STATEDIR` | `/var/lib/tailscale/` | required directory for storing Tailscale state, this should be mounted to the container for persistence | -| `TS_OPT` | `--verbose=1` | optional additional [flags](https://tailscale.com/kb/1278/tailscaled#flags-to-tailscaled) for `tailscaled` | +| `TS_STATE_DIR` | `/var/lib/tailscale/` | required directory for storing Tailscale state, this should be mounted to the container for persistence | +| `TS_TAILSCALED_EXTRA_ARGS` | `--verbose=1` | optional additional [flags](https://tailscale.com/kb/1278/tailscaled#flags-to-tailscaled) for `tailscaled` | | `TS_SERVE_PORT` | `8080` | optional application port to expose with [Tailscale Serve](https://tailscale.com/kb/1312/serve) | | `TS_FUNNEL` | `1` | if set (to anything), will proxy `TS_SERVE_PORT` **publicly** with [Tailscale Funnel](https://tailscale.com/kb/1223/funnel) | diff --git a/docker-compose-example/.env_template b/docker-compose-example/.env_template index e5295bd..ad85747 100644 --- a/docker-compose-example/.env_template +++ b/docker-compose-example/.env_template @@ -1,6 +1,6 @@ # Rename to .env TS_AUTHKEY="" # Required Tailscale auth key TS_HOSTNAME="" # Optional hostname for this node -TS_OPT="" # Optional additional arguments for tailscaled +TS_TAILSCALED_EXTRA_ARGS="" # Optional additional arguments for tailscaled TS_SERVE_PORT="" # Optional backend port to proxy with tailscale serve TS_FUNNEL="" # If set, serve publicly with tailscale funnel \ No newline at end of file diff --git a/docker-compose-example/docker-compose.yml b/docker-compose-example/docker-compose.yml index 446e477..15dc660 100644 --- a/docker-compose-example/docker-compose.yml +++ b/docker-compose-example/docker-compose.yml @@ -6,7 +6,7 @@ services: environment: TS_AUTHKEY: ${TS_AUTHKEY:?err} # from https://login.tailscale.com/admin/settings/authkeys TS_HOSTNAME: ${TS_HOSTNAME:-ts-docker} - TS_STATEDIR: "/var/lib/tailscale/" # store ts state in a local volume + TS_STATE_DIR: "/var/lib/tailscale/" # store ts state in a local volume TS_SERVE_PORT: ${TS_SERVE_PORT:-} # optional port to proxy with tailscale serve (ex: '80') TS_FUNNEL: ${TS_FUNNEL:-} # if set, serve publicly with tailscale funnel volumes: diff --git a/image/start.sh b/image/start.sh index 620fca9..484384b 100644 --- a/image/start.sh +++ b/image/start.sh @@ -1,7 +1,7 @@ #!/bin/ash trap 'kill -TERM $PID' TERM INT echo "Starting Tailscale daemon" -tailscaled --tun=userspace-networking --statedir="${TS_STATEDIR}" ${TS_OPT} & +tailscaled --tun=userspace-networking --statedir="${TS_STATE_DIR}" ${TS_TAILSCALED_EXTRA_ARGS} & PID=$! until tailscale up --authkey="${TS_AUTHKEY}" --hostname="${TS_HOSTNAME}"; do sleep 0.1 diff --git a/k8s-example/deployment.yaml b/k8s-example/deployment.yaml index 67ebfa8..3fb819e 100644 --- a/k8s-example/deployment.yaml +++ b/k8s-example/deployment.yaml @@ -19,7 +19,7 @@ spec: value: "${TS_AUTHKEY:-err}" - name: TS_HOSTNAME value: "${TS_HOSTNAME:-ts-docker}" - - name: TS_STATEDIR + - name: TS_STATE_DIR value: "/var/lib/tailscale" - name: TS_SERVE_PORT value: "${TS_SERVE_PORT:-}"