* chore: add a formatter, matching the style this repo already writes singleQuote=true was chosen by counting this repo's own imports, not by fleet decree. The fleet is genuinely split and the two repos that already had a .prettierrc disagreed with each other, so there was no standard to restore. Quote style does not cross repo boundaries; having a gate does. Markdown is ignored for now — prettier rewraps prose, which would bury the real diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * style: format with prettier, and close a comment that was never closed The formatter refused this repo outright, which turned out to be a real defect rather than a tooling complaint. kivitendo-intake.css opens a header comment, and line 17 contains an inner /* ⚠ PRÜFEN */ — CSS comments do not nest, so that inner terminator CLOSES the header. Everything after it is parsed as CSS until the stray */ on line 20. A browser mis-parses it the same way. The file exists in two places (public/presentations/ and deliverables/), both carrying the same defect; fixing one still failed the gate, which is how the duplicate surfaced at all. Mechanical otherwise. This SHA is listed in .git-blame-ignore-revs. * chore: teach git blame to skip the reformat * fix: undo a 3-way merge duplication in AdminSidebar.tsx Merging main with -X theirs duplicated a 30-line block: main's currency-sweep commit and this branch's prettier reformat both touched overlapping lines in the single-destination-group render path, and the -X theirs strategy inserted rather than replaced, leaving two near-identical copies and a dangling closing brace — SyntaxError: ',' expected at line 298. The branch has no legitimate change to this file's logic, only formatting, so main's content is correct outright. Took it wholesale rather than hand-editing the merge result. * fix(lint): reattach 5 directives the reformat detached Four eslint-disable-next-line sites for react-hooks/set-state-in-effect and one @ts-expect-error, all the same defect: the directive sat above useEffect( (or above a JSX element), while the statement that actually errors is 1-2 lines further down inside the block. eslint/tsc report at the real statement; the directive, still bound to its original line number, protects nothing there. TimecardReviewDrawer.tsx (x2), DataEntryTabs.tsx, AppointmentBookingForm.tsx, CreatePoolModal.tsx. Same root cause documented for hirnli, fleetcrown and ivy-portal earlier today — a positional directive is a hidden dependency on formatting, and this is the fourth distinct shape it's taken. * fix(i18n): restore a same-line audit-exemption marker Fifth shape of today's positional-directive defect, this time the repo's own i18n-hardcoded-audit convention rather than eslint or tsc: a // i18n-ok comment exempts a hardcoded string only when it trails the SAME line. prettier wrapped this one if-statement's long condition onto its own line, leaving the marker on the return statement below — the exact sibling one line down ('fortgeschrittene bis experten') stayed on one line because it was short enough not to wrap, and it alone kept passing. Restored the one-line form and added // prettier-ignore so a future reformat cannot re-split it. Verified against the real audit script locally: 0 new violations. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Ops scripts
Box-side operations that are not part of the app build, so the deploy
(scripts/selfhost-deploy-revampit.sh, which only rsyncs the standalone build)
does not ship them. They are version-controlled here as the source of truth and
installed onto the box once with the block below; re-run it after editing.
Nightly backups → R2 (backup-db-to-r2.sh)
The prod Postgres lives on the Hetzner box only, so a nightly
off-box copy is the safety net. The job pg_dumps the DB (custom format) and
tars /opt/revampit/uploads, then pushes both to the private R2 bucket
revampit-backups with 30-day retention. Credentials are read from the app's
own /opt/revampit/app/.env (the same S3_* keys used for image upload — one
R2 token covers every bucket), so there is nothing extra to configure.
Hardening (why it won't silently fail):
- Dump is validated with
pg_restore --listand a non-empty check before upload — a truncated/corrupt dump aborts the run instead of being stored. - Upload retries 4× with backoff (plus SDK-level
maxAttempts), then verifies the stored object's size viaHeadObject. A short/0-byte upload fails loudly. - Runs against the backup's own pinned
@aws-sdkinops/node_modules, so an app redeploy (or future tree-shake) can't break it; it falls back to the app's copy only if the pinned one is missing. Persistent=truecatches a run missed while the box was off. Prune is best-effort — it can never fail a backup whose copy is already stored.
Health check (no external monitor needed): list the bucket and look at the
newest db/ object's timestamp — older than ~26h means last night's run failed.
Real-time push alerts would need an email/Slack credential (none configured); add
one and wire OnFailure= if you want them.
Restore a DB dump:
# copy the chosen dump down, then:
pg_restore --clean --if-exists --no-owner -d "$DATABASE_URL" revampit-db-<stamp>.dump
Install / update on the box
BOX=ubuntu@167.233.22.31
ssh "$BOX" 'sudo mkdir -p /opt/revampit/ops'
rsync -az -e ssh \
scripts/ops/backup-db-to-r2.sh scripts/ops/r2-backup-upload.cjs \
"$BOX:/tmp/ops/"
ssh "$BOX" '
sudo mv /tmp/ops/* /opt/revampit/ops/ && rmdir /tmp/ops
sudo chmod +x /opt/revampit/ops/backup-db-to-r2.sh
'
# Pin the backup its OWN aws-sdk (once) so app redeploys can never break it:
ssh "$BOX" '
cd /opt/revampit/ops
sudo bash -c "[ -f package.json ] || npm init -y >/dev/null; npm install @aws-sdk/client-s3@^3 --no-audit --no-fund --silent"
'
# systemd units
rsync -az -e ssh \
scripts/ops/revampit-backup.service scripts/ops/revampit-backup.timer \
"$BOX:/tmp/"
ssh "$BOX" '
sudo mv /tmp/revampit-backup.service /tmp/revampit-backup.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now revampit-backup.timer
'
# verify with a one-off run
ssh "$BOX" 'sudo systemctl start revampit-backup.service && journalctl -u revampit-backup.service -n 20 --no-pager'
Self-hosted crons (run-cron.sh + revampit-cron@<job>.timer)
The 4 cron jobs that ran on Vercel before the cutover are now systemd timers on
the box (Vercel no longer runs anything). run-cron.sh <endpoint> curls
http://localhost:4004/api/cron/<endpoint> with Authorization: Bearer $CRON_SECRET (read from /opt/revampit/app/.env) and fails non-zero on any
non-200, so a failed run shows up in systemctl/journald.
| Timer | Endpoint | Schedule (UTC) |
|---|---|---|
revampit-cron@close-decisions.timer |
/api/cron/close-decisions |
00:00 |
revampit-cron@close-it-hilfe-requests.timer |
/api/cron/close-it-hilfe-requests |
01:00 |
revampit-cron@prune-audit-log.timer |
/api/cron/prune-audit-log |
02:00 |
revampit-cron@wake-recurring-tasks.timer |
/api/cron/wake-recurring-tasks |
07:00 |
revampit-cron@release-escrow.timer |
/api/cron/release-escrow |
04:00 |
CRON_SECRET must be set in /opt/revampit/app/.env (without it the routes skip
auth and are publicly triggerable). It is preserved across deploys (the deploy
excludes .env from rsync and copies the existing one forward).
Install / update on the box
BOX=ubuntu@167.233.22.31
rsync -az -e ssh scripts/ops/run-cron.sh "$BOX:/tmp/" && \
ssh "$BOX" 'sudo mv /tmp/run-cron.sh /opt/revampit/ops/ && sudo chmod +x /opt/revampit/ops/run-cron.sh'
rsync -az -e ssh scripts/ops/revampit-cron@*.service scripts/ops/revampit-cron@*.timer "$BOX:/tmp/"
ssh "$BOX" '
sudo mv /tmp/revampit-cron@*.service /tmp/revampit-cron@*.timer /etc/systemd/system/
sudo systemctl daemon-reload
for j in close-decisions close-it-hilfe-requests prune-audit-log wake-recurring-tasks release-escrow; do
sudo systemctl enable --now "revampit-cron@$j.timer"
done
'
# one-off test: sudo systemctl start revampit-cron@close-decisions.service && journalctl -u revampit-cron@close-decisions.service -n5