Skip to content

Admin web-ui for @juanfont/headscale with a focus on easy ACL management thru 3D network visualization

License

Notifications You must be signed in to change notification settings

rickli-cloud/headnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Headnet

Unstable release

Admin web-ui for @juanfont/headscale with a focus on easy ACL management thru 3D network visualization

Features

  • Interactive 3D Network Visualization: Visualize your network topology in 3D for intuitive management.
  • Simplified ACL Management: Easily manage Access Control Lists, Groups and more with a user-friendly interface.

Deployment Options

Note

The provided server does not support TLS and is best used behind a reverse proxy.

Docker

Headnet is available as a distroless Docker container a basic golang webserver.

Tags

  • latest: Latest stable release
  • x.x.x: Specific release versions
  • x.x.x-pre: Pre-release versions (potentially unstable)
  • unstable: Built on every push to the main branch

Using Docker Run

docker run -d -p 3000:3000 ghcr.io/rickli-cloud/headnet:unstable

Using Docker Compose

Create a docker-compose.yaml file:

version: '3.9'
services:
  headnet:
    image: ghcr.io/rickli-cloud/headnet:${HEADNET_VERSION:-unstable}
    container_name: headnet
    restart: always
    ports:
      - 3000:3000
    environment:
      PUBLIC_MOCK_ENABLED: 'true' # Enable demo mode (requires a build with MSW included!)

Start the service:

docker compose up -d

Static server

You can download a zip archive for each release containing almost everything needed to deploy headnet on a static webserver like Nginx or Apache.

Desktop Application

Standalone executables and installers for different platforms are provided for each release.

These applications include special client integrations to bypass any CORS restrictions. This allows it to work with any Headscale instance without additional configuration.

Configuration

Passing environment variables

Environment variables can be configured in different ways depending on the deployment method.

Some variables might only be affective during development or at buildtime!

Docker / Go server

Reads environment variables starting with PUBLIC_ and serves them automatically on /admin/_app/env.js.

Static files

Configure environment at buildtime or modify the /_app/env.js file. Example to Enable Mocking:

export const env = { PUBLIC_MOCK_ENABLED: 'true' };

Desktop application (tauri)

Unfortunately you can not configure anything after buildtime.

Mocking

Mock the whole API with the help of a service worker. This enables "demo mode"

# Linux
export PUBLIC_MOCK_ENABLED="false"

# Windows
$env:PUBLIC_MOCK_ENABLED="false"

Important

This only works if the build includes the required service worker. To keep the size down it is not included in the production releases.
Create the service worker with: deno task msw:init

Base Path

Only affective during development & buildtime

# Linux
export BASE_PATH="/admin"

# Windows
$env:BASE_PATH="/admin"

Development Proxy

Only affective during development

To circumvent CORS issues vite provides a dev proxy leading to your headscale instance.

# Linux
export HEADSCALE_HOST="https://headscale.example.com"

# Windows
$env:HEADSCALE_HOST="https://headscale.example.com"

Development

Install Dependencies:

deno install

Starting Development Server:

deno task dev

Building

Tip

This can be done in Docker:

docker run -it --rm --workdir /app -v ${PWD}:/app:rw --entrypoint /bin/sh denoland/deno:latest

Install Dependencies:

deno install

Static

deno task build

Tauri

Ensure the following configuration:

  • BASE_PATH = "/"

Then run:

deno task tauri build

Docker image

The docker image does not build the svelte app, only bundles the static files into a small server.

docker build . -t headnet:custom

Technology Stack

Headnet is built using the following technologies:

Note

Deno provides additional functionality, such as automatic types for third-party modules. Node.js does not support this and will not work

About

Admin web-ui for @juanfont/headscale with a focus on easy ACL management thru 3D network visualization

Topics

Resources

License

Stars

Watchers

Forks

Packages