From 2e8923b383eb06c53261eee8e5c442b857fb67e4 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 24 Aug 2022 15:42:47 +0200 Subject: Move app files into cluster subdirectories; add prod garage --- cluster/prod/app/cryptpad/deploy/backup.hcl | 57 ++++++++++++++++++++ cluster/prod/app/cryptpad/deploy/cryptpad.hcl | 75 +++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 cluster/prod/app/cryptpad/deploy/backup.hcl create mode 100644 cluster/prod/app/cryptpad/deploy/cryptpad.hcl (limited to 'cluster/prod/app/cryptpad/deploy') diff --git a/cluster/prod/app/cryptpad/deploy/backup.hcl b/cluster/prod/app/cryptpad/deploy/backup.hcl new file mode 100644 index 0000000..99dee2f --- /dev/null +++ b/cluster/prod/app/cryptpad/deploy/backup.hcl @@ -0,0 +1,57 @@ +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 = <