Add scheduled and manual backups
Backups are .tar.gz archives of a consistent database snapshot (VACUUM INTO) plus the images folder. They run on a cron schedule, daily at 3:00 by default, and the newest N scheduled ones are kept (7 by default). Manual backups are never pruned. Settings → Backups offers schedule presets or a custom cron expression, retention, "Back up now", and download/delete for each backup. A small built-in parser handles standard 5-field cron syntax with names, ranges, steps and @daily-style shorthands. Backups go to CANON_BACKUP_DIR (default data/backups). Compose mounts a separate canon-backups volume at /backups, overridable with CANON_BACKUP_PATH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
72b49d709a
commit
f3185ba7bd
18 files changed
+940
-10
No files matched your search
+2
-2
@@ -10,12 +10,12 @@ RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=${VERSION}"
|
||||
FROM alpine:3
|
||||
RUN apk add --no-cache ca-certificates tzdata \
|
||||
&& adduser -D -u 1000 canon \
|
||||
&& mkdir -p /data && chown canon:canon /data
|
||||
&& mkdir -p /data /backups && chown canon:canon /data /backups
|
||||
COPY --from=build /out/canon /usr/local/bin/canon
|
||||
USER canon
|
||||
ENV CANON_DATA_DIR=/data \
|
||||
CANON_PORT=4242
|
||||
VOLUME /data
|
||||
VOLUME /data /backups
|
||||
EXPOSE 4242
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
|
||||
CMD wget -qO- http://127.0.0.1:${CANON_PORT}/healthz >/dev/null || exit 1
|
||||
|
||||
Reference in new issue
Block a user