2019-04-15 15:25:42 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
repository = os.environ['RESTIC_REPOSITORY']
|
|
|
|
password = os.environ['RESTIC_PASSWORD']
|
2019-04-15 17:49:57 +00:00
|
|
|
docker_base_url = os.environ.get('DOCKER_BASE_URL') or "unix://tmp/docker.sock"
|
2019-04-15 15:25:42 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def check(cls):
|
|
|
|
if not cls.repository:
|
|
|
|
raise ValueError("CONTAINER env var not set")
|
|
|
|
|
|
|
|
if not cls.password:
|
|
|
|
raise ValueError("PASSWORD env var not set")
|