#!/bin/bash set -euo pipefail # ============================================================ # Generate a Jefflix VPN invite for a new user # Usage: ./onboard-user.sh [username] # ============================================================ USERNAME="${1:-}" if [ -z "$USERNAME" ]; then echo "Usage: ./onboard-user.sh " echo " Creates a pre-auth key for the user and prints setup instructions." exit 1 fi # Generate a single-use pre-auth key (7 day expiry) echo "Generating pre-auth key for user: $USERNAME" PREAUTH_KEY=$(docker exec headscale headscale preauthkeys create \ --user jefflix \ --reusable=false \ --expiration 168h 2>&1 | tail -1) echo "" echo "============================================================" echo " Send the following to $USERNAME:" echo "============================================================" echo "" cat <