mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
allow to disable the backup section
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
adcba6b751
commit
9052828dde
6 changed files with 124 additions and 95 deletions
|
|
@ -23,6 +23,7 @@ services:
|
||||||
# - NEXTCLOUD_DATADIR=/mnt/ncdata # Allows to set the host directory for Nextcloud's datadir. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir
|
# - NEXTCLOUD_DATADIR=/mnt/ncdata # Allows to set the host directory for Nextcloud's datadir. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir
|
||||||
# - NEXTCLOUD_MOUNT=/mnt/ # Allows the Nextcloud container to access the chosen directory on the host. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host
|
# - NEXTCLOUD_MOUNT=/mnt/ # Allows the Nextcloud container to access the chosen directory on the host. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host
|
||||||
# - DOCKER_SOCKET_PATH=/var/run/docker.sock # Needs to be specified if the docker socket on the host is not located in the default '/var/run/docker.sock'. Otherwise mastercontainer updates will fail.
|
# - DOCKER_SOCKET_PATH=/var/run/docker.sock # Needs to be specified if the docker socket on the host is not located in the default '/var/run/docker.sock'. Otherwise mastercontainer updates will fail.
|
||||||
|
# - DISABLE_BACKUP_SECTION=true # Setting this to true allows to hide the backup section in the AIO interface.
|
||||||
|
|
||||||
# # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
# # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||||
# # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588
|
# # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ $app->get('/containers', function ($request, $response, $args) use ($container)
|
||||||
'talk_port' => $configurationManager->GetTalkPort(),
|
'talk_port' => $configurationManager->GetTalkPort(),
|
||||||
'collabora_dictionaries' => $configurationManager->GetCollaboraDictionaries(),
|
'collabora_dictionaries' => $configurationManager->GetCollaboraDictionaries(),
|
||||||
'automatic_updates' => $configurationManager->areAutomaticUpdatesEnabled(),
|
'automatic_updates' => $configurationManager->areAutomaticUpdatesEnabled(),
|
||||||
|
'is_backup_section_enabled' => $configurationManager->isBackupSectionEnabled(),
|
||||||
]);
|
]);
|
||||||
})->setName('profile');
|
})->setName('profile');
|
||||||
$app->get('/login', function ($request, $response, $args) use ($container) {
|
$app->get('/login', function ($request, $response, $args) use ($container) {
|
||||||
|
|
|
||||||
|
|
@ -624,4 +624,19 @@ class ConfigurationManager
|
||||||
$defaultValue = '';
|
$defaultValue = '';
|
||||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function GetDisableBackupSection() : string {
|
||||||
|
$envVariableName = 'DISABLE_BACKUP_SECTION';
|
||||||
|
$configName = 'disable_backup_section';
|
||||||
|
$defaultValue = '';
|
||||||
|
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isBackupSectionEnabled() : bool {
|
||||||
|
if ($this->GetDisableBackupSection() === 'true') {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -293,6 +293,10 @@
|
||||||
|
|
||||||
{% if was_start_button_clicked == true %}
|
{% if was_start_button_clicked == true %}
|
||||||
|
|
||||||
|
{% if is_backup_section_enabled == false %}
|
||||||
|
<h2>Backup and restore</h2>
|
||||||
|
The backup section is disabled via environmental variable.<br><br>
|
||||||
|
{% else %}
|
||||||
{% if is_backup_container_running == false and borg_backup_host_location == "" and isApacheStarting != true %}
|
{% if is_backup_container_running == false and borg_backup_host_location == "" and isApacheStarting != true %}
|
||||||
<h2>Backup and restore</h2>
|
<h2>Backup and restore</h2>
|
||||||
Please type in the directory where backups will get created on the host system:<br><br>
|
Please type in the directory where backups will get created on the host system:<br><br>
|
||||||
|
|
@ -307,6 +311,9 @@
|
||||||
For macOS it may be <b>/var/backup</b>.<br>
|
For macOS it may be <b>/var/backup</b>.<br>
|
||||||
On Windows it must be <b>nextcloud_aio_backupdir</b>. You need to create the 'nextcloud_aio_backupdir' volume beforehand by following this documentation: <a href="https://github.com/nextcloud/all-in-one#how-to-run-aio-on-windows"><b>click here</b></a><br><br>
|
On Windows it must be <b>nextcloud_aio_backupdir</b>. You need to create the 'nextcloud_aio_backupdir' volume beforehand by following this documentation: <a href="https://github.com/nextcloud/all-in-one#how-to-run-aio-on-windows"><b>click here</b></a><br><br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if is_backup_section_enabled == true %}
|
||||||
|
|
||||||
{% if borg_backup_host_location != "" %}
|
{% if borg_backup_host_location != "" %}
|
||||||
{% if is_backup_container_running == false %}
|
{% if is_backup_container_running == false %}
|
||||||
|
|
@ -407,6 +414,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if is_backup_container_running == false %}
|
{% if is_backup_container_running == false %}
|
||||||
{% if isApacheStarting == false %}
|
{% if isApacheStarting == false %}
|
||||||
|
|
|
||||||
|
|
@ -377,6 +377,9 @@ You can do so by running the `/daily-backup.sh` script that is stored in the mas
|
||||||
|
|
||||||
One example for this would be `sudo docker exec -it nextcloud-aio-mastercontainer DAILY_BACKUP=1 /daily-backup.sh`, which you can run via a cronjob or put it in a script.
|
One example for this would be `sudo docker exec -it nextcloud-aio-mastercontainer DAILY_BACKUP=1 /daily-backup.sh`, which you can run via a cronjob or put it in a script.
|
||||||
|
|
||||||
|
### How to disable the backup section?
|
||||||
|
If you already have a backup solution in place, you may want to hide the backup section. You can do so by adding `-e DISABLE_BACKUP_SECTION=true` to the initial startup of the mastercontainer.
|
||||||
|
|
||||||
### How to change the default location of Nextcloud's Datadir?
|
### How to change the default location of Nextcloud's Datadir?
|
||||||
You can configure the Nextcloud container to use a specific directory on your host as data directory. You can do so by adding the environmental variable `NEXTCLOUD_DATADIR` to the initial startup of the mastercontainer. Allowed values for that variable are strings that start with `/` and are not equal to `/`.
|
You can configure the Nextcloud container to use a specific directory on your host as data directory. You can do so by adding the environmental variable `NEXTCLOUD_DATADIR` to the initial startup of the mastercontainer. Allowed values for that variable are strings that start with `/` and are not equal to `/`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,6 @@
|
||||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_DATADIR="/mnt/testdata"` it should map that location from `/mnt/testdata` to `/mnt/ncdata` inside the Nextcloud container. Not having adjusted the permissions correctly before starting the Nextcloud container the first time will not allow the Nextcloud container to start correctly. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir for allowed values.
|
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_DATADIR="/mnt/testdata"` it should map that location from `/mnt/testdata` to `/mnt/ncdata` inside the Nextcloud container. Not having adjusted the permissions correctly before starting the Nextcloud container the first time will not allow the Nextcloud container to start correctly. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir for allowed values.
|
||||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_MOUNT="/mnt/"` it should map `/mnt/` to `/mnt/` inside the Nextcloud container. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host for allowed values.
|
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_MOUNT="/mnt/"` it should map `/mnt/` to `/mnt/` inside the Nextcloud container. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host for allowed values.
|
||||||
- [ ] When starting the mastercontainer with `-e DOCKER_SOCKET_PATH="/var/run/docker.sock.raw"` it should map `/var/run/docker.sock.raw` to `/var/run/docker.sock` inside the watchtower container which allow to update the mastercontainer on macos and with docker rootless.
|
- [ ] When starting the mastercontainer with `-e DOCKER_SOCKET_PATH="/var/run/docker.sock.raw"` it should map `/var/run/docker.sock.raw` to `/var/run/docker.sock` inside the watchtower container which allow to update the mastercontainer on macos and with docker rootless.
|
||||||
|
- [ ] When starting the mastercontainer with `-e DISABLE_BACKUP_SECTION=true` it should hide the backup section that gets shown after AIO is set up (everything of [020-backup-and-restore](./020-backup-and-restore.md)) and simply show that the backup section is disabled.
|
||||||
|
|
||||||
You can now continue with [070-timezone-change.md](./070-timezone-change.md)
|
You can now continue with [070-timezone-change.md](./070-timezone-change.md)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue