Storage and export - Keep books and transactions in SQLite (data/cashbook.db) instead of .ods files; existing .ods books are migrated once at startup - Export a book as the cashbook spreadsheet (.xlsx/.ods, built from the template via LibreOffice) or as CSV - GST rounded per transaction to match the spreadsheet Tax - GST return page with IRD GST101A boxes 5-15 per six-monthly, two-monthly or monthly period, due dates, and a Zero-rated GST type - Income tax page with IR10 (financial statements summary) and IR4 (company return) boxes, from the cashbook plus year-end amounts typed in and saved per book FastAPI and accounts (following led-editor) - Replace the stdlib server with a FastAPI app (src/cashbook_app) run by uvicorn; dependencies in Pipfile - Cookie sessions with bcrypt passwords, first-run admin setup or BOOTSTRAP_ADMIN_*, invites (link or email), sign-in throttling, password change that signs out other sessions - Users page for administrators: rename, reset password, promote or demote, delete, list and revoke invites; last admin is protected - Replaces the shared CASHBOOK_PASSWORD basic auth; AUTH_* settings in .env (see .env.example) - Docker image uses a venv with system site packages for python3-uno - pytest suite for auth, user management, imports, GST and tax figures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 lines
2.0 KiB
YAML
57 lines
2.0 KiB
YAML
services:
|
|
cashbook:
|
|
build: .
|
|
image: accounts-cashbook:latest
|
|
init: true
|
|
restart: unless-stopped
|
|
stop_grace_period: 20s
|
|
|
|
# Run as the owner of ./data so saved files stay owned by them on the host.
|
|
# Rootless Docker maps container root to you instead: set CASHBOOK_USER=0:0.
|
|
user: "${CASHBOOK_USER:-1000:1000}"
|
|
|
|
# Only published on localhost by default; put an HTTPS reverse proxy in front
|
|
# to reach it from elsewhere (set CASHBOOK_BIND=0.0.0.0 only on a trusted network).
|
|
ports:
|
|
- "${CASHBOOK_BIND:-127.0.0.1}:${CASHBOOK_PORT:-8765}:8765"
|
|
|
|
# Settings come from .env next to this file; see .env.example
|
|
environment:
|
|
AUTH_ENABLED: "${AUTH_ENABLED:-true}"
|
|
AUTH_REGISTER_OPEN: "${AUTH_REGISTER_OPEN:-true}"
|
|
AUTH_INVITE_ONLY: "${AUTH_INVITE_ONLY:-true}"
|
|
AUTH_SESSION_DAYS: "${AUTH_SESSION_DAYS:-14}"
|
|
BOOTSTRAP_ADMIN_USERNAME: "${BOOTSTRAP_ADMIN_USERNAME:-}"
|
|
BOOTSTRAP_ADMIN_PASSWORD: "${BOOTSTRAP_ADMIN_PASSWORD:-}"
|
|
PUBLIC_BASE_URL: "${PUBLIC_BASE_URL:-}"
|
|
SMTP_HOST: "${SMTP_HOST:-}"
|
|
SMTP_PORT: "${SMTP_PORT:-587}"
|
|
SMTP_USER: "${SMTP_USER:-}"
|
|
SMTP_PASSWORD: "${SMTP_PASSWORD:-}"
|
|
SMTP_FROM: "${SMTP_FROM:-}"
|
|
SMTP_TLS: "${SMTP_TLS:-true}"
|
|
CASHBOOK_ALLOWED_HOSTS: "${CASHBOOK_ALLOWED_HOSTS:-}"
|
|
# proxies trusted for X-Forwarded-Proto (e.g. your reverse proxy's address)
|
|
FORWARDED_ALLOW_IPS: "${FORWARDED_ALLOW_IPS:-127.0.0.1}"
|
|
|
|
volumes:
|
|
# cashbook.db (books and accounts) and statements/ (uploads go there too)
|
|
- ./data:/data
|
|
# optional: a folder of ANZ exports to pick from, read-only
|
|
# - /path/to/anz:/statements:ro
|
|
|
|
# Locked down: read-only image, scratch space in /tmp, no extra privileges
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:size=512m,mode=1777
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: 10m
|
|
max-file: "3"
|