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>
This commit is contained in:
parent
1816f6f863
commit
7a2077f730
6 changed files with 564 additions and 0 deletions
18
web/Containerfile
Normal file
18
web/Containerfile
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# 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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue