backups: daily backup, Back up now, download, restore.sh
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
This commit is contained in:
1 parent
803859a1d2
commit
164a5f0990
16 files changed
+738
-10
No files matched your search
@@ -25,6 +25,8 @@ COPY --from=build /out/node_modules ./node_modules
|
||||
COPY --from=build /src/apps/api/dist ./dist
|
||||
COPY --from=build /src/apps/web/dist ./public
|
||||
COPY --from=build /src/apps/api/src/db/migrations ./dist/db/migrations
|
||||
# tsc only emits .js: files the code reads next to itself come over by hand.
|
||||
COPY --from=build /src/apps/api/src/auth/common-passwords.txt ./dist/auth/common-passwords.txt
|
||||
ENV NODE_ENV=production
|
||||
ENTRYPOINT ["/usr/bin/tini","--"]
|
||||
CMD ["node","dist/index.js"]
|
||||
Reference in new issue
Block a user