Compare commits

...

2 commits

Author SHA1 Message Date
2896d7bb88 better backups 2024-09-07 08:57:51 +02:00
f33cb6d261 typo 2024-09-07 08:57:44 +02:00
2 changed files with 16 additions and 13 deletions

View file

@ -112,13 +112,13 @@ backup:
vault.vm.chapo.li: vault.vm.chapo.li:
backup: backup:
pre_hook: [ "docker compose -f /root/vaultwarden/docker-compose.yml down" ] pre_hook: [ "docker compose -f /root/vaultwarden/docker-compose.yml down" ]
paths: [ "/root/vaultwarden/data" ] paths: [ "/root/vaultwarden/data", "/root/vaultwarden/docker-compose.yml" ]
post_hook: [ "docker compose -f /root/vaultwarden/docker-compose.yml up -d" ] post_hook: [ "docker compose -f /root/vaultwarden/docker-compose.yml up -d" ]
cryptpad.vm.chapo.li: cryptpad.vm.chapo.li:
backup: backup:
pre_hook: [ "docker compose -f /root/docker-compose.yml down" ] pre_hook: [ "docker compose -f /root/docker-compose.yml down" ]
paths: [ "/root/data" ] paths: [ "/root/data", "/root/docker-compose.yml", "/root/customize/application_config.js", "/root/config.js" ]
post_hook: [ "docker compose -f /root/docker-compose.yml up -d" ] post_hook: [ "docker compose -f /root/docker-compose.yml up -d" ]
git.vm.chapo.li: git.vm.chapo.li:
@ -130,7 +130,7 @@ backup:
- mkdir /tmp/backup - mkdir /tmp/backup
- unzip /tmp/forgejo.zip -d /tmp/backup - unzip /tmp/forgejo.zip -d /tmp/backup
- docker exec forgejo-db-1 pg_dump -U forgejo > /tmp/backup/pgdump.sql - docker exec forgejo-db-1 pg_dump -U forgejo > /tmp/backup/pgdump.sql
paths: [ "/tmp/backup" ] paths: [ "/tmp/backup", "/root/forgejo/docker-compose.yml" ]
post_hook: [ "rm -r /tmp/backup" ] post_hook: [ "rm -r /tmp/backup" ]
todo.vm.chapo.li: todo.vm.chapo.li:
@ -146,7 +146,7 @@ backup:
- docker exec -i -w /tmp vikunja-db-1 bash -c 'mysqldump --password={{ vikunja_password }} vikunja > /tmp/vikunja-backup.sql' - docker exec -i -w /tmp vikunja-db-1 bash -c 'mysqldump --password={{ vikunja_password }} vikunja > /tmp/vikunja-backup.sql'
- docker cp vikunja-db-1:/tmp/vikunja-backup.sql /tmp - docker cp vikunja-db-1:/tmp/vikunja-backup.sql /tmp
- docker exec -i -w /tmp vikunja-db-1 bash -c 'rm /tmp/vikunja-backup.sql' - docker exec -i -w /tmp vikunja-db-1 bash -c 'rm /tmp/vikunja-backup.sql'
paths: [ /root/vikunja/files /tmp/vikunja-backup.sql ] paths: [ /root/vikunja/files, /tmp/vikunja-backup.sql, /root/vikunja/config.js, /root/vikunja/docker-compose.yml ]
post_hook: [ "rm -r /tmp/vikunja-backup.sql" ] post_hook: [ "rm -r /tmp/vikunja-backup.sql" ]
mail.vm.chapo.li: mail.vm.chapo.li:
@ -158,13 +158,13 @@ backup:
xmpp.vm.chapo.li: xmpp.vm.chapo.li:
backup: backup:
pre_hook: [] pre_hook: []
paths: [ /var/lib/prosody ] paths: [ /var/lib/prosody, /etc/prosody ]
post_hook: [] post_hook: []
sharkey.vm.chapo.li: sharkey.vm.chapo.li:
backup: backup:
pre_hook: [ "docker exec -it sharkey-db-1 pg_dump firefish --user example-firefish-user --format=plain > /tmp/sharkey.sql" ] pre_hook: [ "docker exec -it sharkey-db-1 pg_dump firefish --user example-firefish-user --format=plain > /tmp/sharkey.sql" ]
paths: [ "/root/sharkey/files", "/tmp/sharkey.sql" ] paths: [ "/root/sharkey/files", "/tmp/sharkey.sql", /root/sharkey/docker-compose.yml, /root/sharkey/.config ]
post_hook: [ "rm /tmp/sharkey.sql" ] post_hook: [ "rm /tmp/sharkey.sql" ]
unmanaged: unmanaged:

View file

@ -64,12 +64,8 @@
src: "{{ item }}.j2" src: "{{ item }}.j2"
dest: "/etc/postfix/{{ item }}" dest: "/etc/postfix/{{ item }}"
loop: loop:
- email2email
- main.cf - main.cf
- master.cf - master.cf
- virtual_alias
- virtual_domains
- virtual_mailbox
notify: Restart postfix notify: Restart postfix
- name: Copy postfix conf - name: Copy postfix conf
@ -158,8 +154,6 @@
src: "rspamd/{{ item }}.j2" src: "rspamd/{{ item }}.j2"
dest: "/etc/rspamd/{{ item }}" dest: "/etc/rspamd/{{ item }}"
loop: loop:
- dkim/canebier.fr.2023061901.key
- dkim/chapoline.me.2023061901.key
- override.d/classifier-bayes.conf - override.d/classifier-bayes.conf
- override.d/redis.conf - override.d/redis.conf
- override.d/milter_headers.conf - override.d/milter_headers.conf
@ -168,8 +162,17 @@
- local.d/actions.conf - local.d/actions.conf
notify: Restart rspamd notify: Restart rspamd
- name: Decrypt rspamd conf
copy:
src: "{{ item }}"
dest: "/etc/rspamd/{{ item }}"
loop:
- dkim/canebier.fr.2023061901.key
- dkim/chapoline.me.2023061901.key
notify: Restart rspamd
- name: Generate letsencrypt certificates - name: Generate letsencrypt certificates
command: "certbot --apache -d {{ mail.external_hostname }} --no-redirect -m {{ letsencrypt_email|default('me@chapoline.me') }} --agree-tos --deploy-hook 'systemctl restart postfix dovecot'" command: "certbot --apache -d {{ mail.external_hostname }} --renew-by-default --expand --no-redirect -m {{ letsencrypt_email|default('me@chapoline.me') }} --agree-tos --deploy-hook 'systemctl restart postfix dovecot'"
- name: Compile dovecot files - name: Compile dovecot files