sessions/web/sessions-web.container
agent 7a2077f730 Add sessions-web, the prod-side web page and container
Stdlib-only Python app: password login (scrypt), signed SameSite=Strict
cookie, CSRF tokens, login rate limiting, strict CSP and no JavaScript. Every
action is one ssh call to sessions-ctl with a pinned host key. Ships a
Containerfile and a Podman Quadlet unit (rootless, read-only root, all
capabilities dropped, published on 127.0.0.1 only, secrets via podman secret).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 11:55:38 +00:00

34 lines
1.2 KiB
Text

# Podman Quadlet unit for prod. Install as the (rootless) user that runs it:
# ~/.config/containers/systemd/sessions-web.container
# then: systemctl --user daemon-reload && systemctl --user start sessions-web
# Starts at boot only if that user has linger (sudo loginctl enable-linger <user>).
[Unit]
Description=sessions-web (Claude session manager UI)
After=network-online.target
Wants=network-online.target
[Container]
Image=localhost/sessions-web:latest
ContainerName=sessions-web
# Loopback only — the reverse proxy on this host is the only way in.
PublishPort=127.0.0.1:8470:8470
EnvironmentFile=%h/.config/sessions-web/env
# Secrets live in podman's secret store, not in files next to this unit.
Secret=sessions-ssh-key,type=mount,target=/app/ssh_key,mode=0400,uid=10001
Secret=sessions-web-secret,type=env,target=SESSIONS_SECRET
Secret=sessions-password-hash,type=env,target=SESSIONS_PASSWORD_HASH
Volume=%h/.config/sessions-web/known_hosts:/app/known_hosts:ro,Z
ReadOnly=true
Tmpfs=/tmp
Tmpfs=/home/app
HealthCmd=python3 -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8470/healthz', timeout=4)"
HealthInterval=60s
DropCapability=ALL
NoNewPrivileges=true
[Service]
Restart=always
RestartSec=5
[Install]
WantedBy=default.target