Skip to content

feat(deploy): add the self-hosting stack (Caddy + oauth2-proxy + mongo)#129

Merged
obcode merged 1 commit into
mainfrom
feat/deploy-stack
Jul 20, 2026
Merged

feat(deploy): add the self-hosting stack (Caddy + oauth2-proxy + mongo)#129
obcode merged 1 commit into
mainfrom
feat/deploy-stack

Conversation

@obcode

@obcode obcode commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Zweiter (und letzter Kern-)Milestone-F-PR: der deploy/-Stack für glabs.cs.hm.edu. Referenziert das glabs-web-Image aus #128 und das glabs.gui-Image.

Topologie

internet ──443/TLS──> caddy ─┬─ forward_auth → oauth2-proxy ──OIDC──> sso.hm.edu
                             ├─ /oauth2/*   → oauth2-proxy (login/callback)
                             ├─ setzt X-Remote-User (verifizierte E-Mail) auf JEDER Route
                             ├─ /query      → glabs-web:8080  (GraphQL + WS)
                             └─ /           → gui:3000        (SvelteKit; inkl. YAML-Download)
   glabs-web / gui / mongo / oauth2-proxy ── nur internes Compose-Netz (nie publiziert)

Inhalt

  • docker-compose.yml — mongo (healthcheck + Volume) + glabs-web + gui + oauth2-proxy + caddy; Backend/GUI als ghcr.io-Images (GLABS_WEB_TAG/GUI_TAG). Nur Caddy publiziert 80/443; Mongo nur 127.0.0.1:27017 (SSH-Tunnel). Kein gh-runner (wie besprochen).
  • Caddyfile — eigenes EAB fürs HM-ACME (frischer kid/hmac, nicht acme.sh-Account); X-Remote-User auch auf location / (SSR-Falle); /query*→Backend (WS-Upgrade automatisch), Rest→GUI. Kein Department/Groups-Header (glabs-Identität = E-Mail, nur Owner).
  • .env.example + .glabs-web.yaml.example (Platzhalter für Secrets/EAB/OIDC; reale Dateien via .gitignore) + README.md (Setup, ACME/EAB-Fallstrick, Zwei-URL-SSR-Falle, Betrieb, Mongo-SSH-Tunnel, Backups).

Verifikation (lokal)

  • docker compose --env-file .env.example config — grün, 5 Services; gerendert geprüft: GUI-URLs (intern/öffentlich), Backend-.glabs-web.yaml read-only bind-mount, nur caddy 80/443 + mongo-loopback publiziert.
  • caddy validateValid configuration (EAB-Block + auto-HTTPS adaptieren sauber).
  • Teil-Smoke mit den echten Release-Images (mongo + glabs-web + gui, ohne caddy/oauth2-proxy): Backend verbindet zu Mongo & lauscht; GUI→Backend übers Compose-NetzserverInfo.version=v3.37.0; GUI-SSR /courses → HTTP 200 (der SSR-load()-Hop erreicht das Backend intern, keine SSR-Falle). Images sind anonym pullbar (kein ghcr-Login am Host nötig).
  • Nicht lokal fahrbar (nur am Zielhost): der komplette oauth2-proxy/OIDC-Handshake gegen sso.hm.edu und die ACME/EAB-Zertifikatsausstellung gegen die HM-CA.

🤖 Generated with Claude Code

deploy/ brings up glabs.cs.hm.edu: Caddy terminates TLS (HM CA via EAB) and
authenticates every request against oauth2-proxy (OIDC to sso.hm.edu),
injecting X-Remote-User authoritatively — including on `/`, so the GUI's
cookieless SSR hop can relay it to the backend. glabs-web, gui, mongo and
oauth2-proxy stay on the internal network; only Caddy publishes 80/443
(mongo binds 127.0.0.1:27017 for an SSH tunnel).

- docker-compose.yml: mongo (healthcheck + volume) + glabs-web + gui +
  oauth2-proxy + caddy, backend/gui from ghcr.io. No gh-runner.
- Caddyfile: /query* -> glabs-web:8080 (GraphQL + WS), everything else ->
  gui:3000 (glabs-web serves nothing but /query; the YAML download is a GUI
  route). No department/groups header — glabs identity is just the email.
- .env.example + .glabs-web.yaml.example (secrets/EAB/OIDC placeholders,
  gitignored real files) + README (setup, ACME/EAB, the SSR two-URL trap,
  operating, Mongo SSH tunnel, backups).

Second and final core Milestone-F PR; references the glabs-web image from #128.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@obcode
obcode merged commit 95009cd into main Jul 20, 2026
8 checks passed
@obcode
obcode deleted the feat/deploy-stack branch July 20, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant