A web frontend for the headscale Tailscale-compatible coordination server
Find a file
routerino bcf9ef1e31
fix renaming users with numbers
* fix renaming users with numbers
2024-10-05 08:52:35 +10:00
.github Update issue templates 2024-02-24 18:56:17 +11:00
docker 145-crashes-upon-boot-and-for-some-reason-tries-loading-caddy-stuff-im-not-using-caddy 2024-10-01 22:02:33 +10:00
documentation Add a new device registration route (#121) 2023-11-18 09:34:36 +11:00
src fix renaming users with numbers 2024-10-05 08:52:35 +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 added additional documentation 2022-08-08 12:47:06 +10:00
jsconfig.json initial commit 2022-06-28 08:04:11 +10:00
LICENSE.md Create LICENSE.md 2022-08-02 20:53:57 +10:00
package-lock.json updated dependencies. Changed dev to http (as it needs proxying anyway) 2024-10-01 21:22:39 +10:00
package.json updated dependencies. Changed dev to http (as it needs proxying anyway) 2024-10-01 21:22:39 +10:00
postcss.config.cjs initial commit 2022-06-28 08:04:11 +10:00
README.md Update README.md 2024-10-01 22:22:18 +10:00
SECURITY.md added SECURITY.md 2022-10-13 09:57:04 +11:00
svelte.config.js updated dependencies 2022-09-13 18:02:17 +10:00
tailwind.config.cjs added theme switcher 2022-07-10 17:46:52 +10:00
vite.config.js updated dependencies. Changed dev to http (as it needs proxying anyway) 2024-10-01 21:22:39 +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:stable
    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:
      # - 8443:8443
      # - 8080:8080

Headscale UI serves on port 8080/8443 and uses a self signed cert by default. You will need to add a config.yaml file under your container-config folder so that headscale has all of the required settings declared. An example from the official headscale repo is here.

Additional Docker Settings

The docker container lets you set the following settings:

Variable Description Example
HTTP_PORT Sets the HTTP port to an alternate value 8080
HTTPS_PORT Sets the HTTPS port to an alternate value 8443

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* http://headscale-ui:8080
	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:

https://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 *
		}
	}
}

Other Configurations

See Other Configurations for further proxy examples, such as Traefik

Versioning

The following versions correspond to the appropriate headscale version

Headscale Version HS-UI Version
23+ 2024-10-01+
19+ 2023-01-30+
<19 <2023-01-30

Troubleshooting

Make sure you are using the latest version of headscale. Headscale-UI is only tested against:

  • The current stable version of headscale
  • Chrome/Chrome Mobile
  • Firefox/Firefox Mobile

Note that while mobile is checked for functionality, the web experience is not mobile optimised.

If you are getting errors about preflight checks, it's probably CORS related. Make sure your UI sits on the same subdomain as headscale or inject CORS headers.

Your API key is either not saved or you haven't configured your reverse proxy. Create an API key in headscale (via command line) with headscale apikeys create or docker exec <headscale container> headscale apikeys create and save it in settings.

HS-UI has to be ran on the same subdomain as headscale or you need to configure CORS. Yes you need to use a reverse proxy to do this. Use a reverse proxy. If you are trying to use raw IPs and ports, it will not work.

Security

see security for details

Development

see development for details

Style Guide

see style for details

Architecture

See architecture for details