Backupbot Specification #258

Merged
decentral1se merged 8 commits from p4u1/docs.coopcloud.tech:backupbottwo-spec into main 2024-10-29 08:04:39 +00:00
Showing only changes of commit 40db4e79f7 - Show all commits

View File

@ -10,12 +10,12 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S
## Backup
p4u1 marked this conversation as resolved
Review

Maybe remove this, seems the same as line 15 "To enable backups"

Maybe remove this, seems the same as line 15 "To enable backups"
To enable backups for a docker stack, the `backupbot.backup=true` label MUST be on any of its services. It SHOULD be declared on the first service. The label MUST be only set once. When the label is set multiple times, the implementation SHOULD show an error.
To enable backups for a docker stack, the `backupbot.backup=true` label MUST be set on one of its services. The label MUST NOT be set multiple times for a docker stack. Otherwise the implementation MUST show an error. The label SHOULD be declared on the main service.
### Volumes and paths

Is the behaviour defined if one service sets backupbot.backup=true and another sets it to backupbot.backup=false?

Is the behaviour defined if one service sets `backupbot.backup=true` and another sets it to `backupbot.backup=false`?
By default all volumes MUST be backed up. A volume MUST be excluded from the backup when `backupbot.backup.volumes.{volume_name}=false` is set, where `{volume_name}` is the name of the volume.
By default all files MUST be backed up on a volume. `backupbot.backup.volumes.{volume_name}.path` MAY be set to limit the paths for that volume. The value MUST be a valid path relative to the volume root. It MAY contain multiple paths which get separated by a comma.
By default all files MUST be backed up on a volume. `backupbot.backup.volumes.{volume_name}.path` MAY be set to limit the paths for that volume. The value MUST be a valid path relative to the volume root. It MAY contain multiple paths which get separated by a comma. When the label is set only the given paths MUST be backed up.
3wordchant marked this conversation as resolved
Review

So the spec allows backing up a volume even if ...{volume_name}=false? Is there any harm in changing this to "MUST"?

So the spec allows backing up a volume even if `...{volume_name}=false`? Is there any harm in changing this to "MUST"?
Review

Changed it to "MUST"

Changed it to "MUST"
### Pre/Post Hooks
@ -26,11 +26,11 @@ TODO: escaping
### Output
decentral1se marked this conversation as resolved
Review

I think {volume_name} can be confusing in this case. Because in backupbot.backup.volumes.{volume_name}.path the {volume_name} would be for example assets, while in the path /var/lib/docker/volumes/{volume_name} it would be appname_example_com_assets.
Maybe writing /var/lib/docker/volumes/{stack_name}_{volume_name} would clearer.

I think `{volume_name}` can be confusing in this case. Because in `backupbot.backup.volumes.{volume_name}.path` the `{volume_name}` would be for example `assets`, while in the path `/var/lib/docker/volumes/{volume_name}` it would be `appname_example_com_assets`. Maybe writing `/var/lib/docker/volumes/{stack_name}_{volume_name}` would clearer.
A backup implementation SHOULD provide the backup of one or multiple stacks in a `.tar.gz` format. In that case each volume MUST be in `/var/lib/docker/volumes/{volume_name}`, where `{volume_name}` is the name of each volume that got backed up.
A backup implementation SHOULD provide the backup of one or multiple stacks in a `.tar.gz` format. In that case each volume MUST be in `/var/lib/docker/volumes/{stack_name}_{volume_name}`, where `{stack_name}` is the name of the docker stack and `{volume_name}` is the name of each volume that got backed up.
## Restore
By default all files MUST be restored into their volume. A volume or path MAY be excluded from restoring. When restoring a backup from a `.tar.gz` it expects the directory layout as described int the [backup output](#output) section.
By default all files MUST be restored into their volume. A volume or path MAY be excluded from restoring. When restoring a backup from a `.tar.gz` it expects the directory layout as described in the [backup output](#output) section.
### Pre/Post Hooks