From 08c077d0817ff1669dec4a3afa560ddbac7260dd Mon Sep 17 00:00:00 2001 From: Frank Edwards Date: Sat, 6 Jan 2024 10:39:50 +1000 Subject: [PATCH] 0.1.26 Add UPDATE_TAILSCALE option. --- README.md | 2 ++ build.sh | 3 ++- tailscale.sh | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e6fe782..92d072b 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ This section follows the Mikrotik Container documentation with additional steps | ADVERTISE_ROUTES | Comma-separated list of routes to advertise | | | CONTAINER_GATEWAY | The container bridge (veth1) IP address on the router | | | LOGIN_SERVER | Headscale login server | Only required for Headscale control server. Do not set if using Tailscale | +| UPDATE_TAILSCALE | Update tailscale on container startup | | | TAILSCALE_ARGS | Additional arguments passed to tailscale | Optional | | TAILSCALED_ARGS | Additional arguments passed to tailscaled | Optional | @@ -83,6 +84,7 @@ add name="tailscale" key="PASSWORD" value="xxxxxxxxxxxxxx" add name="tailscale" key="AUTH_KEY" value="tskey-xxxxxxxxxxxxxxxxxxxxxxxx" add name="tailscale" key="ADVERTISE_ROUTES" value="192.168.88.0/24" add name="tailscale" key="CONTAINER_GATEWAY" value="172.17.0.1" +add name="tailscale" key="UPDATE_TAILSCALE" add name="tailscale" key="TAILSCALE_ARGS" value="--accept-routes --advertise-exit-node" ``` Example Headscale control server configuration: diff --git a/build.sh b/build.sh index 070367f..8eee4b6 100755 --- a/build.sh +++ b/build.sh @@ -26,7 +26,7 @@ # PLATFORM="linux/arm/v7" TAILSCALE_VERSION=1.52.1 -VERSION=0.1.25 +VERSION=0.1.26 set -eu @@ -41,6 +41,7 @@ cd tailscale && eval $(./build_dist.sh shellvars) && cd .. docker buildx build \ --no-cache \ + --build-arg TAILSCALE_VERSION=$TAILSCALE_VERSION \ --build-arg VERSION_LONG=$VERSION_LONG \ --build-arg VERSION_SHORT=$VERSION_SHORT \ --build-arg VERSION_GIT_HASH=$VERSION_GIT_HASH \ diff --git a/tailscale.sh b/tailscale.sh index ba324f4..389c8f9 100755 --- a/tailscale.sh +++ b/tailscale.sh @@ -21,6 +21,11 @@ for s in "${SUBNETS[@]}"; do ip route add "$s" via "${CONTAINER_GATEWAY}" done +# Perform an update if set +if [[ ! -z "${UPDATE_TAILSCALE+x}" ]]; then + /usr/local/bin/tailscale update --yes +fi + # Set login server for tailscale if [[ -z "$LOGIN_SERVER" ]]; then LOGIN_SERVER=https://controlplane.tailscale.com