Skip to content

Headscale

Headscale Web UI

gurucomputing/headscale-ui

  • GitHub
  • Container images
  • Bundles in both headscale helm charts
    • Configures ingress for /web
  • Prometheus endpoint 127.0.0.1:9090/metrics
    • No real useful metrics

Configure

Connect UI to headscale server:

headscale apikeys create --expiration 3y

Server settings:

  • Headscale API Key: $(gopass show --password token/$HEADSCALE_DOMAIN/api-token)

Headscale UI Usage

New client:

Ionscale

Manual registration and login

If the Headscale user varac doesn't exist yet, create it (only once):

headscale user create varac
headscale user list

Request node registration from a device:

sudo tailscale up --login-server https://$HEADSCALE_DOMAIN

Then follow the link from the browser to register the node in headscale:

headscale nodes register --user varac --key nodekey:$NODEKEY

Using a pre-auth key (deprecated)

Generate a preauth-key:

headscale --user $NODEUSER preauthkeys create --reusable --expiration 360d

Login using a preauth-key:

sudo tailscale up --login-server https://$HEADSCALE_DOMAIN \
  --authkey $(gopass show --password token/$HEADSCALE_DOMAIN/preauth-key/varac)

Ansible role

Bootstrap new machine

Getting started: Using a preauthkey

Before configuring a device:

headscale user create varac

Register machine using a pre authenticated key

headscale --user varac preauthkeys create --reusable --expiration 3y

Use a tag:

headscale --user varac preauthkeys create --reusable --expiration 3y --tags tag:oas2

Then store token in gopass (token/hs.k.varac.net/varac/preauth-key/ANSIBLE_INVENTORY_HOSTNAME), add the device to the vpn inventory group and run ansible:

ansible-playbook -l zancas -t tailscale site.yml

Finally, accept the additional routes in the headscale UI.