Compare commits
No commits in common. "95fde8e58f97132397ba985c425942ddc218a15e" and "d0b7158423740e099a4e56cf741fc33d892e2b0a" have entirely different histories.
95fde8e58f
...
d0b7158423
8 changed files with 4 additions and 87 deletions
30
README.md
30
README.md
|
|
@ -78,14 +78,6 @@ Create a superuser account
|
|||
|
||||
```
|
||||
|
||||
### Repository Quota Updates
|
||||
|
||||
The repository quotas in the UI are updated after each backup.
|
||||
To update the quota during an operation the `update_used_quota` management command can be executed on a regular basis.
|
||||
|
||||
There are example configs for systemd-timers in `contrib/communitybackup-quota-update.service` and `contrib/communitybackup-quota-update.timer`. Adjust the paths and the timers to your needs.
|
||||
|
||||
|
||||
## Custom pages
|
||||
|
||||
Some pages are specific to your installation. E.g. an imprint.
|
||||
|
|
@ -154,25 +146,3 @@ Django debug setting.
|
|||
```python
|
||||
ADDITIONAL_FOOTER_NAV_ITEMS = ["""<a class="nav-link" href="https://example.com/>Example Link</a>""",]
|
||||
```
|
||||
|
||||
### BORG_SERVER_PUBKEYS
|
||||
|
||||
A list of the SSH public keys and their hashes to verify the server a User is connecting to.
|
||||
This is a list of tuples, containing the key and it's hash.
|
||||
|
||||
```python
|
||||
BORG_SERVER_PUBKEYS = [
|
||||
(
|
||||
"ecdsa-sha2-nistp256 AAAAASDJIASKJDASD root@example.com",
|
||||
"256 SHA256:sTbOK9NvP1uUEixgUT8KUiYrY8J/DbK+jR39lwcT8Zw root@example.com (ECDSA)",
|
||||
),
|
||||
(
|
||||
"ssh-ed25519 AAAAasdiwdkjasdijwklajsdijasd root@example.com",
|
||||
"256 SHA256:hPbWwRxNr1mFHZKYjcysnay1cQGQsOmDBvkA3Pzo4YY root@example.com (ED25519)",
|
||||
),
|
||||
(
|
||||
"ssh-rsa AAAABasdlkjasdiualksjd root@example.com",
|
||||
"3072 SHA256:deuPTR8Hcc1LP7DHqAp91EINdLBQoco2IeMldIahamQ root@example.com (RSA)",
|
||||
),
|
||||
]
|
||||
```
|
||||
|
|
|
|||
|
|
@ -6,14 +6,7 @@ def release_version(_request):
|
|||
"RELEASE_VERSION": settings.RELEASE_VERSION,
|
||||
}
|
||||
|
||||
|
||||
def additional_footer_nav_items(_request):
|
||||
return {
|
||||
"ADDITIONAL_FOOTER_NAV_ITEMS": settings.ADDITIONAL_FOOTER_NAV_ITEMS,
|
||||
}
|
||||
|
||||
|
||||
def borg_server_pubkeys(_request):
|
||||
return {
|
||||
"BORG_SERVER_PUBKEYS": settings.BORG_SERVER_PUBKEYS,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,18 +22,3 @@ SECRET_KEY = "change me!"
|
|||
|
||||
MARKDOWN_PAGE_DIR = Path("./custom_md/")
|
||||
BACKUP_MANAGE_PY = Path("/path/to/venv/bin/python /path/to/community_backup/manage.py")
|
||||
|
||||
# BORG_SERVER_PUBKEYS = [
|
||||
# (
|
||||
# "ecdsa-sha2-nistp256 AAAAASDJIASKJDASD root@example.com",
|
||||
# "256 SHA256:sTbOK9NvP1uUEixgUT8KUiYrY8J/DbK+jR39lwcT8Zw root@example.com (ECDSA)",
|
||||
# ),
|
||||
# (
|
||||
# "ssh-ed25519 AAAAasdiwdkjasdijwklajsdijasd root@example.com",
|
||||
# "256 SHA256:hPbWwRxNr1mFHZKYjcysnay1cQGQsOmDBvkA3Pzo4YY root@example.com (ED25519)",
|
||||
# ),
|
||||
# (
|
||||
# "ssh-rsa AAAABasdlkjasdiualksjd root@example.com",
|
||||
# "3072 SHA256:deuPTR8Hcc1LP7DHqAp91EINdLBQoco2IeMldIahamQ root@example.com (RSA)",
|
||||
# ),
|
||||
# ]
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ TEMPLATES = [
|
|||
"django.contrib.messages.context_processors.messages",
|
||||
"community_backup.context_processors.release_version",
|
||||
"community_backup.context_processors.additional_footer_nav_items",
|
||||
"community_backup.context_processors.borg_server_pubkeys",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
@ -151,4 +150,3 @@ BACKUP_MANAGE_PY = module.BACKUP_MANAGE_PY
|
|||
|
||||
DEBUG = getattr(module, "DEBUG", False)
|
||||
ADDITIONAL_FOOTER_NAV_ITEMS = getattr(module, "ADDITIONAL_FOOTER_NAV_ITEMS", list())
|
||||
BORG_SERVER_PUBKEYS = getattr(module, "BORG_SERVER_PUBKEYS", list())
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Update the used quota
|
||||
|
||||
[Service]
|
||||
User=borg
|
||||
Group=borg
|
||||
WorkingDirectory=/opt/community_backup/community-backup/community_backup/
|
||||
ExecStart=/opt/community_backup/venv/bin/python manage.py update_used_quota
|
||||
PrivateTmp=true
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Update the used quota on a regular basis
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* *:0/5:00
|
||||
RandomizedDelaySec=120
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
|
@ -10,6 +10,8 @@ class Command(BaseCommand):
|
|||
parser.add_argument("--repository-id", type=int, nargs="+")
|
||||
|
||||
def handle(self, *args, **options):
|
||||
print(options)
|
||||
|
||||
qs = BorgRepository.objects.all()
|
||||
|
||||
if options.get("user_id"):
|
||||
|
|
@ -18,6 +20,8 @@ class Command(BaseCommand):
|
|||
if options.get("repository_id"):
|
||||
qs = qs.filter(pk__in=options.get("repository_id"))
|
||||
|
||||
print(qs)
|
||||
|
||||
for repo in qs:
|
||||
repo.refresh_quota()
|
||||
|
||||
|
|
|
|||
|
|
@ -35,21 +35,6 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if BORG_SERVER_PUBKEYS %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>Borg Server Public Keys</h4>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for key, fingerprint in BORG_SERVER_PUBKEYS %}
|
||||
<li class="list-group-item">
|
||||
<span style="word-break: break-all"><code>{{ key }}</code></span><br>
|
||||
<span style="word-break: break-all"><code>{{ fingerprint }}</code></span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue