feat: configurable control ui base path

This commit is contained in:
Peter Steinberger
2026-01-03 17:54:52 +01:00
parent 822def84d2
commit 1d6de24ab3
18 changed files with 310 additions and 857 deletions

View File

@@ -645,13 +645,18 @@ Defaults:
mode: "local", // or "remote"
port: 18789, // WS + HTTP multiplex
bind: "loopback",
// controlUi: { enabled: true }
// controlUi: { enabled: true, basePath: "/clawdis" }
// auth: { mode: "token", token: "your-token" } // token is for multi-machine CLI access
// tailscale: { mode: "off" | "serve" | "funnel" }
}
}
```
Control UI base path:
- `gateway.controlUi.basePath` sets the URL prefix where the Control UI is served.
- Examples: `"/ui"`, `"/clawdis"`, `"/apps/clawdis"`.
- Default: root (`/`) (unchanged).
Notes:
- `clawdis gateway` refuses to start unless `gateway.mode` is set to `local` (or you pass the override flag).
- `gateway.port` controls the single multiplexed port used for WebSocket + HTTP (control UI, hooks, A2UI).

View File

@@ -6,9 +6,10 @@ read_when:
---
# Control UI (browser)
The Control UI is a small **Vite + Lit** single-page app served by the Gateway under:
The Control UI is a small **Vite + Lit** single-page app served by the Gateway:
- `http://<host>:18789/`
- default: `http://<host>:18789/`
- optional prefix: set `gateway.controlUi.basePath` (e.g. `/clawdis`)
It speaks **directly to the Gateway WebSocket** on the same port.
@@ -40,7 +41,7 @@ clawdis gateway --tailscale serve
```
Open:
- `https://<magicdns>/ui/`
- `https://<magicdns>/` (or your configured `gateway.controlUi.basePath`)
By default, the gateway trusts Tailscale identity headers in serve mode. You can still set
`CLAWDIS_GATEWAY_TOKEN` or `gateway.auth` if you want a shared secret instead.
@@ -52,7 +53,7 @@ clawdis gateway --bind tailnet --token "$(openssl rand -hex 32)"
```
Then open:
- `http://<tailscale-ip>:18789/ui/`
- `http://<tailscale-ip>:18789/` (or your configured `gateway.controlUi.basePath`)
Paste the token into the UI settings (sent as `connect.params.auth.token`).
@@ -65,6 +66,12 @@ pnpm ui:install
pnpm ui:build
```
Optional absolute base (when you want fixed asset URLs):
```bash
CLAWDIS_CONTROL_UI_BASE_PATH=/clawdis/ pnpm ui:build
```
For local development (separate dev server):
```bash

View File

@@ -5,7 +5,8 @@ read_when:
---
# Dashboard (Control UI)
The Gateway dashboard is the browser Control UI served at `/ui/`.
The Gateway dashboard is the browser Control UI served at `/` by default
(override with `gateway.controlUi.basePath`).
Key references:
- `docs/control-ui.md` for usage and UI capabilities.

View File

@@ -40,7 +40,7 @@ default unless you force `gateway.auth.mode` to `password` or set
}
```
Open: `https://<magicdns>/ui/`
Open: `https://<magicdns>/` (or your configured `gateway.controlUi.basePath`)
### Public internet (Funnel + shared password)

View File

@@ -8,7 +8,8 @@ read_when:
The Gateway serves a small **browser Control UI** (Vite + Lit) from the same port as the Gateway WebSocket:
- `http://<host>:18789/ui/`
- default: `http://<host>:18789/`
- optional prefix: set `gateway.controlUi.basePath` (e.g. `/clawdis`)
The UI talks directly to the Gateway WS and supports:
- Chat (`chat.history`, `chat.send`, `chat.abort`)
@@ -34,7 +35,7 @@ You can control it via config:
```json5
{
gateway: {
controlUi: { enabled: true } // set false to disable /ui/
controlUi: { enabled: true, basePath: "/clawdis" } // basePath optional
}
}
```
@@ -61,7 +62,7 @@ clawdis gateway
```
Open:
- `https://<magicdns>/ui/`
- `https://<magicdns>/` (or your configured `gateway.controlUi.basePath`)
### Tailnet bind + token (legacy)
@@ -82,7 +83,7 @@ clawdis gateway
```
Open:
- `http://<tailscale-ip>:18789/ui/`
- `http://<tailscale-ip>:18789/` (or your configured `gateway.controlUi.basePath`)
### Public internet (Funnel)