Skip to content
CliprWiki

Deployment and updates

Start, partially redeploy and update.

Deploying

scripts/cliprctl deploy                 # start or update all services
scripts/cliprctl deploy --build         # rebuild images first (after code changes)
scripts/cliprctl deploy app --build     # rebuild and replace only the app
scripts/cliprctl deploy caddy           # recreate only Caddy (e.g. after changing ports)
scripts/cliprctl deploy --no-cache      # full rebuild without build cache
scripts/cliprctl deploy --pull --build  # fetch current base images (security updates)

deploy works in three steps:

  1. Preflight – .env exists with safe permissions, CLIPR_DOMAIN is set, the key is valid, all compose files exist, ports are free, overlay requirements are met (e.g. bridge certificate, wiki hostname). If anything fails, nothing is changed.
  2. Build and start – without service names all services are reconciled and orphans removed. With service names only those are recreated; everything else keeps running.
  3. Wait and check – until all containers run and their health check reports "healthy" (at most three minutes), then a short check like health --brief.

Docker Compose only recreates containers whose image or configuration changed. After editing .env, scripts/cliprctl deploy is therefore enough.

Change Command
A setting in .env scripts/cliprctl deploy
App code (e.g. after git pull) scripts/cliprctl deploy app --build
Wiki content or code scripts/cliprctl deploy wiki --build
caddy/Caddyfile scripts/cliprctl restart caddy
Overlay added or removed scripts/cliprctl deploy

Overlays

Optional components (Proton Mail Bridge, Docker secrets, wiki) are separate compose files. The ones in use are listed in COMPOSE_FILE in .env:

scripts/cliprctl overlay add docker-compose.wiki.yml
scripts/cliprctl deploy

This way a plain docker compose ps or docker compose logs always uses the same files. More in the command reference.

Updating to a new release

scripts/cliprctl update

The update

  1. stops if there are local changes in the repository (commit or discard them first),
  2. fetches the new release with git pull --ff-only and lists the new commits,
  3. names variables that are new in .env.example (optional, defaults apply),
  4. creates a backup (skip with --no-backup),
  5. rebuilds all images with current base images and deploys,
  6. checks health.

Database migrations run automatically when the app starts and only move forward. To go back to an older release after an update, restore the backup from before the update:

git checkout <old-version>
scripts/cliprctl deploy --build
scripts/cliprctl restore backups/clipr-data-<time>.tgz

Notes on individual releases

  • Wiki and single sign-on: new tables in the system database for signing in companion services. The app's service worker is updated; nothing to do.
  • 2.0: on first start the previous database is migrated into the system database and per-account stores. The unencrypted old data is then in /data/legacy-<time>/; after checking, delete it with docker compose exec app python -m clipr.cli purge-legacy. The per-mailbox interval is gone, CLIPR_IMAP_INTERVAL applies.
  • 1.2: the session cookie is called __Host-clipr_session; every device signs in once more. A mail server in the home network needs CLIPR_IMAP_ALLOW_PRIVATE=1. Caddy changes: edit the file, then scripts/cliprctl restart caddy (Caddy's admin API is disabled).
  • 1.1: previously imported tickets have no cropped code yet: choose Re-detect in the ticket.

Without cliprctl

Everything also works directly with Docker Compose – thanks to COMPOSE_FILE with the same files:

docker compose up -d --build
docker compose up -d --no-deps --build app
docker compose ps