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>
18 lines
600 B
Docker
18 lines
600 B
Docker
# sessions-web: the prod half of the session manager.
|
|
# Build: podman build -t localhost/sessions-web:latest web/
|
|
FROM docker.io/library/python:3.13-slim
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends openssh-client \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& useradd --uid 10001 --create-home --home-dir /home/app app
|
|
|
|
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
|
|
EXPOSE 8470
|
|
CMD ["python3", "/app/app.py"]
|