1 Commits

Author SHA1 Message Date
cd89800fd4 feat: Adds a command to setup the restic repository in s3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-05 16:21:31 +01:00
2 changed files with 15 additions and 3 deletions

View File

@ -49,15 +49,23 @@ The backup location can be changed using the `RESTIC_REPOSITORY` env variable.
### S3 Storage
To use S3 storage as backup location set the following envs:
1. To use S3 storage as backup location set the following envs:
```
RESTIC_REPOSITORY=s3:<S3-SERVICE-URL>/<BUCKET-NAME>
SECRET_AWS_SECRET_ACCESS_KEY_VERSION=v1
AWS_ACCESS_KEY_ID=<MY_ACCESS_KEY>
COMPOSE_FILE="$COMPOSE_FILE:compose.s3.yml"
```
and add your `<SECRET_ACCESS_KEY>` as docker secret:
`abra app secret insert <backupbot_name> aws_secret_access_key v1 <SECRET_ACCESS_KEY>`
2. and add your `<SECRET_ACCESS_KEY>` as docker secret:
```
abra app secret insert <backupbot_name> aws_secret_access_key v1 <SECRET_ACCESS_KEY>
```
3. Intialze you restic repository:
```
abra app cmd --chaos <backup_name> app setup_restic_s3
```
See [restic s3 docs](https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#amazon-s3) for more information.

View File

@ -8,3 +8,7 @@ run_cron () {
while [ ! -f /tmp/backup.log ]; do sleep 1; done
echo "$schedule $(crontab -l | tr -s " " | cut -d ' ' -f6-)" | crontab -
}
setup_restic_s3() {
AWS_SECRET_ACCESS_KEY=$(cat /run/secrets/aws_secret_access_key) restic -r $RESTIC_REPOSITORY init
}