Run sessions-web behind Authelia, configured only by env vars

Drop the app's own login (password hash, signed cookies, CSRF tokens, rate
limiting): Authelia via Caddy forward_auth is the login. The app refuses any
request without the Remote-User header (optionally limited to
SESSIONS_ALLOWED_USERS) and any cross-site POST (Sec-Fetch-Site / Origin).

The SSH key and the dev box host key now come from environment variables
printed by `sessions-ctl keygen`, so the container needs no secrets store or
mounts. Add compose.yaml so prod's panel can build and deploy it; remove the
Quadlet unit and the files it needed. README covers the panel deploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KKYfRST9cTJYae3f7Jf3ac
This commit is contained in:
agent 2026-09-30 14:39:56 +00:00
parent ca66db3aeb
commit b55ea07c96
9 changed files with 254 additions and 332 deletions

View file

@ -1,5 +1,5 @@
# sessions-web: the prod half of the session manager.
# Build: podman build -t localhost/sessions-web:latest web/
# Configured entirely by environment variables (see app.py); no mounts needed.
FROM docker.io/library/python:3.13-slim
RUN apt-get update \
@ -9,8 +9,6 @@ RUN apt-get update \
WORKDIR /app
COPY app.py /app/app.py
# Mount points must already exist: the container runs with a read-only root.
RUN touch /app/ssh_key /app/known_hosts
USER 10001
ENV PYTHONUNBUFFERED=1 SESSIONS_LISTEN=0.0.0.0:8470