arr: Add restic backup

This commit is contained in:
Marty Oehme 2025-07-18 21:05:16 +02:00
parent 363ce9ae6f
commit 64b85c0c40
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 23 additions and 0 deletions

View file

@ -20,6 +20,9 @@ arrstack_puid: "{{ puid | default(1000) }}"
arrstack_pgid: "{{ pgid | default(100) }}"
arrstack_umask_set: "{{ umask_set | default('022') }}"
arrstack_restic_enable: true
arrstack_restic_cron: 0 30 2 * * *
arrstack_env_dir: /opt/arrstack
arrstack_serve_dir: /srv
arrstack_serve_dir_create: true

View file

@ -290,6 +290,26 @@ services:
caddy: "{{ arrstack_gonic_subdomain }}"
caddy.reverse_proxy: "{{ '{{' }}upstreams 80{{ '}}'}}"
{% if restic_enable is not undefined and not false and arrstack_restic_enable is not undefined and not false %}
backup:
image: mazzolino/restic
hostname: "{{ ansible_hostname }}"
environment:
TZ: "{{ restic_tz }}"
BACKUP_CRON: "{{ arrstack_restic_cron }}"
RESTIC_REPOSITORY: "{{ restic_repo }}"
RESTIC_PASSWORD: "{{ restic_pass }}"
AWS_ACCESS_KEY_ID: "{{ restic_s3_key }}"
AWS_SECRET_ACCESS_KEY: "{{ restic_s3_secret }}"
RESTIC_BACKUP_ARGS: >-
--tag arr
RESTIC_BACKUP_SOURCES: "/backup"
volumes:
{% if restic_repo is regex('^/.+') %}
- "{{ restic_repo }}:{{ restic_repo }}"
{% endif %}
- "{{ arrstack_env_dir }}:/backup/{{ arrstack_env_dir }}"
{% endif %}
networks:
caddy: