feat(shaarli): Add backups

Add restic backup functionality for shaarli data.
This commit is contained in:
Marty Oehme 2025-02-03 18:58:12 +01:00
parent af4cfc5a4b
commit 557f20d7b4
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 21 additions and 0 deletions

View file

@ -7,3 +7,7 @@ shaarli_use_https: true
# the subdomain link shaarli will be reachable under
subdomain_alias: links
# should we back up the data?
shaarli_backup_enable: true
shaarli_backup_cron: 0 45 3 * * *

View file

@ -15,6 +15,23 @@ services:
- data:/var/www/shaarli/data
- cache:/var/www/shaarli/cache
{% if backup_enable is not undefined and not false and shaarli_backup_enable is not undefined and not false %}
backup:
image: mazzolino/restic
environment:
- "TZ={{ restic_timezone }}"
# go-cron starts w seconds
- "BACKUP_CRON={{ shaarli_backup_cron }}"
- "RESTIC_REPOSITORY={{ restic_repo }}"
- "AWS_ACCESS_KEY_ID={{ restic_s3_key }}"
- "AWS_SECRET_ACCESS_KEY={{ restic_s3_secret }}"
- "RESTIC_PASSWORD={{ restic_pass }}"
- "RESTIC_BACKUP_TAGS=shaarli"
- "RESTIC_BACKUP_SOURCES=/volumes"
volumes:
- data:/volumes/shaarli_data:ro
{% endif %}
volumes:
data:
cache: