breaking change: rename env RESTIC_REPO to RESTIC_REPOSITORY
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
354f964e7d
commit
2ea59b4230
|
@ -4,7 +4,7 @@ SECRET_RESTIC_PASSWORD_VERSION=v1
|
||||||
|
|
||||||
COMPOSE_FILE=compose.yml
|
COMPOSE_FILE=compose.yml
|
||||||
|
|
||||||
RESTIC_REPO=/backups/restic
|
RESTIC_REPOSITORY=/backups/restic
|
||||||
|
|
||||||
CRON_SCHEDULE='30 3 * * *'
|
CRON_SCHEDULE='30 3 * * *'
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ CRON_SCHEDULE='30 3 * * *'
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.s3.yml"
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.s3.yml"
|
||||||
|
|
||||||
# Secret restic repository
|
# Secret restic repository
|
||||||
# use a secret to store the RESTIC_REPO if the repository location contains a secret value
|
# use a secret to store the RESTIC_REPOSITORY if the repository location contains a secret value
|
||||||
# i.E rest:https://user:SECRET_PASSWORD@host:8000/
|
# i.E rest:https://user:SECRET_PASSWORD@host:8000/
|
||||||
# it overwrites the RESTIC_REPO variable
|
# it overwrites the RESTIC_REPOSITORY variable
|
||||||
#SECRET_RESTIC_REPO_VERSION=v1
|
#SECRET_RESTIC_REPO_VERSION=v1
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.secret.yml"
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.secret.yml"
|
||||||
|
|
10
README.md
10
README.md
|
@ -45,13 +45,13 @@ Backupbot II tries to help, by
|
||||||
|
|
||||||
Per default Backupbot stores the backups locally in the repository `/backups/restic`, which is accessible as volume at `/var/lib/docker/volumes/<app_name>_backups/_data/restic/`
|
Per default Backupbot stores the backups locally in the repository `/backups/restic`, which is accessible as volume at `/var/lib/docker/volumes/<app_name>_backups/_data/restic/`
|
||||||
|
|
||||||
The backup location can be changed using the `RESTIC_REPO` env variable.
|
The backup location can be changed using the `RESTIC_REPOSITORY` env variable.
|
||||||
|
|
||||||
### S3 Storage
|
### S3 Storage
|
||||||
|
|
||||||
To use S3 storage as backup location set the following envs:
|
To use S3 storage as backup location set the following envs:
|
||||||
```
|
```
|
||||||
RESTIC_REPO=s3:<S3-SERVICE-URL>/<BUCKET-NAME>
|
RESTIC_REPOSITORY=s3:<S3-SERVICE-URL>/<BUCKET-NAME>
|
||||||
SECRET_AWS_SECRET_ACCESS_KEY_VERSION=v1
|
SECRET_AWS_SECRET_ACCESS_KEY_VERSION=v1
|
||||||
AWS_ACCESS_KEY_ID=<MY_ACCESS_KEY>
|
AWS_ACCESS_KEY_ID=<MY_ACCESS_KEY>
|
||||||
COMPOSE_FILE="$COMPOSE_FILE:compose.s3.yml"
|
COMPOSE_FILE="$COMPOSE_FILE:compose.s3.yml"
|
||||||
|
@ -67,7 +67,7 @@ See [restic s3 docs](https://restic.readthedocs.io/en/latest/030_preparing_a_new
|
||||||
|
|
||||||
To use SFTP storage as backup location set the following envs:
|
To use SFTP storage as backup location set the following envs:
|
||||||
```
|
```
|
||||||
RESTIC_REPO=sftp:user@host:/restic-repo-path
|
RESTIC_REPOSITORY=sftp:user@host:/restic-repo-path
|
||||||
SECRET_SSH_KEY_VERSION=v1
|
SECRET_SSH_KEY_VERSION=v1
|
||||||
SSH_HOST_KEY="hostname ssh-rsa AAAAB3...
|
SSH_HOST_KEY="hostname ssh-rsa AAAAB3...
|
||||||
COMPOSE_FILE="$COMPOSE_FILE:compose.ssh.yml"
|
COMPOSE_FILE="$COMPOSE_FILE:compose.ssh.yml"
|
||||||
|
@ -85,7 +85,7 @@ abra app secret insert <app_name> ssh_key v1 """$(cat backupkey)
|
||||||
|
|
||||||
### Restic REST server Storage
|
### Restic REST server Storage
|
||||||
|
|
||||||
You can simply set the `RESTIC_REPO` variable to your REST server URL `rest:http://host:8000/`.
|
You can simply set the `RESTIC_REPOSITORY` variable to your REST server URL `rest:http://host:8000/`.
|
||||||
If you access the REST server with a password `rest:https://user:pass@host:8000/` you should hide the whole URL containing the password inside a secret.
|
If you access the REST server with a password `rest:https://user:pass@host:8000/` you should hide the whole URL containing the password inside a secret.
|
||||||
Uncomment these lines:
|
Uncomment these lines:
|
||||||
```
|
```
|
||||||
|
@ -96,7 +96,7 @@ Add your REST server url as secret:
|
||||||
```
|
```
|
||||||
`abra app secret insert <app_name> restic_repo v1 "rest:https://user:pass@host:8000/"`
|
`abra app secret insert <app_name> restic_repo v1 "rest:https://user:pass@host:8000/"`
|
||||||
```
|
```
|
||||||
The secret will overwrite the `RESTIC_REPO` variable.
|
The secret will overwrite the `RESTIC_REPOSITORY` variable.
|
||||||
|
|
||||||
|
|
||||||
See [restic REST docs](https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) for more information.
|
See [restic REST docs](https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) for more information.
|
||||||
|
|
|
@ -23,13 +23,13 @@ SERVICE = None
|
||||||
@click.group()
|
@click.group()
|
||||||
@click.option('-l', '--log', 'loglevel')
|
@click.option('-l', '--log', 'loglevel')
|
||||||
@click.option('service', '--host', '-h', envvar='SERVICE')
|
@click.option('service', '--host', '-h', envvar='SERVICE')
|
||||||
@click.option('repository', '--repo', '-r', envvar='RESTIC_REPO', required=True)
|
@click.option('repository', '--repo', '-r', envvar='RESTIC_REPOSITORY', required=True)
|
||||||
def cli(loglevel, service, repository):
|
def cli(loglevel, service, repository):
|
||||||
global SERVICE
|
global SERVICE
|
||||||
if service:
|
if service:
|
||||||
SERVICE = service.replace('.', '_')
|
SERVICE = service.replace('.', '_')
|
||||||
if repository:
|
if repository:
|
||||||
os.environ['RESTIC_REPO'] = repository
|
os.environ['RESTIC_REPOSITORY'] = repository
|
||||||
if loglevel:
|
if loglevel:
|
||||||
numeric_level = getattr(logging, loglevel.upper(), None)
|
numeric_level = getattr(logging, loglevel.upper(), None)
|
||||||
if not isinstance(numeric_level, int):
|
if not isinstance(numeric_level, int):
|
||||||
|
@ -40,7 +40,7 @@ def cli(loglevel, service, repository):
|
||||||
|
|
||||||
|
|
||||||
def init_repo():
|
def init_repo():
|
||||||
repo = os.environ['RESTIC_REPO']
|
repo = os.environ['RESTIC_REPOSITORY']
|
||||||
logging.debug(f"set restic repository location: {repo}")
|
logging.debug(f"set restic repository location: {repo}")
|
||||||
restic.repository = repo
|
restic.repository = repo
|
||||||
restic.password_file = '/var/run/secrets/restic_password'
|
restic.password_file = '/var/run/secrets/restic_password'
|
||||||
|
|
|
@ -3,7 +3,7 @@ version: "3.8"
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
environment:
|
environment:
|
||||||
- RESTIC_REPO_FILE=/run/secrets/restic_repo
|
- RESTIC_REPOSITORY_FILE=/run/secrets/restic_repo
|
||||||
secrets:
|
secrets:
|
||||||
- restic_repo
|
- restic_repo
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ services:
|
||||||
- backups:/backups
|
- backups:/backups
|
||||||
environment:
|
environment:
|
||||||
- CRON_SCHEDULE
|
- CRON_SCHEDULE
|
||||||
- RESTIC_REPO
|
- RESTIC_REPOSITORY
|
||||||
- RESTIC_PASSWORD_FILE=/run/secrets/restic_password
|
- RESTIC_PASSWORD_FILE=/run/secrets/restic_password
|
||||||
secrets:
|
secrets:
|
||||||
- restic_password
|
- restic_password
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Breaking Change: the variables `SERVER_NAME` and `RESTIC_HOST` are merged into `RESTIC_REPO`. The format can be looked up here: https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html
|
Breaking Change: the variables `SERVER_NAME` and `RESTIC_HOST` are merged into `RESTIC_REPOSITORY`. The format can be looked up here: https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html
|
||||||
ssh/sftp: `sftp:user@host:/repo-path`
|
ssh/sftp: `sftp:user@host:/repo-path`
|
||||||
S3: `s3:https://s3.example.com/bucket_name`
|
S3: `s3:https://s3.example.com/bucket_name`
|
||||||
|
|
Loading…
Reference in New Issue