No description
Find a file
thelion f5c73bd249
All checks were successful
CI / test (push) Successful in 16m39s
CI / release (push) Successful in 1m49s
feat(i18n): Türkçe (#17)
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
2026-11-11 13:21:49 +00:00
.forgejo feat(containers): deploy settings (.env, how it runs), deploys on Containers, searchable custom dropdowns (#8) 2026-11-06 14:57:12 +00:00
cmd/shells-dashboard feat(apps): Pushes tab, webhook kept in step with the portal, redeliver (#10) 2026-11-06 17:40:48 +00:00
deploy feat(containers): deploy from GitHub — connect a repo, redeploy on every push (#7) 2026-11-06 13:19:09 +00:00
email/2026-11 email: word the November email for every IRCForever account (#15) 2026-11-08 03:23:04 +00:00
internal feat(metrics): each app’s usage — a Metrics tab, memory by app, and apps that keep restarting (#12) 2026-11-07 03:37:00 +00:00
web feat(i18n): Türkçe (#17) 2026-11-11 13:21:49 +00:00
.gitignore feat(portal): redesigned dashboard — metrics, restart, web console, current key 2026-10-17 12:33:20 -04:00
build.sh shells-dashboard: self-service portal for 4evr.sh shells (Go + embedded SvelteKit SPA) 2026-06-20 16:12:28 -04:00
go.mod feat(portal): redesigned dashboard — metrics, restart, web console, current key 2026-10-17 12:33:20 -04:00
go.sum feat(portal): redesigned dashboard — metrics, restart, web console, current key 2026-10-17 12:33:20 -04:00
README.md feat(portal): redesigned dashboard — metrics, restart, web console, current key 2026-10-17 12:33:20 -04:00

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 via bun, //go:embed). No Node at runtime.
  • Reuses the ircforever/website Tailwind 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 — OIDC
  • GET /api/me, GET /api/shell — identity + the caller's shell
  • POST /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 from PROM_URL, queried only for the session user's container
  • GET /api/shell/console — WebSocket terminal (same-origin only); the portal gets a single-use ticket from shellsd and relays frames
  • GET|POST|DELETE /api/shell/dns, /api/shell/webhost — DNS records, extra hostnames
  • everything else → the embedded SPA