environment variable auth key

This commit is contained in:
Louis-Philippe Asselin 2022-08-22 14:40:15 -04:00
parent 1009329b49
commit beb2ad6bb6
5 changed files with 15 additions and 8 deletions

View file

@ -15,5 +15,4 @@ A nginx layer is added. It manages two services in independent containers at loc
## TODO
- auth key as a secret
- force reuse hostname in tailscale instead of adding suffix. Example: first start is assigned `hostname`. Then, if container is recreated, Tailscale assigns `hostname-1`
- force reuse hostname in tailscale instead of adding suffix. Example: first container is assigned `hostname`. Then, if container is recreated, Tailscale assigns `hostname-1`. Possibly helpful [info](https://tailscale.com/kb/1111/ephemeral-nodes/#can-i-create-an-ephemeral-node-without-an-auth-key).

View file

@ -3,6 +3,8 @@ services:
tailscale:
build:
context: ./tailscale
environment:
- TAILSCALE_AUTH_KEY
nginx:
build:
context: ./nginx

View file

@ -1,7 +1,9 @@
#!/bin/ash
echo "Starting TS daemon"
tailscaled --tun=userspace-networking &
sleep 5
tailscale up --authkey=TAILSCALE_AUTH_KEY --hostname=complex-example
PID=$!
until tailscale up --authkey=${TAILSCALE_AUTH_KEY} --hostname=complex-example; do
sleep 0.1
done
tailscale status
sleep infinity
wait ${PID}

View file

@ -3,6 +3,8 @@ services:
tailscale:
build:
context: ./tailscale
environment:
- TAILSCALE_AUTH_KEY
some-service-1:
image: nginxdemos/hello
network_mode: "service:tailscale"

View file

@ -1,7 +1,9 @@
#!/bin/ash
echo "Starting TS daemon"
tailscaled --tun=userspace-networking &
sleep 5
tailscale up --authkey=TAILSCALE_AUTH_KEY --hostname=simple-docker-compose
PID=$!
until tailscale up --authkey=${TAILSCALE_AUTH_KEY} --hostname=complex-example; do
sleep 0.1
done
tailscale status
sleep infinity
wait ${PID}