LibrePortal/scripts/headscale/local/headscale_setup_localhost.sh
librelad 875a60f90f LibrePortal v0.1.0 — initial release
A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys,
Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun
VPN routing, and a web dashboard to manage it all.

Free & open forever to self-host; optional paid hosted services fund it.
See PROMISE.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-21 20:37:54 +01:00

40 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
setupHeadscaleLocalhost()
{
local local_type="$1"
if [[ "$local_type" == "local" ]]; then
local status=$(dockerCheckAppInstalled "headscale" "docker")
if [ "$status" == "installed" ]; then
setupHeadscaleGetHostname;
result=$(cd ~ && curl -fsSL https://tailscale.com/install.sh | sh)
checkSuccess "Setting up Headscale for localhost"
setupHeadscaleGenerateAuthKey;
result=$(sudo tailscale up --login-server $headscale_live_hostname --authkey $headscale_preauthkey --force-reauth)
checkSuccess "Connecting $app_name to Headscale Server"
result=$(rm -rf $headscale_preauthkey_file)
checkSuccess "Clearing the temp key file."
# Showing Nodelist after install
headscaleclientlocal=n
headscalenodeslist=y
headscaleCommands;
headscalenodeslist=n
else
isSuccessful "Headscale is not installed, Unable to install."
fi
elif [[ "$local_type" == "remote" ]]; then
if setupHeadscaleCheckRemote; then
result=$(cd ~ && curl -fsSL https://tailscale.com/install.sh | sh)
checkSuccess "Setting up Headscale"
result=$(sudo tailscale up --login-server https://$CFG_HEADSCALE_HOST --authkey $CFG_HEADSCALE_KEY --force-reauth)
checkSuccess "Connecting $app_name to $CFG_HEADSCALE_HOST Headscale Server"
fi
fi
}