From 9626fd835ce403fb20262967e16699599f65de5d Mon Sep 17 00:00:00 2001 From: Ian Neubert Date: Tue, 4 Apr 2023 10:28:36 -0400 Subject: [PATCH] Set optional tailscaled flags with TAILSCALE_OPT (#6) * Allow user to set additional Tailscaled options * Added example use of TAILSCALE_OPT --- docker-compose/simple-example/docker-compose.yml | 2 ++ images/tailscale/start.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose/simple-example/docker-compose.yml b/docker-compose/simple-example/docker-compose.yml index 8693cae..333299c 100644 --- a/docker-compose/simple-example/docker-compose.yml +++ b/docker-compose/simple-example/docker-compose.yml @@ -7,6 +7,8 @@ services: TAILSCALE_AUTH_KEY: ${TAILSCALE_AUTH_KEY:?err} TAILSCALE_HOSTNAME: ${TAILSCALE_HOSTNAME:-tailscale-docker-simple-example} TAILSCALE_STATE_ARG: "mem:" + # (optional) set additional flags on tailscaled + # TAILSCALE_OPT: --outbound-http-proxy-listen=localhost:1055 some-service-1: image: nginxdemos/hello network_mode: "service:tailscale" diff --git a/images/tailscale/start.sh b/images/tailscale/start.sh index 73aaaed..92e4e06 100644 --- a/images/tailscale/start.sh +++ b/images/tailscale/start.sh @@ -2,11 +2,11 @@ trap 'kill -TERM $PID' TERM INT echo "Starting Tailscale daemon" # -state=mem: will logout and remove ephemeral node from network immediately after ending. -tailscaled --tun=userspace-networking --state=${TAILSCALE_STATE_ARG} & +tailscaled --tun=userspace-networking --state=${TAILSCALE_STATE_ARG} ${TAILSCALE_OPT} & PID=$! until tailscale up --authkey="${TAILSCALE_AUTH_KEY}" --hostname="${TAILSCALE_HOSTNAME}"; do sleep 0.1 done tailscale status wait ${PID} -wait ${PID} \ No newline at end of file +wait ${PID}