Compare commits
43
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78421d9c5a | ||
|
|
5b6328b68f | ||
|
|
77659e75c3 | ||
|
|
ebe01e00cc | ||
|
|
73787fef14 | ||
|
|
c029f4e65a | ||
|
|
6d2bdf5303 | ||
|
|
5042e50f55 | ||
|
|
789a9d0f42 | ||
|
|
19afffd8cd | ||
|
|
95b096c442 | ||
|
|
88f6f0b876 | ||
|
|
872e098bb9 | ||
|
|
57fadc2ea4 | ||
|
|
0f5ee292df | ||
|
|
74e8c1a3cc | ||
|
|
2b721698b0 | ||
|
|
bdaab88f08 | ||
|
|
89f88ce384 | ||
|
|
b244c2d855 | ||
|
|
302dfd23b7 | ||
|
|
d31aa15791 | ||
|
|
ec37f16553 | ||
|
|
6edc435e32 | ||
|
|
ee4e7270c8 | ||
|
|
c75df76fa6 | ||
|
|
0b33e79f1e | ||
|
|
e19297ab07 | ||
|
|
b1761be669 | ||
|
|
68c5c8be4d | ||
|
|
164736e6fe | ||
|
|
6b3b891b98 | ||
|
|
e7f4b8d86d | ||
|
|
75da49770d | ||
|
|
dff19033f6 | ||
|
|
2e4a082408 | ||
|
|
682ccaaa2d | ||
|
|
d5939e433b | ||
|
|
c5bb97fa6b | ||
|
|
90154fdd84 | ||
|
|
05995e7855 | ||
|
|
37491ade51 | ||
|
|
23309a1a80 |
@@ -198,3 +198,5 @@ REJECT_UNLISTED_RECIPIENT=
|
||||
# NOTE(3wc): Other values are not supported, as compose.yml does not contain
|
||||
# configuration for them. Pull requests welcome!
|
||||
DB_FLAVOR=sqlite
|
||||
|
||||
ENABLE_BACKUPS=true
|
||||
@@ -4,10 +4,10 @@ Coöp Cloud + [Mailu][Mailu] = 🥳
|
||||
|
||||
<!-- metadata -->
|
||||
* **Category**: Apps
|
||||
* **Status**: 1, alpha
|
||||
* **Status**: 2, beta
|
||||
* **Image**: [`mailu/*`](https://hub.docker.com/r/mailu/), 4, upstream
|
||||
* **Healthcheck**: No
|
||||
* **Backups**: No
|
||||
* **Backups**: Yes
|
||||
* **Email**: N/A
|
||||
* **Tests**: No
|
||||
* **SSO**: No
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export CERTDUMPER_POST_VERSION=v1
|
||||
export POSTFIX_OVERRIDE_VERSION=v17
|
||||
export SENDER_LOGIN_VERSIONS=v2
|
||||
export BACKUP_SQLITE_VERSION=v1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sqlite3
|
||||
from pathlib import Path
|
||||
|
||||
source_path = Path("/data/main.db")
|
||||
backup_dir = Path("/data/backup")
|
||||
temporary_path = backup_dir / "main.db.tmp"
|
||||
backup_path = backup_dir / "main.db"
|
||||
|
||||
os.umask(0o077)
|
||||
backup_dir.mkdir(mode=0o700, parents=True, exist_ok=True)
|
||||
temporary_path.unlink(missing_ok=True)
|
||||
|
||||
try:
|
||||
# Read-only mode prevents silently creating an empty source database.
|
||||
source = sqlite3.connect(
|
||||
f"{source_path.as_uri()}?mode=ro",
|
||||
uri=True,
|
||||
timeout=60,
|
||||
)
|
||||
destination = sqlite3.connect(temporary_path)
|
||||
try:
|
||||
source.backup(destination, pages=256, sleep=0.1)
|
||||
result = destination.execute("PRAGMA integrity_check").fetchall()
|
||||
if result != [("ok",)]:
|
||||
raise RuntimeError(f"SQLite integrity check failed: {result}")
|
||||
finally:
|
||||
destination.close()
|
||||
source.close()
|
||||
# Only publish a fully written, verified snapshot.
|
||||
os.replace(temporary_path, backup_path)
|
||||
print(f"SQLite backup ready: {backup_path}", flush=True)
|
||||
except Exception:
|
||||
temporary_path.unlink(missing_ok=True)
|
||||
raise
|
||||
+23
-9
@@ -55,7 +55,7 @@ x-environment:
|
||||
|
||||
services:
|
||||
app:
|
||||
image: ghcr.io/mailu/nginx:2024.06.27
|
||||
image: ghcr.io/mailu/nginx:2024.06.67
|
||||
logging:
|
||||
driver: json-file
|
||||
networks:
|
||||
@@ -96,15 +96,18 @@ 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=3.0.0+2024.06.27"
|
||||
- "coop-cloud.${STACK_NAME}.version=4.0.0+2024.06.67"
|
||||
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
||||
- "backupbot.backup.volumes.traefik_letsencrypt=false"
|
||||
- "backupbot.backup.volumes.mailu.path=backup"
|
||||
|
||||
db:
|
||||
image: redis:7.4.1-alpine
|
||||
image: redis:8.10.2-alpine
|
||||
volumes:
|
||||
- "redis:/data"
|
||||
|
||||
admin:
|
||||
image: ghcr.io/mailu/admin:2024.06.27
|
||||
image: ghcr.io/mailu/admin:2024.06.67
|
||||
environment: *default-env
|
||||
healthcheck:
|
||||
disable: true
|
||||
@@ -115,9 +118,16 @@ services:
|
||||
- "mailu:/data"
|
||||
networks:
|
||||
- default
|
||||
configs:
|
||||
- source: backup_sqlite
|
||||
target: /usr/local/bin/backup_sqlite.py
|
||||
mode: 0444
|
||||
deploy:
|
||||
labels:
|
||||
backupbot.backup.pre-hook: "python3 /usr/local/bin/backup_sqlite.py"
|
||||
|
||||
imap:
|
||||
image: ghcr.io/mailu/dovecot:2024.06.27
|
||||
image: ghcr.io/mailu/dovecot:2024.06.67
|
||||
environment: *default-env
|
||||
secrets:
|
||||
- secret_key
|
||||
@@ -131,7 +141,7 @@ services:
|
||||
- default
|
||||
|
||||
smtp:
|
||||
image: ghcr.io/mailu/postfix:2024.06.27
|
||||
image: ghcr.io/mailu/postfix:2024.06.67
|
||||
environment: *default-env
|
||||
secrets:
|
||||
- secret_key
|
||||
@@ -143,7 +153,7 @@ services:
|
||||
- app
|
||||
|
||||
antispam:
|
||||
image: ghcr.io/mailu/rspamd:2024.06.27
|
||||
image: ghcr.io/mailu/rspamd:2024.06.67
|
||||
environment: *default-env
|
||||
secrets:
|
||||
- secret_key
|
||||
@@ -154,7 +164,7 @@ services:
|
||||
disable: true
|
||||
|
||||
webmail:
|
||||
image: ghcr.io/mailu/webmail:2024.06.27
|
||||
image: ghcr.io/mailu/webmail:2024.06.67
|
||||
# entrypoint: "tail -f /dev/null"
|
||||
environment: *default-env
|
||||
networks:
|
||||
@@ -169,7 +179,7 @@ services:
|
||||
disable: true
|
||||
|
||||
certdumper:
|
||||
image: ldez/traefik-certs-dumper:v2.9.3
|
||||
image: ldez/traefik-certs-dumper:v2.11.4
|
||||
entrypoint: sh -c '
|
||||
apk add jq
|
||||
; while ! [ -e /traefik/${ACME_JSON} ]
|
||||
@@ -221,6 +231,10 @@ configs:
|
||||
certdumper_post:
|
||||
name: ${STACK_NAME}_certdumper_post_${CERTDUMPER_POST_VERSION}
|
||||
file: certdumper_post.sh
|
||||
backup_sqlite:
|
||||
name: ${STACK_NAME}_backup_sqlite_${BACKUP_SQLITE_VERSION}
|
||||
file: backup_sqlite.py
|
||||
|
||||
|
||||
secrets:
|
||||
secret_key:
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Contains mitigation measures for php2shell
|
||||
@@ -0,0 +1 @@
|
||||
Actual mitigation for php2shell pending further alpine image upgrades
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user