aboutsummaryrefslogtreecommitdiff
path: root/app/cryptpad/deploy/backup.hcl
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-08-24 15:42:47 +0200
committerAlex Auvolat <alex@adnab.me>2022-08-24 15:42:47 +0200
commit2e8923b383eb06c53261eee8e5c442b857fb67e4 (patch)
tree0ad148f75f7b54dfed2dbac8f43f6df9badc502a /app/cryptpad/deploy/backup.hcl
parent9848f3090f77363a2fda0f9fa673ebcf1fb8228c (diff)
downloadnixcfg-2e8923b383eb06c53261eee8e5c442b857fb67e4.tar.gz
nixcfg-2e8923b383eb06c53261eee8e5c442b857fb67e4.zip
Move app files into cluster subdirectories; add prod garage
Diffstat (limited to 'app/cryptpad/deploy/backup.hcl')
-rw-r--r--app/cryptpad/deploy/backup.hcl57
1 files changed, 0 insertions, 57 deletions
diff --git a/app/cryptpad/deploy/backup.hcl b/app/cryptpad/deploy/backup.hcl
deleted file mode 100644
index 99dee2f..0000000
--- a/app/cryptpad/deploy/backup.hcl
+++ /dev/null
@@ -1,57 +0,0 @@
-job "cryptpad_backup" {
- datacenters = ["neptune"]
- type = "batch"
-
- priority = "60"
-
- periodic {
- cron = "@daily"
- // Do not allow overlapping runs.
- prohibit_overlap = true
- }
-
- group "backup-cryptpad" {
- constraint {
- attribute = "${attr.unique.hostname}"
- operator = "="
- value = "courgette"
- }
-
- task "main" {
- driver = "docker"
-
- config {
- image = "restic/restic:0.12.1"
- entrypoint = [ "/bin/sh", "-c" ]
- args = [ "restic backup /cryptpad && restic forget --keep-within 1m1d --keep-within-weekly 3m --keep-within-monthly 1y && restic prune --max-unused 50% --max-repack-size 2G && restic check" ]
- volumes = [
- "/mnt/storage/cryptpad:/cryptpad"
- ]
- }
-
- template {
- data = <<EOH
-AWS_ACCESS_KEY_ID={{ key "secrets/cryptpad_backup/backup_aws_access_key_id" }}
-AWS_SECRET_ACCESS_KEY={{ key "secrets/cryptpad_backup/backup_aws_secret_access_key" }}
-RESTIC_REPOSITORY={{ key "secrets/cryptpad_backup/backup_restic_repository" }}
-RESTIC_PASSWORD={{ key "secrets/cryptpad_backup/backup_restic_password" }}
-EOH
-
- destination = "secrets/env_vars"
- env = true
- }
-
- resources {
- cpu = 500
- memory = 200
- }
-
- restart {
- attempts = 2
- interval = "30m"
- delay = "15s"
- mode = "fail"
- }
- }
- }
-}