Files
InkNote/docker-compose.yml
T
marcandClaude Opus 5 68e184163e Remove public sign-up; accounts are created by an administrator
This is a private instance, so anyone able to reach the login page could
previously give themselves an account. The registration route is gone
rather than hidden, and the login screen no longer hints that accounts
can be made.

Accounts now come from an admin under Account → Administration: create,
delete, and reset a password. Appointing further admins is deliberately
not offered — with one admin it is not needed, and it is the one power
that turns a compromised account into a lost instance.

The first admin comes from INKNOTE_ADMIN_USER / INKNOTE_ADMIN_PASSWORD,
used only when the database has no users, or to choose whom to promote
when an older database has users but no admin. Once an admin exists both
are ignored, so leaving them in .env cannot reset anything.

Two things that would otherwise have been quietly wrong:

- a deleted user's token stayed valid until it expired, because tokens
  are signed rather than stored and there was no session to revoke.
  authMiddleware now checks the account still exists, so an open tab
  stops working the moment the account is deleted.
- deleting an account takes its notes, notebooks, drawings and version
  history with it via ON DELETE CASCADE. Verified: no orphaned rows in
  notes, notebooks, sync_log, attachments or note_versions.

Deletion asks for the username to be typed back, since it destroys data
that version history cannot bring back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 12:53:08 +02:00

57 lines
2.1 KiB
YAML

version: "3.8"
# ─────────────────────────────────────────────
# InkNote — Deploy on Docker VM
# Pull images from Gitea container registry
#
# Usage:
# mkdir -p /srv/inknote/db /srv/inknote/uploads
# chown -R 1000:1000 /srv/inknote
# docker login gitea.honeyy.duckdns.org
# docker compose pull
# docker compose up -d
#
# Data lives under INKNOTE_DATA_DIR (default /srv/inknote) on the host.
# Back that path up together with the .env holding ENCRYPTION_KEY — the
# database is encrypted and is unreadable without that key.
# ─────────────────────────────────────────────
services:
inknote-server:
image: gitea.honeyy.duckdns.org/docker/inknote-server:latest
container_name: inknote-server
restart: unless-stopped
environment:
- PORT=4000
- JWT_SECRET=${JWT_SECRET}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
# Only used when the database has no users at all: creates the first admin.
- INKNOTE_ADMIN_USER=${INKNOTE_ADMIN_USER:-}
- INKNOTE_ADMIN_PASSWORD=${INKNOTE_ADMIN_PASSWORD:-}
- NODE_ENV=production
# Bind mounts, not named volumes: the data sits in a plain directory on the
# Docker host, so whatever backs up the host also backs up InkNote.
# Create it first: mkdir -p /srv/inknote/{db,uploads} && chown -R 1000:1000 /srv/inknote
user: "${INKNOTE_UID:-1000}:${INKNOTE_GID:-1000}"
volumes:
- ${INKNOTE_DATA_DIR:-/srv/inknote}/db:/app/data
- ${INKNOTE_DATA_DIR:-/srv/inknote}/uploads:/app/uploads
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:4000/api/health"]
interval: 30s
timeout: 5s
retries: 3
inknote-web:
image: gitea.honeyy.duckdns.org/docker/inknote-web:latest
container_name: inknote-web
restart: unless-stopped
ports:
- "3000:80"
depends_on:
inknote-server:
condition: service_healthy
volumes:
inknote-data:
inknote-uploads: