Files
canon/compose.yaml
cdnutterandClaude Opus 5.5 796384420b Security sweep: fix open redirect, XFF rate-limit bypass, SSRF; harden image and compose
- Reject control chars and backslashes in redirect targets
- Use proxy-added X-Forwarded-For entry, cap limiter keys
- Block private/loopback/link-local addresses on image fetch
- HSTS over HTTPS, generic error on custom CSS
- x/crypto 0.59.0, pin golang:1.27.4-alpine3.24 and alpine:3.24.4
- Compose: cap_drop ALL, no-new-privileges, read_only, limits, labels
- Add SECURITY.md, CHANGELOG.md, TODO.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 13:16:31 -08:00

63 lines
1.9 KiB
YAML

name: canon
# Works with a plain `docker compose up -d --build` and with Arcane's Git sync
# (Pull). Arcane pulls this file's whole directory, so the build context is
# the repository itself.
services:
canon:
build:
context: .
args:
VERSION: ${CANON_VERSION:-dev}
image: canon:1.0.0
# Never look for canon:latest on a registry: every deploy (including
# Arcane's "Pull image" / "Redeploy after sync") builds from the source
# that was just synced.
pull_policy: build
container_name: canon-app
labels:
org.stack: canon
org.purpose: "canon app"
restart: unless-stopped
# The entrypoint starts as root only to chown /data and /backups, then
# drops to PUID:PGID with su-exec. These are the only capabilities that
# step needs.
cap_drop: [ALL]
cap_add: [CHOWN, DAC_OVERRIDE, FOWNER, SETUID, SETGID]
security_opt: [no-new-privileges:true]
read_only: true
tmpfs:
- /tmp
mem_limit: 512m
pids_limit: 256
ports:
- "${CANON_BIND:-0.0.0.0}:${CANON_PUBLISH_PORT:-4242}:4242"
volumes:
# A named volume by default, so a Git sync never touches the database.
# Set CANON_DATA_PATH to a host folder (e.g. ./data) to keep it there.
- ${CANON_DATA_PATH:-canon-data}:/data
# Backups get their own mount so they can live somewhere else, like a
# NAS share. Set CANON_BACKUP_PATH to a host folder to use one.
- ${CANON_BACKUP_PATH:-canon-backups}:/backups
environment:
CANON_BACKUP_DIR: /backups
# Who owns the files Canon writes. 99:100 is Unraid's nobody:users;
# use 1000:1000 (or your own `id -u`:`id -g`) elsewhere.
PUID: ${PUID:-99}
PGID: ${PGID:-100}
UMASK: ${UMASK:-022}
env_file:
- path: .env
required: false
networks:
- chromanet
volumes:
canon-data:
canon-backups:
networks:
chromanet:
external: true