chore: upgrade redis to 8.10.3-alpine #9

Open
autonomic-bot wants to merge 5 commits from upgrade-69afb87 into main
3 changed files with 32 additions and 2 deletions
+1
View File
@@ -2,3 +2,4 @@ export CERTDUMPER_POST_VERSION=v1
export POSTFIX_OVERRIDE_VERSION=v17
export SENDER_LOGIN_VERSIONS=v2
export BACKUP_SQLITE_VERSION=v1
export RESTORE_SQLITE_VERSION=v1
+9 -2
View File
@@ -96,13 +96,13 @@ services:
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "coop-cloud.${STACK_NAME}.version=4.0.0+2024.06.67"
- "coop-cloud.${STACK_NAME}.version=4.0.1+2024.06.67"
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
- "backupbot.backup.volumes.traefik_letsencrypt=false"
- "backupbot.backup.volumes.mailu.path=backup"
db:
image: redis:8.10.2-alpine
image: redis:8.10.3-alpine
volumes:
- "redis:/data"
@@ -122,9 +122,13 @@ services:
- source: backup_sqlite
target: /usr/local/bin/backup_sqlite.py
mode: 0444
- source: restore_sqlite
target: /usr/local/bin/restore_sqlite.py
mode: 0444
deploy:
labels:
backupbot.backup.pre-hook: "python3 /usr/local/bin/backup_sqlite.py"
backupbot.restore.post-hook: "python3 /usr/local/bin/restore_sqlite.py"
imap:
image: ghcr.io/mailu/dovecot:2024.06.67
@@ -234,6 +238,9 @@ configs:
backup_sqlite:
name: ${STACK_NAME}_backup_sqlite_${BACKUP_SQLITE_VERSION}
file: backup_sqlite.py
restore_sqlite:
name: ${STACK_NAME}_restore_sqlite_${RESTORE_SQLITE_VERSION}
file: restore_sqlite.py
secrets:
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""Restore Mailu's SQLite snapshot without replacing the live database inode."""
import sqlite3
from pathlib import Path
backup_path = Path("/data/backup/main.db")
live_path = Path("/data/main.db")
# The source and destination must already exist. A missing snapshot or live
# database is a restore failure, not a reason to create an empty database.
with sqlite3.connect(
f"{backup_path.as_uri()}?mode=ro", uri=True, timeout=60
) as source:
if source.execute("PRAGMA integrity_check").fetchall() != [("ok",)]:
raise RuntimeError(f"Invalid SQLite snapshot: {backup_path}")
with sqlite3.connect(
f"{live_path.as_uri()}?mode=rw", uri=True, timeout=60
) as destination:
source.backup(destination, pages=256, sleep=0.1)
print(f"SQLite restore complete: {live_path}", flush=True)