No description
Turkish for the portal: web/src/lib/i18n/tr.js with every key of en.js, in the Language page, the sign-in language menu and browser detection. web/build rebuilt with bun (a second build changes nothing). Tests: 46 unit tests pass, plus a unit test that tr-TR picks tr and an e2e check of the Language page. Wording follows evrd's Turkish; a native speaker should read it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: James Trotter <james@honestbank.com> Reviewed-on: #17 |
||
|---|---|---|
| .forgejo | ||
| cmd/shells-dashboard | ||
| deploy | ||
| email/2026-11 | ||
| internal | ||
| web | ||
| .gitignore | ||
| build.sh | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
shells-dashboard
Self-service web portal for 4evr.sh shells. A shell owner logs in with their
IRCforever account (Logto / OIDC) and manages their own shell: change their
subdomain, rotate their SSH key, see status / connection details, and
rebuild / upgrade. Shell creation stays in IRC (!shell); this portal manages
an existing shell.
Runs on the shells host, calls shellsd over loopback, and is fronted by Traefik.
Design
- Single Go binary = JSON API + an embedded SvelteKit SPA (
web/, static build viabun,//go:embed). No Node at runtime. - Reuses the
ircforever/websiteTailwind v4 design system (web/src/app.css). - Auth: OIDC (Logto) — auth-code + PKCE, signed session cookie
(
internal/auth, adapted from managebot). - Shells: HMAC client to shellsd
/v1/list,/v1/set-subdomain,/v1/rekey,/v1/rebuild,/v1/upgrade(internal/shellsapi). Never deprovision. - Identity → shell: the logged-in user's Logto username == their shell username. Every operation is scoped to the session's username (never taken from the request body).
Build
./build.sh # bun build SPA -> go build (single binary)
# or cross-compile for the host:
( cd web && bun install && bun run build )
GOOS=linux GOARCH=amd64 go build -o shells-dashboard ./cmd/shells-dashboard
(web/build is committed so go build works without a frontend build; regenerate it
with bun run build when the SPA changes.)
Run / config (env)
| var | default | purpose |
|---|---|---|
PORTAL_LISTEN |
127.0.0.1:8095 |
listen address (behind Traefik) |
SHELLSD_URL |
http://127.0.0.1:8090 |
shellsd base URL (loopback) |
SHELLSD_HMAC_SECRET |
— (required) | shared with /etc/shellsd/env |
OIDC_ISSUER |
— | Logto issuer URL |
OIDC_CLIENT_ID / OIDC_CLIENT_SECRET |
— | Logto application creds |
OIDC_REDIRECT_URL |
https://portal.4evr.sh/auth/callback |
OIDC callback |
OIDC_POST_LOGOUT_URL |
https://portal.4evr.sh/ |
post-logout |
OIDC_SESSION_SECRET |
— | signs the session cookie |
PROM_URL |
— | Prometheus-compatible query API (VictoriaMetrics) for the Metrics page; unset = metrics disabled |
PROM_USER / PROM_PASSWORD |
— | basic auth for PROM_URL |
PORTAL_DEV_AUTH |
— | 1 = bypass OIDC with a stub user (local dev only; refused when OIDC_ISSUER is set) |
PORTAL_DEV_USER |
dev |
stub username in dev auth |
Local dev: cd web && bun run dev (proxies /api+/auth to :8095); run the Go
binary with PORTAL_DEV_AUTH=1 SHELLSD_HMAC_SECRET=x.
Tests
go test ./... # API, auth (every /api route must 401 without a session), metrics
( cd web && bun run test:e2e ) # Playwright: real binary + fake shellsd/Prometheus (web/e2e/fakes.mjs)
Routes
GET /auth/login/auth/callback/auth/logout— OIDCGET /api/me,GET /api/shell— identity + the caller's shellPOST /api/shell/subdomain/sshkey/rebuild/upgrade/restart— manage (session-scoped)GET /api/shell/sshkey— installed key's type/fingerprint/comment (never the key)GET /api/shell/metrics?range=15m|1h|24h— container usage fromPROM_URL, queried only for the session user's containerGET /api/shell/console— WebSocket terminal (same-origin only); the portal gets a single-use ticket from shellsd and relays framesGET|POST|DELETE /api/shell/dns,/api/shell/webhost— DNS records, extra hostnames- everything else → the embedded SPA