Commit Graph
6 Commits
Author SHA1 Message Date
iamdoubz 164a5f0990 backups: daily backup, Back up now, download, restore.sh
ci / check (push) Successful in 54s
ci / images (push) Successful in 20s
A backup is data/backups/selfphoneng-YYYYMMDD-HHMM.tar.gz (mode 0600):
pg_dump, voicemail, custom sounds, music on hold, recordings if asked,
and a manifest. No generated Asterisk config: it holds plaintext
passwords and comes back from the database. The api makes one a day after
backup.time (once-a-minute check, one try a day) and the dashboard warns
when today's is missing. Settings -> Backups sets the schedule, lists them
for download and has Back up now.

scripts/restore.sh <file> refuses a backup made under another APP_SECRET
(the manifest carries a fingerprint, not the secret), asks for yes, then
replaces the database and the folders the backup has.

Tested on two throwaway servers (docker:dind running the real images):
back up on one, restore on the other. That found the api image crashing
on start since M1: tsc doesn't copy auth/common-passwords.txt into dist.
The Dockerfile copies it now and CI loads the app inside the image.

Task: M11-T3
2026-10-19 17:07:58 -05:00
iamdoubz 8a763ff130 ci: actions on Node 24 (checkout v7, pnpm/action-setup v6)
ci / images (push) Canceled after 0s
ci / check (push) Canceled after 5s
GitHub warned on every run that checkout@v4, setup-node@v4 and
pnpm/action-setup@v4 target the deprecated Node 20. checkout v7 and
action-setup v6 run on node24; setup-node is dropped because the check
job already runs in node:24.

Task: M6-T8
2026-10-18 14:21:49 -05:00
iamdoubz 80032cba1f ci: run the check job in a container so "postgres" resolves
ci / check (push) Canceled after 0s
ci / images (push) Canceled after 0s
On GitHub's hosted runners a job that isn't in a container can't reach
a service by its name, so every database test failed with getaddrinfo
EAI_AGAIN postgres. The check job now runs in node:24 (Gitea/Forgejo
act_runner already runs jobs in containers) and installs ffmpeg so the
sound and greeting tests run instead of skipping. The voicemail test's
afterAll no longer throws when beforeAll failed.

Checked locally by running the job's steps in node:24 next to a
postgres:18-alpine reachable as "postgres": 481 passed, 5 skipped
(ffmpeg).

Task: M5-T3
2026-10-18 14:17:24 -05:00
iamdoubz 15b8a20751 db: drizzle schema matching spec 02, initial migrations, settings service
Migration 0000 enables citext; 0001 creates all 39 tables. DB tests use a
throwaway database per file (TEST_DATABASE_URL, derived from .env in dev,
a postgres service in CI). Decision 0002: pg driver and @fastify/cookie.

Task: M1-T1
2026-10-17 15:04:18 -05:00
iamdoubz 240b33fb68 ci: drop setup-node pnpm cache (fails without an Actions cache server)
Task: M0-T7
2026-10-17 14:40:54 -05:00
iamdoubz b2d57c1e81 ci: lint, typecheck, test and build both images
Works on GitHub and Gitea/Forgejo Actions. Not run yet: no remote or
runner configured.

Task: M0-T7
2026-10-17 14:32:58 -05:00