install.fairie/home/dot_config/autorestic/autorestic-user.yml.tmpl
Brian Zalewski cd4b269e4e Latest
2023-12-25 05:29:22 +00:00

135 lines
6.3 KiB
Cheetah

---
version: 2
extras:
app: &app
to:
- apps-local
- apps-s3
hooks:
before:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Autorestic App Backup ${AUTORESTIC_LOCATION} BEFORE / Host: ${HOST} / User: ${USER} / Home: ${HOME}" https://healthchecks.{{ .host.domain }}/ping/TODO_UUID/start'
failure:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Autorestic App Backup ${AUTORESTIC_LOCATION} BEFORE / Host: ${HOST} / User: ${USER} / Home: ${HOME}" https://healthchecks.{{ .host.domain }}/ping/TODO_UUID/fail'
success:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Autorestic App Backup ${AUTORESTIC_LOCATION} BEFORE / Host: ${HOST} / User: ${USER} / Home: ${HOME}" https://healthchecks.{{ .host.domain }}/ping/TODO_UUID'
options:
backup:
exclude:
- .local
- .venv
- node_modules
- venv
tag:
- app
forget:
keep-hourly: 24
keep-daily: 7
keep-weekly: 14
keep-monthly: 3
keep-yearly: 2
user: &user
hooks:
before:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Autorestic User Home Folder ${AUTORESTIC_LOCATION} BEFORE / Host: ${HOST} / User: ${USER} / Home: ${HOME}" https://healthchecks.{{ .host.domain }}/ping/{{ .host.autoresticHealthcheckUuid }}/start'
failure:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Autorestic User Home Folder ${AUTORESTIC_LOCATION} BEFORE / Host: ${HOST} / User: ${USER} / Home: ${HOME}" https://healthchecks.{{ .host.domain }}/ping/{{ .host.autoresticHealthcheckUuid }}/fail'
success:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Autorestic User Home Folder ${AUTORESTIC_LOCATION} BEFORE / Host: ${HOST} / User: ${USER} / Home: ${HOME}" https://healthchecks.{{ .host.domain }}/ping/{{ .host.autoresticHealthcheckUuid }}'
options:
backup:
exclude:
- .local
- .venv
- node_modules
- venv
- Library
tag:
- user
forget:
keep-hourly: 24
keep-daily: 7
keep-weekly: 14
keep-monthly: 3
keep-yearly: 2
locations:
altair:
from: "{{ env "ALTAIR_APPDATA" }}"
<<: *app
android-studio:
from: "{{ env "ANDROID_STUDIO_APPDATA" }}"
<<: *app
brave-browser:
from: "{{ env "BRAVE_BROWSER_APPDATA" }}"
<<: *app
ferdium:
from: "{{ env "FERDIUM_APPDATA" }}"
<<: *app
firefox:
from: "{{ env "FIREFOX_APPDATA" }}"
<<: *app
google-chrome:
from: "{{ env "GOOGLE_CHROME_APPDATA" }}"
<<: *app
logi-options-plus:
from: "{{ env "LOGI_OPTIONS_PLUS_APPDATA" }}"
<<: *app
mailspring:
from: "{{ env "MAILSPRING_APPDATA" }}"
<<: *app
mark-text:
from: "{{ env "MARK_TEXT_APPDATA" }}"
<<: *app
microsoft-edge:
from: "{{ env "MICROSOFT_EDGE_APPDATA" }}"
<<: *app
notion:
from: "{{ env "NOTION_APPDATA" }}"
<<: *app
pieces-os:
from: "{{ env "PIECES_OS_APPDATA" }}"
<<: *app
remmina:
from: "{{ env "REMMINA_APPDATA" }}"
<<: *app
tor-browser:
from: "{{ env "TOR_BROWSER_APPDATA" }}"
<<: *app
warp-terminal:
from: "{{ env "WARP_TERMINAL_APPDATA" }}"
<<: *app
home-local:
from: ~/
to: home-local
cron: '0/15 * * * *'
<<: *user
home-s3:
from: ~/
to: home-s3
cron: '0 * * * *'
<<: *user
backends:
apps-local:
type: local
path: /var/local/backups/user/{{ .user.username }}/apps
key: {{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "RESTIC_PASSWORD")) }}{{ includeTemplate "secrets/RESTIC_PASSWORD" | decrypt | trim }}{{ else }}{{ default "" (env "RESTIC_PASSWORD") }}{{ end }}
apps-s3:
type: s3
path: {{ .user.cloudflare.r2 }}.r2.cloudflarestorage.com/user/{{ .user.username }}/Backups/apps
key: {{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "RESTIC_PASSWORD")) }}{{ includeTemplate "secrets/RESTIC_PASSWORD" | decrypt | trim }}{{ else }}{{ default "" (env "RESTIC_PASSWORD") }}{{ end }}
env:
AWS_ACCESS_KEY_ID: {{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID_USER")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_ID_USER" | decrypt | trim }}{{ else }}{{ default "" (env "CLOUDFLARE_R2_ID_USER") }}{{ end }}
AWS_SECRET_ACCESS_KEY: {{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET_USER")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_SECRET_USER" | decrypt | trim }}{{ else }}{{ default "" (env "CLOUDFLARE_R2_SECRET_USER") }}{{ end }}
home-local:
type: local
path: /var/local/backups/user/{{ .user.username }}/home
key: {{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "RESTIC_PASSWORD")) }}{{ includeTemplate "secrets/RESTIC_PASSWORD" | decrypt | trim }}{{ else }}{{ default "" (env "RESTIC_PASSWORD") }}{{ end }}
home-s3:
type: s3
path: {{ .user.cloudflare.r2 }}.r2.cloudflarestorage.com/user/{{ .user.username }}/Backups/home
key: {{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "RESTIC_PASSWORD")) }}{{ includeTemplate "secrets/RESTIC_PASSWORD" | decrypt | trim }}{{ else }}{{ default "" (env "RESTIC_PASSWORD") }}{{ end }}
env:
AWS_ACCESS_KEY_ID: {{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID_USER")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_ID_USER" | decrypt | trim }}{{ else }}{{ default "" (env "CLOUDFLARE_R2_ID_USER") }}{{ end }}
AWS_SECRET_ACCESS_KEY: {{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET_USER")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_SECRET_USER" | decrypt | trim }}{{ else }}{{ default "" (env "CLOUDFLARE_R2_SECRET_USER") }}{{ end }}