diff --git a/.gitignore b/.gitignore index 6d35582..7db414f 100644 --- a/.gitignore +++ b/.gitignore @@ -207,5 +207,3 @@ tags [._]*.un~ # End of https://www.toptal.com/developers/gitignore/api/vim,venv,python - -community_backup/community_backup/configuration.py diff --git a/community_backup/community_backup/settings.py b/community_backup/community_backup/settings.py index 8b45b50..8311aa3 100644 --- a/community_backup/community_backup/settings.py +++ b/community_backup/community_backup/settings.py @@ -128,7 +128,6 @@ STATIC_URL = "static/" TASKS = {"default": {"BACKEND": "django.tasks.backends.immediate.ImmediateBackend"}} -STATIC_ROOT = BASE_DIR.parent.parent / "static" # Import settings from configuration.py try: @@ -140,13 +139,6 @@ try: assert module.BACKUP_HOME_DIR, "The BACKUP_HOME_DIR setting is required." assert module.BACKUP_BORG_DIR, "The BACKUP_BORG_DIR setting is required." assert module.BACKUP_AUTHORIZED_KEYS, "The BACKUP_AUTHORIZED_KEYS setting is required." - except ModuleNotFoundError: print(f"could not find configuration file {config_module}") exit(1) - -BACKUP_USER = module.BACKUP_USER -BACKUP_REPO_HOST = module.BACKUP_REPO_HOST -BACKUP_HOME_DIR = module.BACKUP_HOME_DIR -BACKUP_BORG_DIR = module.BACKUP_BORG_DIR -BACKUP_AUTHORIZED_KEYS = module.BACKUP_AUTHORIZED_KEYS diff --git a/community_backup/webui/deployments.py b/community_backup/webui/deployments.py index b56d1bc..0f1c9bd 100644 --- a/community_backup/webui/deployments.py +++ b/community_backup/webui/deployments.py @@ -16,11 +16,13 @@ def sync_repos(dry_run=False): from .models import BorgRepository repos = BorgRepository.objects.all() + print(repos) repos_by_key = defaultdict(list) for repo in repos: repos_by_key[repo.key].append(repo) + print(repos) # create .ssh directory ssh_dir = settings.BACKUP_AUTHORIZED_KEYS.parent if not dry_run: @@ -43,8 +45,10 @@ def sync_repos(dry_run=False): if not dry_run: authorized_keys.write_text("\n".join(commands) + "\n") + print(repos) # remove repositories that do no longer exist repo_paths = {repo.path for repo in repos} + print(repo_paths) for user_dir in settings.BACKUP_BORG_DIR.iterdir(): print(user_dir) for dir in user_dir.iterdir(): diff --git a/community_backup/webui/templates/base.html b/community_backup/webui/templates/base.html index ffa2b06..30bc23c 100644 --- a/community_backup/webui/templates/base.html +++ b/community_backup/webui/templates/base.html @@ -48,7 +48,13 @@
Create a borg repository by specifying a name and the SSH public key that is allowed to access this repository. The name is only for your convenience. To set up the repository please follow the BorgBackup documentation. There is also a Quick start guide available. - Always use encrypted backups!
-This is a service offering space for backups free of charge. This is a hobby project. It comes with no garantuees for anything, especially availability of the service. This service is in a testing phase at the moment. It might be unavailalbe at times and features might change quickly.
-Currently this service offers only backups via Borg Backup.
-To access this service you need an account. To register for an account you need a voucher. Vouchers are required to control the amount of users, so that there is enough space available for everyone.
-