Files
hermes-skillsharing/skills/network/headscale-vpn/SKILL.md
T

3.8 KiB

name, description, version, author, license
name description version author license
headscale-vpn Deploy headscale TUN server on arm64 macOS. 1.0.0 robertrapp MIT

headscale-vpn

Use when deploying headscale TUN server on arm64 macOS for VPN node management and registration.

When to Use

User needs to set up headscale TUN server on arm64 macOS for VPN node registration and traffic routing.

Trigger

User needs to set up headscale TUN server on arm64 macOS for VPN node registration and traffic routing.

Workflow

1. Binary Acquisition

  • Download headscale binary from GitHub releases: curl -sL "https://github.com/juanfont/headscale/releases/download/v0.29.7/headscale_0.29.7_darwin_arm64" -o /tmp/headscale && chmod +x /tmp/headscale
  • Verify binary: /tmp/headscale --version
  • pip/brew installation is unavailable — use manual binary download only

2. Configuration

Create config with ALL required fields:

listen_addr: 0.0.0.0:8080
server_url: http://127.0.0.1:8080
backend:
  type: sqlite
  sqlite:
    path: /tmp/headscale.db
noise:
  private_key_path: /tmp/noise_key.pem
dns:
  nameservers:
    global:
      - 8.8.8.8
  override_local_dns: false
auth:
  method: file
  file:
    prefix: 100.64.0.0/10

Critical: The noise.private_key_path and auth.file.prefix fields are REQUIRED. Missing these will cause config load failures.

3. Server Startup

  • Start server with config: /tmp/headscale serve -c /tmp/headscale_config.yaml
  • Use foreground mode for initial setup to see errors
  • Use HEADSCALE_CONFIG env var to point to config file
  • Server socket path: CLI always expects /var/run/headscale/headscale.sock — config socket_path must match or connection will fail

4. User/Node Management

  • List users: /tmp/headscale -c <config.yaml> users list --output json
  • Register new node: headscale nodes register --user <user> --key <pre-auth-key> --output json
  • After registration, verify with: headscale nodes list --output json
  • If socket connection times out, check that server process is running and socket file exists

Pitfalls & Gotchas

  • No pip/brew: pip install headscale fails — use manual binary download from GitHub releases
  • Config format: noise.private_key_path and auth.file.prefix are REQUIRED fields
  • Socket path: CLI always expects /var/run/headscale/headscale.sock — config socket_path must match or connection will fail
  • User determination: If unknown which user new PC should belong to, list users first: /tmp/headscale users list --output json — do NOT guess the user
  • Credential rule: All API keys, tokens, passwords, secrets, connection strings must be replaced with [REDACTED] — never retain actual values

Support Files

  • references/headscale-config.md — complete config template
  • scripts/headscale-probe.sh — verification script for server status and socket existence

Example

# Download binary
curl -sL "https://github.com/juanfont/headscale/releases/download/v0.29.7/headscale_0.29.7_darwin_arm64" -o /tmp/headscale && chmod +x /tmp/headscale

# Create config
cat > /tmp/headscale_config.yaml << 'EOF'
listen_addr: 0.0.0.0:8080
server_url: http://127.0.0.1:8080
backend:
  type: sqlite
  sqlite:
    path: /tmp/headscale.db
noise:
  private_key_path: /tmp/noise_key.pem
dns:
  nameservers:
    global:
      - 8.8.8.8
  override_local_dns: false
auth:
  method: file
  file:
    prefix: 100.64.0.0/10
EOF

# Generate noise key
/tmp/headscale generate private-key -o /tmp/noise_key.pem

# Start server
/tmp/headscale serve -c /tmp/headscale_config.yaml &

# List users
/tmp/headscale -c /tmp/headscale_config.yaml users list --output json

Skill captures workflow for headscale TUN server on arm64 macOS, including binary download, config requirements, socket path pitfalls, and user preference for [REDACTED] credentials.