Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 2.28 KB

architecture.md

File metadata and controls

24 lines (18 loc) · 2.28 KB

Architecture

Headscale-UI is based on the svelte-kit framework and designed to compile to static HTML/JS/CSS. As such, once built (with npm run build or by downloading the packages), Headscale-UI can be hosted on any static file server (including headscale's static file server, once support has been added)

App Design

Headscale-UI uses the static adapter built into svelte-kit, meaning that several svelte-kit functions are not feasible in a static deploymnet. Backend services (such as any route ending in .js or .ts) cannot be used, and most if not all script functions should be defined within the onMount function of svelte.

Client Side Design

All Headscale-UI features and functions should be client side only. Any backend features should be considered to be implemented in a separate backend. This can be the Headscale application itself (preferred), or potentially implementing a Backend-as-a-Service API such as Supabase.

Authentication and Authorization

In the current alpha format, the headscale API secret is stored within the browser's localStorage area. This method of credential storage is not ideal as localStorage can potentially be exploited by XSS (cross-site scripting) vulnerabilities. The long term goal is to integrate Headscale-UI into Headscale's OIDC authentication capabilities, but discovery is required to implement this feature (as well as cooperation from the upstream project).

For now, it is recommended that credentials only be saved on trusted computers and to use short API key expiries where possible.

Dependencies

Dependencies are kept to a minimum and kept to large, actively maintained repositories. Great care should be taken before suggesting or adding any additional dependencies: headscale is a sensitive tool and attack surfaces must be kept minimal.

Dev Dependencies