Update entrypoint.tailscale.sh

remove TAILSCALE_AUTHKEY for now and replace it with TAILSCALE_PARAM
This commit is contained in:
RipleyBooya 2025-02-24 02:09:49 +01:00 committed by GitHub
parent 28e32d81db
commit b230c873b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,23 +8,19 @@ if [ -z "$SSH_HOST" ] || [ -z "$SSH_USER" ] || [ -z "$REMOTE_PORTS" ] || [ -z "$
exit 1
fi
# Vérifier que TAILSCALE_PARAM est défini
if [ -z "$TAILSCALE_PARAM" ]; then
echo "ERROR: TAILSCALE_PARAM is required but not set."
exit 1
fi
# Démarrage de Tailscale
echo "Starting Tailscale..."
tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock &
sleep 5
echo "Connecting to Tailscale..."
# Vérifier si TAILSCALE_PARAM est défini, sinon utiliser la clé d'authentification par défaut
if [ -n "$TAILSCALE_PARAM" ]; then
tailscale up $TAILSCALE_PARAM
else
if [ -z "$TAILSCALE_AUTH_KEY" ]; then
echo "ERROR: Either TAILSCALE_PARAM or TAILSCALE_AUTH_KEY must be set."
exit 1
fi
tailscale up --authkey=${TAILSCALE_AUTH_KEY} --ssh
fi
echo "Connecting to Tailscale with: tailscale up ${TAILSCALE_PARAM}"
tailscale up ${TAILSCALE_PARAM}
# Vérifier que Tailscale est bien actif
if ! tailscale status; then