From 843e0ada6556b322228bb90038e811111aba4d07 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Wed, 8 Jun 2022 14:48:50 +0700 Subject: [PATCH] Fix Tailscale (#11) --- tailscale/exports.sh | 21 ++++++++++++++++++++- tailscale/umbrel-app.yml | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tailscale/exports.sh b/tailscale/exports.sh index 9644dd8..56dd1ec 100644 --- a/tailscale/exports.sh +++ b/tailscale/exports.sh @@ -1,2 +1,21 @@ export APP_TAILSCALE_IP="10.21.21.80" -export APP_TAILSCALE_PORT="8240" \ No newline at end of file +export APP_TAILSCALE_PORT="8240" + +# Detect we are running in a tailscale install +if ! cat "${UMBREL_ROOT}/db/user.json" | grep '"tailscale"' +then + + # Only patch unmodified v0.5.0 app script to prevent infinite loop or making weird changes to future app scripts + if sha256sum "${UMBREL_ROOT}/scripts/app" | grep 43d41ead6963780289e381a172ea346603e36ae650f9e5c878e93aa5c1f78e15 + then + echo "Detected Tailscale install, we need to patch the install script so this doesn't fail!" + + echo "Patching app script..." + sed -i 's/^ wait_for_tor_hs/ [[ "${app}" != "tailscale" ]] \&\& wait_for_tor_hs/g' "${UMBREL_ROOT}/scripts/app" + + echo "Attempting new install after patch" + "${UMBREL_ROOT}/scripts/app" install tailscale + + exit # this kills the original install script process + fi +fi diff --git a/tailscale/umbrel-app.yml b/tailscale/umbrel-app.yml index 5847afd..54fcf64 100644 --- a/tailscale/umbrel-app.yml +++ b/tailscale/umbrel-app.yml @@ -2,7 +2,7 @@ manifestVersion: 1 id: tailscale category: Networking name: Tailscale -version: "1.22.1" +version: "1.22.1-build-2" tagline: Zero config VPN to access your Umbrel from anywhere description: >- Tailscale is zero config VPN that creates a secure network between