breaking change: rename env RESTIC_REPO to RESTIC_REPOSITORY

This commit is contained in:
2023-10-24 21:03:44 +02:00
parent 354f964e7d
commit 2ea59b4230
6 changed files with 14 additions and 14 deletions

View File

@ -23,13 +23,13 @@ SERVICE = None
@click.group()
@click.option('-l', '--log', 'loglevel')
@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):
global SERVICE
if service:
SERVICE = service.replace('.', '_')
if repository:
os.environ['RESTIC_REPO'] = repository
os.environ['RESTIC_REPOSITORY'] = repository
if loglevel:
numeric_level = getattr(logging, loglevel.upper(), None)
if not isinstance(numeric_level, int):
@ -40,7 +40,7 @@ def cli(loglevel, service, repository):
def init_repo():
repo = os.environ['RESTIC_REPO']
repo = os.environ['RESTIC_REPOSITORY']
logging.debug(f"set restic repository location: {repo}")
restic.repository = repo
restic.password_file = '/var/run/secrets/restic_password'