headscale: serve admin UI same-origin to avoid CORS, drop Caddyfile hack

headscale-admin is a SvelteKit build with its asset base path hardcoded
to /admin, so the earlier Caddyfile root override (to serve it at /)
broke asset loading. Revert it and instead document serving the UI via
an NPM Custom Location (/admin) on the same headscale.example.com
proxy host, which also avoids CORS entirely since the browser sees one
origin for both the UI and the API it calls.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
code
2026-09-18 16:15:58 +00:00
co-authored by Claude Sonnet 5
parent 151e6b5aad
commit ab2b8c73fd
3 changed files with 9 additions and 15 deletions
-2
View File
@@ -18,8 +18,6 @@ services:
headscale-ui:
image: ${HEADSCALE_UI_IMAGE:-goodieshq/headscale-admin:latest}
restart: ${HEADSCALE_UI_RESTART:-unless-stopped}
volumes:
- ${VOL_PATH:-/data}/headscale/config/Caddyfile:/etc/caddy/Caddyfile:ro
environment:
- TZ=${TZ:-America/Vancouver}
- HEADSCALE_URL=http://headscale:8080