You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Front Flask and the Vue SPA with a Caddy frontend-proxy on port 8000
Adds a new frontend-proxy service (multi-stage Dockerfile: node builder
stage compiles the SPA bundle; caddy:2-alpine runtime stage serves it)
that terminates the host HTTP port and fans out over the existing
web-host network:
/spa/* -> spa-frontend:5173 (vite dev) in dev, baked /srv/spa-dist
via file_server in prod
/static/* -> webapp/ref/static bind-mount served directly by Caddy
/admin, /admin/ -> 302 to /admin/exercise/view
/spa -> 308 /spa/
everything else -> reverse_proxy web:8000 (X-Tinyproxy set from
remote_host so the rate limiter keys on real client IP)
Dev/prod Caddyfiles are selected at container start via entrypoint.sh
based on $HOT_RELOADING. Prod adds Cache-Control headers: immutable +
long max-age on /spa/assets/*, no-cache on the SPA HTML fallback, 1h on
Flask static assets. Caddy's reverse_proxy auto-upgrades Vite's HMR
websocket for /spa/@vite/client.
The SPA URL prefix moves from /v2 to /spa (vite base, router history,
Flask landing redirects). The /api/v2/* JSON API path is unchanged.
The spa-frontend service is gated behind the 'dev' compose profile so
it only starts when hot-reloading is active; ctrl.sh exports
COMPOSE_PROFILES=dev by default and clears it in prod-mode up. The
prod-mode branch of spa-frontend/entrypoint.sh is now a hard error
since the prod bundle is baked into the frontend-proxy image.
web and spa-frontend no longer publish host ports; the test harness
maps frontend-proxy:8000 instead. SPA_HOST_PORT is removed from
settings.yaml/env and prepare.py. A repo-root .dockerignore keeps the
frontend-proxy build context lean.
UI:
- SPA DefaultLayout app bar gets an unobtrusive mdi-shield-account-outline
icon button linking to /admin.
- Admin navbar gains a "Student View" link (school icon + label) with a
pipe separator from the user name/logout group.
- Admin navbar brand (logo + course name) now links to the exercise view
instead of the SPA landing.
Student-facing pages (registration, restore-key, public scoreboard) are served by the Vue SPA under `/v2/*` and talk to `ref/frontend_api/`. Admin pages live under `ref/view/` as Jinja-rendered HTML.
165
+
Student-facing pages (registration, restore-key, public scoreboard) are served by the Vue SPA under `/spa/*` and talk to `ref/frontend_api/`. Admin pages live under `ref/view/` as Jinja-rendered HTML. The Caddy `frontend-proxy` container fronts both on a single host port 8000 — it reverse-proxies `/spa/*` to `spa-frontend:5173` (dev, with HMR) or serves a baked SPA bundle (prod), serves Flask's `/static/*` directly, and proxies everything else to `web:8000`.
166
166
167
167
2.**SSH Reverse Proxy** (`ssh-reverse-proxy/`) - Rust-based SSH proxy on port 2222
168
168
- Routes student SSH connections to exercise containers
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,4 +184,4 @@ The following features are disabled by default and can be enabled from the admin
184
184
Allows students to be organized into named groups with a configurable maximum size. Students pick a group during registration, and admins can manage the available groups and reassign students afterwards. Enable via the `GROUPS_ENABLED` setting and configure the per-group capacity via `GROUP_SIZE`.
185
185
186
186
#### Scoreboard
187
-
A public leaderboard at `/v2/scoreboard` that ranks students based on their exercise submissions using a Formula 1 style, time-weighted strategy. Exercises can be grouped into assignments. Enable via `SCOREBOARD_ENABLED`; optionally set `LANDING_PAGE` to `scoreboard` to use it as the default landing page.
187
+
A public leaderboard at `/spa/scoreboard` that ranks students based on their exercise submissions using a Formula 1 style, time-weighted strategy. Exercises can be grouped into assignments. Enable via `SCOREBOARD_ENABLED`; optionally set `LANDING_PAGE` to `scoreboard` to use it as the default landing page.
0 commit comments