mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
add borgbackup-viewer community container
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
c19ba34cdf
commit
7468386397
5 changed files with 103 additions and 3 deletions
|
|
@ -0,0 +1,70 @@
|
||||||
|
{
|
||||||
|
"aio_services_v1": [
|
||||||
|
{
|
||||||
|
"container_name": "nextcloud-aio-borgbackup-viewer",
|
||||||
|
"image_tag": "v1",
|
||||||
|
"display_name": "Borg Backup Viewer",
|
||||||
|
"documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer",
|
||||||
|
"image": "szaimen/aio-borgbackup-viewer",
|
||||||
|
"internal_port": "5801",
|
||||||
|
"ports": [
|
||||||
|
{
|
||||||
|
"ip_binding": "",
|
||||||
|
"port_number": "5801",
|
||||||
|
"protocol": "tcp"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"environment": [
|
||||||
|
"BORG_HOST_ID=nextcloud-aio-borgbackup-viewer",
|
||||||
|
"WEB_AUTHENTICATION_USERNAME=nextcloud",
|
||||||
|
"WEB_AUTHENTICATION_PASSWORD=%BORGBACKUP_VIEWER_PASSWORD%",
|
||||||
|
"WEB_LISTENING_PORT=5801",
|
||||||
|
"BORG_PASSPHRASE=%BORGBACKUP_PASSWORD%",
|
||||||
|
"BORG_REPO=/mnt/borgbackup/borg"
|
||||||
|
],
|
||||||
|
"secrets": [
|
||||||
|
"BORGBACKUP_VIEWER_PASSWORD",
|
||||||
|
"BORGBACKUP_PASSWORD"
|
||||||
|
],
|
||||||
|
"volumes": [
|
||||||
|
{
|
||||||
|
"source": "nextcloud_aio_backup_cache",
|
||||||
|
"destination": "/root",
|
||||||
|
"writeable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "%NEXTCLOUD_DATADIR%",
|
||||||
|
"destination": "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data",
|
||||||
|
"writeable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "nextcloud_aio_mastercontainer",
|
||||||
|
"destination": "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer",
|
||||||
|
"writeable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "%BORGBACKUP_HOST_LOCATION%",
|
||||||
|
"destination": "/mnt/borgbackup",
|
||||||
|
"writeable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "nextcloud_aio_elasticsearch",
|
||||||
|
"destination": "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch",
|
||||||
|
"writeable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "nextcloud_aio_redis",
|
||||||
|
"destination": "/mnt/redis",
|
||||||
|
"writeable": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"devices": [
|
||||||
|
"/dev/fuse"
|
||||||
|
],
|
||||||
|
"cap_add": [
|
||||||
|
"SYS_ADMIN"
|
||||||
|
],
|
||||||
|
"apparmor_unconfined": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
17
community-containers/borgbackup-viewer/readme.md
Normal file
17
community-containers/borgbackup-viewer/readme.md
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
## Borgbackup Viewer
|
||||||
|
This container allows to view the local borg repository in a web session. It also allows you to restore files and folders from the backup by using desktop programs in a web browser.
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
- After adding and starting the container, you need to visit `https://ip.address.of.this.server:5801` in order to log in with the user `nextcloud` and the password that you can retrieve when running `sudo docker inspect nextcloud-aio-borgbackup-viewer | grep WEB_AUTHENTICATION_PASSWORD`. (It uses a self-signed certificate, so you need to accept the warning).
|
||||||
|
- Then, you should see a terminal. There type in `borg mount /mnt/borgbackup/borg /tmp/borg` to mount the backup archive at `/tmp/borg` inside the container. Afterwards type in `nautilus /tmp/borg` which will show a file explorer and allows you to see all the files. You can then copy files and folders back to their initial mountpoints inside `/nextcloud_aio_volumes/`, `/host_mounts/` and `/docker_volumes/`. ⚠️ Be very carefully while doing that as can break your instance!
|
||||||
|
- After you are done with the operation, click on the terminal in the background and press `[CTRL]+[c]` multiple times to close any open application. Then run `umount /tmp/borg` to unmount the mountpoint correctly.
|
||||||
|
- You can also delete specific archives by running `borg list`, delete a specific archive e.g. via `borg delete --stats --progress "::20220223_174237-nextcloud-aio"` and compact the archives via `borg compact`. After doing so, make sure to update the backup archives list in the AIO interface! You can do so by clicking on the `Check backup integrity` button or `Create backup` button.
|
||||||
|
- ⚠️ After you are done doing your operations, remove the container for better security again from the stack: https://github.com/nextcloud/all-in-one/tree/main/community-containers#how-to-remove-containers-from-aios-stack
|
||||||
|
- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack
|
||||||
|
|
||||||
|
### Repository
|
||||||
|
https://github.com/szaimen/aio-borgbackup-viewer
|
||||||
|
|
||||||
|
### Maintainer
|
||||||
|
https://github.com/szaimen
|
||||||
|
|
||||||
|
|
@ -541,19 +541,23 @@ readonly class DockerActionManager {
|
||||||
$mounts = [];
|
$mounts = [];
|
||||||
|
|
||||||
// Special things for the backup container which should not be exposed in the containers.json
|
// Special things for the backup container which should not be exposed in the containers.json
|
||||||
if ($container->GetIdentifier() === 'nextcloud-aio-borgbackup') {
|
if (str_starts_with($container->GetIdentifier(), 'nextcloud-aio-borgbackup')) {
|
||||||
// Additional backup directories
|
// Additional backup directories
|
||||||
foreach ($this->getAllBackupVolumes() as $additionalBackupVolumes) {
|
foreach ($this->getAllBackupVolumes() as $additionalBackupVolumes) {
|
||||||
if ($additionalBackupVolumes !== '') {
|
if ($additionalBackupVolumes !== '') {
|
||||||
$mounts[] = ["Type" => "volume", "Source" => $additionalBackupVolumes, "Target" => "/nextcloud_aio_volumes/" . $additionalBackupVolumes, "ReadOnly" => false];
|
$mounts[] = ["Type" => "volume", "Source" => $additionalBackupVolumes, "Target" => "/nextcloud_aio_volumes/" . $additionalBackupVolumes, "ReadOnly" => false];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make volumes read only in case of borgbackup container. The viewer makes them writeable
|
||||||
|
$isReadOnly = $container->GetIdentifier() === 'nextcloud-aio-borgbackup';
|
||||||
|
|
||||||
foreach ($this->configurationManager->GetAdditionalBackupDirectoriesArray() as $additionalBackupDirectories) {
|
foreach ($this->configurationManager->GetAdditionalBackupDirectoriesArray() as $additionalBackupDirectories) {
|
||||||
if ($additionalBackupDirectories !== '') {
|
if ($additionalBackupDirectories !== '') {
|
||||||
if (!str_starts_with($additionalBackupDirectories, '/')) {
|
if (!str_starts_with($additionalBackupDirectories, '/')) {
|
||||||
$mounts[] = ["Type" => "volume", "Source" => $additionalBackupDirectories, "Target" => "/docker_volumes/" . $additionalBackupDirectories, "ReadOnly" => true];
|
$mounts[] = ["Type" => "volume", "Source" => $additionalBackupDirectories, "Target" => "/docker_volumes/" . $additionalBackupDirectories, "ReadOnly" => $isReadOnly];
|
||||||
} else {
|
} else {
|
||||||
$mounts[] = ["Type" => "bind", "Source" => $additionalBackupDirectories, "Target" => "/host_mounts" . $additionalBackupDirectories, "ReadOnly" => true, "BindOptions" => ["NonRecursive" => true]];
|
$mounts[] = ["Type" => "bind", "Source" => $additionalBackupDirectories, "Target" => "/host_mounts" . $additionalBackupDirectories, "ReadOnly" => $isReadOnly, "BindOptions" => ["NonRecursive" => true]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -504,6 +504,9 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if has_backup_run_once == true %}
|
{% if has_backup_run_once == true %}
|
||||||
|
<h3>Backup Viewer</h3>
|
||||||
|
<p>There is now a community container that allows to access your backups in a web session. See <a href="https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer"><strong>this documentation</strong></a>.</p>
|
||||||
|
|
||||||
<h3>Backup check</h3>
|
<h3>Backup check</h3>
|
||||||
<p>Click on the button below to perform a backup integrity check. This is an option that verifies that your backup is intact. It shouldn't be needed in most situations.</p>
|
<p>Click on the button below to perform a backup integrity check. This is an option that verifies that your backup is intact. It shouldn't be needed in most situations.</p>
|
||||||
<form method="POST" action="/api/docker/backup-check" class="xhr">
|
<form method="POST" action="/api/docker/backup-check" class="xhr">
|
||||||
|
|
|
||||||
|
|
@ -493,6 +493,9 @@ In this example, it would mount `E:\your\backup\path` into the volume so for a d
|
||||||
#### Pro-tip: Backup archives access
|
#### Pro-tip: Backup archives access
|
||||||
You can open the BorgBackup archives on your host by following these steps:<br>
|
You can open the BorgBackup archives on your host by following these steps:<br>
|
||||||
(instructions for Ubuntu Desktop)
|
(instructions for Ubuntu Desktop)
|
||||||
|
|
||||||
|
Alternatively, there is now a community container that allows to access your backups in a web session: https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install borgbackup on the host
|
# Install borgbackup on the host
|
||||||
sudo apt update && sudo apt install borgbackup
|
sudo apt update && sudo apt install borgbackup
|
||||||
|
|
@ -520,6 +523,9 @@ sudo umount /tmp/borg
|
||||||
#### Delete backup archives manually
|
#### Delete backup archives manually
|
||||||
You can delete BorgBackup archives on your host manually by following these steps:<br>
|
You can delete BorgBackup archives on your host manually by following these steps:<br>
|
||||||
(instructions for Debian based OS' like Ubuntu)
|
(instructions for Debian based OS' like Ubuntu)
|
||||||
|
|
||||||
|
Alternatively, there is now a community container that allows to access your backups in a web session: https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install borgbackup on the host
|
# Install borgbackup on the host
|
||||||
sudo apt update && sudo apt install borgbackup
|
sudo apt update && sudo apt install borgbackup
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue