A web frontend for the headscale Tailscale-compatible coordination server
Find a file
2022-08-02 20:02:47 +10:00
.github/workflows Chore check before creating release (#8) 2022-07-29 16:53:59 +10:00
docker Update 2-initialise.sh 2022-08-02 20:01:50 +10:00
documentation Update architecture.md 2022-08-02 18:43:37 +10:00
src enforce refresh for preauth keys 2022-08-02 17:07:49 +10:00
static update favicon 2022-07-25 10:43:29 +10:00
.gitignore start CICD pipeline 2022-07-27 16:12:53 +10:00
.npmrc initial commit 2022-06-28 08:04:11 +10:00
.prettierignore initial commit 2022-06-28 08:04:11 +10:00
.prettierrc initial commit 2022-06-28 08:04:11 +10:00
Caddyfile site served from /web/ prefix 2022-07-19 14:40:52 +10:00
jsconfig.json initial commit 2022-06-28 08:04:11 +10:00
package-lock.json added fuse.js 2022-08-01 09:53:38 +10:00
package.json Update package.json 2022-08-02 20:02:47 +10:00
postcss.config.cjs initial commit 2022-06-28 08:04:11 +10:00
README.md Update README.md 2022-08-02 17:32:38 +10:00
svelte.config.js added hash based CSP 2022-07-27 10:49:08 +10:00
tailwind.config.cjs added theme switcher 2022-07-10 17:46:52 +10:00
vite.config.js site served from /web/ prefix 2022-07-19 14:40:52 +10:00

Headscale-UI

A web frontend for the headscale Tailscale-compatible coordination server.

Installation

Headscale-UI is currently released as a static site: just take the release and host with your favorite web server. Headscale-UI expects to be served from the /web path to avoid overlap with headscale on the same domain. Note that due to CORS (see https://github.com/juanfont/headscale/issues/623), headscale UI must be served on the same subdomain, or CORS headers injected via reverse proxy.

Docker Installation

If you are using docker, you can install headscale alongside headscale-ui, like so:

version: '3.5'
services:
  headscale:
    image: headscale/headscale:latest-alpine
    container_name: headscale
    volumes:
      - ./container-config:/etc/headscale
      - ./container-data/data:/var/lib/headscale
    # ports:
      # - 27896:8080
    command: headscale serve
    restart: unless-stopped
  headscale-ui:
    image: ghcr.io/gurucomputing/headscale-ui:latest
    restart: unless-stopped
    container_name: headscale-ui
    # ports:
      # - 9443:443

Headscale UI serves on port 443 and uses a self signed cert by default.

Additional Docker Settings

The docker container lets you set the following settings:

Variable Description Example
PORT Sets the port to an alternate value 443

Proxy Settings

You will need a reverse proxy to install headscale-ui on your domain. Here is an example Caddy Config to achieve this:

https://hs.yourdomain.com.au {
	reverse_proxy /web* https://headscale-ui {
		transport http {
			tls_insecure_skip_verify
		}
	}

	reverse_proxy * http://headscale:8080
}

Cross Domain Installation

If you do not want to configure headscale-ui on the same subdomain as headscale, you must intercept headscale traffic via your reverse proxy to fix CORS (see https://github.com/juanfont/headscale/issues/623). Here is an example fix with Caddy, replacing your headscale UI domain with hs-ui.yourdomain.com.au:

hs.yourdomain.com.au {
  @hs-options {
    host hs.yourdomain.com.au
    method OPTIONS
  }
  @hs-other {
    host hs.yourdomain.com.au
  }
  handle @hs-options {
    header {
      Access-Control-Allow-Origin https://hs-ui.yourdomain.au
      Access-Control-Allow-Headers *
      Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE"
    }
    respond 204
  }
  handle @hs-other {
    reverse_proxy http://headscale:8080 {
      header_down Access-Control-Allow-Origin https://hs-ui.yourdomain.com.au
      header_down Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE"
      header_down Access-Control-Allow-Headers *
    }
  }
}

Development

see development for details

Style Guide

see style for details

Architecture

See architecture for details