Use Fedder's TrueNAS for Restic backups #153
No reviewers
Labels
No labels
Blocked
Existing Service
Infrastructure Issue
Refactor
Security Hardening
Security Issue
Service Idea
Service Removal
Upgrade service
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: data.coop/ansible#153
Loading…
Reference in a new issue
No description provided.
Delete branch "restic_fedder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks Fedder!
Note: This is untested, we can't really test this in Vagrant.
@ -33,3 +34,2 @@
restic_secrets:
user_secret: xxx
encryption_secret: xxx
user_password: xxx
Do we use this?
Actually no, we only used it with Decibyte's Restic server. I'll remove it.
@ -55,0 +53,4 @@
domain: "rynkeby.skovgaard.tel"
volume_folder: "{{ volume_root_folder }}/restic"
repository: "/mnt/SpinningRust/data.coop-backup/restic"
ssh_pubkey: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN1lNLshXytq+mx2LPzm8Neh/nrVqCR3iDXPONzBag9s restic@fedder
Can we derive the pubkey from the privkey in secrets? We have to update the key in two places now.
We probably could, I'll make the change.
@ -2,1 +2,4 @@
---
- name: Create SSH directory
file:
name: "{{ services.restic.volume_folder }}/ssh"
Shouldn't it be
.ssh
? Is{{ services.restic.volume_folder }}
the$HOME
dir of root?No, it evaluates to
/docker-volumes/restic/ssh
. It doesn't need to be in root's$HOME
, and I also think it's better to place it in Restic's folder, since this is the only service that uses it. It also doesn't need to be hidden, since we can bind mount it to a different name inside the container (also this makes it visible with a simplels
).@ -3,0 +3,4 @@
- name: Create SSH directory
file:
name: "{{ services.restic.volume_folder }}/ssh"
owner: root
It's probably correct seeing what most containers do, but we could confirm it's running as root.
It's also possible with this location, since
mode: '0700'
denies read permission for everyone else.@ -14,3 +38,3 @@
RUN_ON_STARTUP: "false"
BACKUP_CRON: "0 30 3 * * *"
RESTIC_REPOSITORY: "rest:https://{{ services.restic.user }}:{{ restic_secrets.user_password }}@{{ services.restic.domain }}/{{ services.restic.repository }}"
RESTIC_REPOSITORY: "sftp:{{ services.restic.user }}@{{ services.restic.domain }}:{{ services.restic.repository }}"
Isn't sftp urls
sftp://user@host/path/from/root
?No, the URL format is actually
sftp://user@host[:port]//path/from/root
(double slash) orsftp://user@host[:port]/relative/path/to/home
, but Restic only requires the URL format in case of a specified port number or an IPv6 address. If not, it only wants thesftp:
prefix, followed by the format you would use withscp
,sftp:user@host:/path/to/repo
.https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp
@ -35,3 +60,3 @@
RUN_ON_STARTUP: "false"
PRUNE_CRON: "0 0 4 * * *"
RESTIC_REPOSITORY: "rest:https://{{ services.restic.user }}:{{ restic_secrets.user_password }}@{{ services.restic.domain }}/{{ services.restic.repository }}"
RESTIC_REPOSITORY: "sftp:{{ services.restic.user }}@{{ services.restic.domain }}:{{ services.restic.repository }}"
Same comment as above regarding sftp urls.
I also added an SSH config file. From the Restic docs:
User Fedder's TrueNAS for Restic backupsto Use Fedder's TrueNAS for Restic backups