feat: add account avatars and a deployable image

Accounts get a profile page with an uploaded picture, shown in the
sidebar, the room bar, and every human message. Pictures live in the
SQLite database and are served through an authenticated route.

Hardening from the security audit: preview hosts expire after 24 hours
and carry no-referrer; removing a member or archiving a room ends their
event feed, presence socket, and terminal within seconds; previews and
the terminal pin the SSH host key; invites are claimed atomically;
missing accounts spend the same argon2 time as wrong passwords;
registration is closed by default; WebSockets check the origin; and the
master key is created with mode 0600.

The Dockerfile builds one image with the static client and the server.
The Helm chart runs a single replica with a SQLite volume, a wildcard
preview ingress, and the proxy settings the event feed and uploads
need. It refuses more than one replica because state is in process.
This commit is contained in:
vhaudiquet committed 2026-11-28 02:07:26 +01:00
1 parent 7e7a1d2bb6
commit 3b82719d56
38 files changed
+1307 -106

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
# syntax=docker/dockerfile:1
# The client is static; Nuxt generate leaves .output/public.
FROM node:22-bookworm-slim AS web
WORKDIR /app/web
RUN npm install --global pnpm@11.22.0
COPY web/package.json web/pnpm-lock.yaml web/pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
COPY web/ ./
RUN pnpm build
# The server consumes the Rhema crates. The clone is pinned so an image
# does not move when the framework's main branch does.
FROM rust:1.98.1-bookworm AS server
ARG RHEMA_REPOSITORY=https://github.com/vhaudiquet/rhema.git
ARG RHEMA_REF=v0.5.1
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates cmake git pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --branch "${RHEMA_REF}" "${RHEMA_REPOSITORY}" /rhema
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
RUN sed -i 's#path = "../rhema/#path = "/rhema/#g' Cargo.toml
COPY src ./src
RUN cargo build --release
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --gid 10001 together \
&& useradd --uid 10001 --gid 10001 --home-dir /data --shell /usr/sbin/nologin --no-create-home together \
&& install -d -o together -g together /data
WORKDIR /app
COPY --from=server /app/target/release/rhema-together /app/rhema-together
COPY --from=web /app/web/.output/public /app/web
ENV TOGETHER_LISTEN=0.0.0.0:7800 \
TOGETHER_DATABASE=/data/together.db \
TOGETHER_SECRET_KEY_FILE=/data/secret.key \
TOGETHER_WEB_DIR=/app/web \
HOME=/data \
RUST_LOG=rhema_together=info,tower_http=warn
USER 10001:10001
VOLUME ["/data"]
EXPOSE 7800
ENTRYPOINT ["/app/rhema-together"]