feat: add backupbot v2 backup labels (admin sqlite /data + imap mail /mail) #3

Closed
autonomic-bot wants to merge 1 commits from add-backupbot-labels into main
Owner

Summary

Adds backupbot.backup v2 labels to the admin and imap services so mailu participates in the Co-op Cloud backup/restore lifecycle.

Data-layout justification

Mailu stores its durable state in two volumes:

  • admin service → mailu:/data (/data in the container): SQLite DB (main.db) holding all users, mailboxes, domains, aliases, DKIM config, and application settings. Loss = all accounts gone. Backed up.
  • imap service (Dovecot) → mail:/mail (/mail in the container): Maildir message storage — all user messages across all folders. Loss = all mail gone. Backed up.

Excluded volumes (intentional)

  • dkim:/dkim — DKIM signing keys. Loss requires re-keying + DNS TXT update on the mail domain; for CI purposes DKIM regeneration is harmless (no live DNS-side DKIM record in CI). Could be added in a follow-up if DKIM key recovery is wanted.
  • redis:/data — Redis session/rate-limit cache. Transient; safe to lose.
  • rspamd:/var/lib/rspamd — Rspamd training data. Re-learns over time; not durable application state.
  • webmail:/data — Roundcube per-user prefs. Regenerable.
  • mailqueue:/queue — Postfix in-flight queue. Transient.
  • certs:/certs — TLS cert dumps from certdumper. Regenerated from Traefik on restart.

Label syntax

Using backupbot v2 map syntax (backupbot.backup: "true" + backupbot.backup.path: "<path>") under deploy.labels, as used in keycloak and mattermost-lts recipes. No pre/post-hooks needed — SQLite is safe to copy live (WAL mode; copy is consistent at the page level), and Maildir is file-based (copy-safe live).

Version bump

3.0.1+2024.06.52 → 3.0.2+2024.06.52 (patch bump for backup label addition).

CI coverage

This PR is tested by the cc-ci harness: tests/mailu/ops.py seeds a test mailbox (citest@<domain>) before backup and deletes it before restore; test_backup.py / test_restore.py assert presence/return via flask mailu config-export.

## Summary Adds `backupbot.backup` v2 labels to the `admin` and `imap` services so mailu participates in the Co-op Cloud backup/restore lifecycle. ## Data-layout justification Mailu stores its durable state in two volumes: - **`admin` service → `mailu:/data`** (`/data` in the container): SQLite DB (`main.db`) holding all users, mailboxes, domains, aliases, DKIM config, and application settings. Loss = all accounts gone. **Backed up.** - **`imap` service (Dovecot) → `mail:/mail`** (`/mail` in the container): Maildir message storage — all user messages across all folders. Loss = all mail gone. **Backed up.** ### Excluded volumes (intentional) - `dkim:/dkim` — DKIM signing keys. Loss requires re-keying + DNS TXT update on the mail domain; for CI purposes DKIM regeneration is harmless (no live DNS-side DKIM record in CI). Could be added in a follow-up if DKIM key recovery is wanted. - `redis:/data` — Redis session/rate-limit cache. Transient; safe to lose. - `rspamd:/var/lib/rspamd` — Rspamd training data. Re-learns over time; not durable application state. - `webmail:/data` — Roundcube per-user prefs. Regenerable. - `mailqueue:/queue` — Postfix in-flight queue. Transient. - `certs:/certs` — TLS cert dumps from certdumper. Regenerated from Traefik on restart. ## Label syntax Using backupbot **v2 map syntax** (`backupbot.backup: "true"` + `backupbot.backup.path: "<path>"`) under `deploy.labels`, as used in keycloak and mattermost-lts recipes. No pre/post-hooks needed — SQLite is safe to copy live (WAL mode; copy is consistent at the page level), and Maildir is file-based (copy-safe live). ## Version bump `3.0.1+2024.06.52` → `3.0.2+2024.06.52` (patch bump for backup label addition). ## CI coverage This PR is tested by the cc-ci harness: `tests/mailu/ops.py` seeds a test mailbox (`citest@<domain>`) before backup and deletes it before restore; `test_backup.py` / `test_restore.py` assert presence/return via `flask mailu config-export`.
autonomic-bot added 1 commit 2026-06-11 18:45:07 +00:00
Author
Owner

!testme

!testme
Author
Owner

🌻 cc-ci — mailu @ edc0201a ❌ failure

cc-ci result card

level

full logs · dashboard

<!-- cc-ci:testme --> 🌻 **cc-ci** — `mailu` @ `edc0201a` ❌ **failure** [![cc-ci result card](https://ci.commoninternet.net/runs/470/summary.png)](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/470) [![level](https://ci.commoninternet.net/runs/470/badge.svg)](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/470) [full logs](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/470) · [dashboard](https://ci.commoninternet.net/)
Author
Owner

!testme

!testme
Author
Owner

🌻 cc-ci — mailu @ edc0201a ✅ passed

cc-ci result card

level

full logs · dashboard

<!-- cc-ci:testme --> 🌻 **cc-ci** — `mailu` @ `edc0201a` ✅ **passed** [![cc-ci result card](https://ci.commoninternet.net/runs/473/summary.png)](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/473) [![level](https://ci.commoninternet.net/runs/473/badge.svg)](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/473) [full logs](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/473) · [dashboard](https://ci.commoninternet.net/)
Author
Owner

!testme

!testme
Author
Owner

🌻 cc-ci — mailu @ edc0201a ✅ passed

cc-ci result card

level

full logs · dashboard

<!-- cc-ci:testme --> 🌻 **cc-ci** — `mailu` @ `edc0201a` ✅ **passed** [![cc-ci result card](https://ci.commoninternet.net/runs/477/summary.png)](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/477) [![level](https://ci.commoninternet.net/runs/477/badge.svg)](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/477) [full logs](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/477) · [dashboard](https://ci.commoninternet.net/)
Author
Owner

!testme

!testme
Author
Owner

🌻 cc-ci — mailu @ edc0201a ✅ passed

cc-ci result card

level

full logs · dashboard

<!-- cc-ci:testme --> 🌻 **cc-ci** — `mailu` @ `edc0201a` ✅ **passed** [![cc-ci result card](https://ci.commoninternet.net/runs/483/summary.png)](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/483) [![level](https://ci.commoninternet.net/runs/483/badge.svg)](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/483) [full logs](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/483) · [dashboard](https://ci.commoninternet.net/)
Author
Owner

Closing as obsolete/superseded by current upstream main (143db80). Upstream now has a better backup setup than this PR's flat path-copy labels:

  • The app service already carries backupbot.backup=${ENABLE_BACKUPS:-true} (stack-wide volume backup opt-in) plus per-volume overrides — this covers the mail volume (/mail) that this PR targeted.
  • The admin sqlite DB is backed up with backupbot.backup.pre-hook: python3 /usr/local/bin/backup_sqlite.py + restore_sqlite.py configs — the correct live-sqlite-safe method. This PR's backupbot.backup.path: /data flat copy of a live sqlite DB is unsafe/superseded by that.

Nothing to carry forward onto the 2024.06.71 bump; that work is in PR #12.

Closing as obsolete/superseded by current upstream main (143db80). Upstream now has a better backup setup than this PR's flat path-copy labels: - The `app` service already carries `backupbot.backup=${ENABLE_BACKUPS:-true}` (stack-wide volume backup opt-in) plus per-volume overrides — this covers the `mail` volume (/mail) that this PR targeted. - The admin sqlite DB is backed up with `backupbot.backup.pre-hook: python3 /usr/local/bin/backup_sqlite.py` + `restore_sqlite.py` configs — the correct live-sqlite-safe method. This PR's `backupbot.backup.path: /data` flat copy of a live sqlite DB is unsafe/superseded by that. Nothing to carry forward onto the 2024.06.71 bump; that work is in PR #12.
autonomic-bot closed this pull request 2026-11-20 05:37:40 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: recipe-maintainers/mailu#3