Backup Secrets #28

Closed
opened 2023-09-21 22:46:18 +00:00 by moritz · 2 comments
Member

There should be a backup of the app secrets as well. If you need to reinitialize the swarm for any reason or want to restore the app on another server the secrets are required. Further you don't need to handle a way to store all the autogenerated secrets locally anymore.

Also somehow related: coop-cloud/organising#480
Unfortunately I couldn't find any other way to access the secrets, than attaching them to a container and reading /var/run/secrets.
Therefore my idea is to attach all secrets of all apps that have the 'backupbot.backup label to the backupbot. Than the secrets can easily be handled by restic.

There should be a backup of the app secrets as well. If you need to reinitialize the swarm for any reason or want to restore the app on another server the secrets are required. Further you don't need to handle a way to store all the autogenerated secrets locally anymore. Also somehow related: https://git.coopcloud.tech/coop-cloud/organising/issues/480 Unfortunately I couldn't find any other way to access the secrets, than attaching them to a container and reading `/var/run/secrets`. Therefore my idea is to attach all secrets of all apps that have the `'backupbot.backup` label to the backupbot. Than the secrets can easily be handled by restic.
moritz self-assigned this 2023-09-21 22:46:18 +00:00
moritz added this to the backupbot revolution project 2023-09-21 22:46:26 +00:00
moritz referenced this issue from a commit 2023-09-21 22:54:32 +00:00
Author
Member

Another approach:
mount /var/lib/docker/containers/ inside the backupbot. So the secrets can be accessed via /var/lib/docker/containers/<container-id>/mounts/secrets.

This solves two problems with attaching the secrets to the backupbot:

  • For every new secret the backupbot needs to be restarted
  • Secrets can not be removed without detaching them again from the backupbot
Another approach: mount `/var/lib/docker/containers/` inside the backupbot. So the secrets can be accessed via `/var/lib/docker/containers/<container-id>/mounts/secrets`. This solves two problems with attaching the secrets to the backupbot: - For every new secret the backupbot needs to be restarted - Secrets can not be removed without detaching them again from the backupbot
Author
Member

New approach: ef9fbda7d0
For each app that is included in the backup the secrets are copied from /var/lib/docker/containers/<container-id>/mounts/secrets/<secret_id> to /secrets/<secret_name> and /secret is included as backup path for restic.

New approach: https://git.coopcloud.tech/coop-cloud/backup-bot-two/commit/ef9fbda7d0b6fb05c40d78a158ec41121574c36e For each app that is included in the backup the secrets are copied from `/var/lib/docker/containers/<container-id>/mounts/secrets/<secret_id>` to `/secrets/<secret_name>` and `/secret` is included as backup path for `restic`.
moritz referenced this issue from a commit 2023-10-04 17:08:58 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/backup-bot-two#28
No description provided.