Compare commits

...

18 commits

Author SHA1 Message Date
Simon L.
0db006605a fix spacing
Some checks failed
Codespell / Check spelling (push) Waiting to run
Validate community containers / Validate community containers (push) Has been cancelled
Docker Lint / docker-lint (push) Has been cancelled
Lint php / php-lint (push) Has been cancelled
PHP Deprecation Detector / PHP Deprecation Detector (push) Has been cancelled
Static analysis / static-psalm-analysis (push) Has been cancelled
Shellcheck / Check Shell (push) Has been cancelled
Lint php / php-lint-summary (push) Has been cancelled
Signed-off-by: Simon L. <szaimen@e.mail.de>
2025-12-03 14:29:55 +01:00
Simon L.
2f697b8e53
Merge pull request #7254 from nextcloud/dependabot/github_actions/dot-github/workflows/actions/checkout-6.0.1
build(deps): bump actions/checkout from 6.0.0 to 6.0.1 in /.github/workflows
2025-12-03 13:24:44 +01:00
dependabot[bot]
832d9b5ae6
build(deps): bump actions/checkout in /.github/workflows
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v6...v6.0.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 12:21:58 +00:00
Simon L.
2bde893647
Merge pull request #7216 from nextcloud/enh/noid/allow-configure-mysql-root-cert
nextcloud: allow to configure mysql root cert
2025-12-03 12:42:59 +01:00
Simon L.
1a91d6187c
Merge pull request #7234 from nextcloud/enh/7223/refactor-api-version-check
mastercontainer: refactor docker api version check
2025-12-03 11:39:45 +01:00
Simon L.
be1199ace1
Merge pull request #7244 from nextcloud/enh/6690/follow-up
adjust `DeleteBorgBackupLocationVars` to also delete the `borg.config` file
2025-12-03 11:36:33 +01:00
Simon L.
d425bb226c
Merge pull request #7238 from nextcloud/enh/noid/refactor-backup-mode
refactor `backup-mode` handling
2025-12-03 11:35:02 +01:00
Simon L.
edba082dce
improve detail
Signed-off-by: Simon L. <szaimen@e.mail.de>
2025-12-03 09:26:18 +01:00
Simon L.
0d0d43d0cf
Merge pull request #7252 from nextcloud/dependabot/docker/Containers/watchtower/golang-1.25.5-alpine3.22
build(deps): bump golang from 1.25.4-alpine3.22 to 1.25.5-alpine3.22 in /Containers/watchtower
2025-12-03 08:56:42 +01:00
Simon L.
4a7353d9e7
Merge pull request #7251 from nextcloud/dependabot/docker/Containers/imaginary/golang-1.25.5-alpine3.22
build(deps): bump golang from 1.25.4-alpine3.22 to 1.25.5-alpine3.22 in /Containers/imaginary
2025-12-03 08:56:18 +01:00
Simon L.
386a94494f
Merge pull request #7250 from nextcloud/dependabot/docker/Containers/fulltextsearch/elasticsearch-8.19.8
build(deps): bump elasticsearch from 8.19.7 to 8.19.8 in /Containers/fulltextsearch
2025-12-03 08:55:53 +01:00
dependabot[bot]
d72181f754
build(deps): bump golang in /Containers/watchtower
Bumps golang from 1.25.4-alpine3.22 to 1.25.5-alpine3.22.

---
updated-dependencies:
- dependency-name: golang
  dependency-version: 1.25.5-alpine3.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 04:13:40 +00:00
dependabot[bot]
0c0f956ea2
build(deps): bump golang in /Containers/imaginary
Bumps golang from 1.25.4-alpine3.22 to 1.25.5-alpine3.22.

---
updated-dependencies:
- dependency-name: golang
  dependency-version: 1.25.5-alpine3.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 04:12:43 +00:00
dependabot[bot]
7634a3887f
build(deps): bump elasticsearch in /Containers/fulltextsearch
Bumps elasticsearch from 8.19.7 to 8.19.8.

---
updated-dependencies:
- dependency-name: elasticsearch
  dependency-version: 8.19.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 04:12:39 +00:00
Simon L.
83de526051 adjust DeleteBorgBackupLocationVars to also delete the borg.config file
Signed-off-by: Simon L. <szaimen@e.mail.de>
2025-12-02 12:42:13 +01:00
Simon L.
57306c8cae refactor backup-mode handling
Signed-off-by: Simon L. <szaimen@e.mail.de>
2025-12-01 17:08:22 +01:00
Simon L.
cc41c3465e mastercontainer: refactor docker api version check
Signed-off-by: Simon L. <szaimen@e.mail.de>
2025-12-01 12:53:00 +01:00
Simon L.
6b3af009e2 nextcloud: allow to configure mysql root cert
Signed-off-by: Simon L. <szaimen@e.mail.de>
2025-11-28 12:44:23 +01:00
34 changed files with 110 additions and 81 deletions

View file

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
- name: Check spelling
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 # v2
with:

View file

@ -10,7 +10,7 @@ jobs:
name: update collabora
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- name: Run collabora-profile-update
run: |
rm -f php/cool-seccomp-profile.json

View file

@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
- name: Validate structure
run: |
CONTAINERS="$(find ./community-containers -mindepth 1 -maxdepth 1 -type d)"

View file

@ -10,7 +10,7 @@ jobs:
name: Run dependency update script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2
with:
php-version: 8.4

View file

@ -25,7 +25,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
- name: Install hadolint
run: |

View file

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
- name: Turnstyle
uses: softprops/turnstyle@2e4451ef94c5969eee533c487092052d4d1a53af # v2

View file

@ -10,7 +10,7 @@ jobs:
name: update to latest imaginary commit on master branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- name: Run imaginary-update
run: |
# Imaginary

View file

@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
- name: Validate Json
run: |
sudo apt-get update

View file

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
with:
fetch-depth: 0

View file

@ -36,7 +36,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5 # v5.0.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5.0.1
with:
persist-credentials: false

View file

@ -11,7 +11,7 @@ jobs:
name: Run nextcloud-update script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- name: Run nextcloud-update script
run: |
# Inspired by https://github.com/nextcloud/docker/blob/master/update.sh

View file

@ -16,7 +16,7 @@ jobs:
name: PHP Deprecation Detector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- name: Set up php
uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2
with:

View file

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- uses: actions/setup-node@v6
with:

View file

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- name: Set up php
uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2

View file

@ -32,7 +32,7 @@ jobs:
name: static-psalm-analysis
steps:
- name: Checkout
uses: actions/checkout@c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5 # v5.0.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5.0.1
with:
persist-credentials: false

View file

@ -15,7 +15,7 @@ jobs:
name: Check Shell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- name: Run Shellcheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
with:

View file

@ -10,7 +10,7 @@ jobs:
name: update talk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- name: Run talk-container-update
run: |
# Recording

View file

@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2

View file

@ -8,4 +8,4 @@ jobs:
name: update copyright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1

View file

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
- name: update helm chart
run: |
set -x

View file

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6.0.0
uses: actions/checkout@v6.0.1
- name: update yaml files
run: |
sudo bash manual-install/update-yaml.sh

View file

@ -10,7 +10,7 @@ jobs:
name: update watchtower
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.0
- uses: actions/checkout@v6.0.1
- name: Run watchtower-container-update
run: |
# Watchtower

View file

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:latest
# Probably from here https://github.com/elastic/elasticsearch/blob/main/distribution/docker/src/docker/Dockerfile
FROM elasticsearch:8.19.7
FROM elasticsearch:8.19.8
USER root

View file

@ -1,5 +1,5 @@
# syntax=docker/dockerfile:latest
FROM golang:1.25.4-alpine3.22 AS go
FROM golang:1.25.5-alpine3.22 AS go
ENV IMAGINARY_HASH=6a274b488759a896aff02f52afee6e50b5e3a3ee

View file

@ -75,18 +75,15 @@ elif ! sudo -E -u www-data test -r /var/run/docker.sock; then
fi
fi
# Check if api version is supported
if ! sudo -E -u www-data docker info &>/dev/null; then
print_red "Cannot connect to the docker socket. Cannot proceed."
echo "Did you maybe remove group read permissions for the docker socket? AIO needs them in order to access the docker socket."
echo "If SELinux is enabled on your host, see https://github.com/nextcloud/all-in-one#are-there-known-problems-when-selinux-is-enabled"
echo "If you are on TrueNas SCALE, see https://github.com/nextcloud/all-in-one#can-i-run-aio-on-truenas-scale"
# Get default docker api version
API_VERSION_FILE="$(find ./ -name DockerActionManager.php | head -1)"
API_VERSION="$(grep -oP 'const string API_VERSION.*\;' "$API_VERSION_FILE" | grep -oP '[0-9]+.[0-9]+' | head -1)"
if [ -z "$API_VERSION" ]; then
print_red "Could not get API_VERSION. Something is wrong!"
exit 1
fi
# Docker api version check
API_VERSION_FILE="$(find ./ -name DockerActionManager.php | head -1)"
API_VERSION="$(grep -oP 'const string API_VERSION.*\;' "$API_VERSION_FILE" | grep -oP '[0-9]+.[0-9]+' | head -1)"
# Check if DOCKER_API_VERSION is set globally
if [ -n "$DOCKER_API_VERSION" ]; then
if ! echo "$DOCKER_API_VERSION" | grep -q '^[0-9].[0-9]\+$'; then
print_red "You've set DOCKER_API_VERSION but not to an allowed value.
@ -98,23 +95,45 @@ It is set to '$DOCKER_API_VERSION'."
print_red "Please note that only v$API_VERSION is officially supported and tested by the maintainers of Nextcloud AIO."
print_red "So you run on your own risk and things might break without warning."
else
# shellcheck disable=SC2001
API_VERSION_NUMB="$(echo "$API_VERSION" | sed 's/\.//')"
LOCAL_API_VERSION_NUMB="$(sudo -E -u www-data docker version | grep -i "api version" | grep -oP '[0-9]+.[0-9]+' | head -1 | sed 's/\.//')"
if [ -n "$LOCAL_API_VERSION_NUMB" ] && [ -n "$API_VERSION_NUMB" ]; then
if ! [ "$LOCAL_API_VERSION_NUMB" -ge "$API_VERSION_NUMB" ]; then
print_red "Docker API v$API_VERSION is not supported by your docker engine. Cannot proceed. Please upgrade your docker engine if you want to run Nextcloud AIO!"
echo "Alternatively, set the DOCKER_API_VERSION environmental variable to a compatible version."
echo "However please note that only v$API_VERSION is officially supported and tested by the maintainers of Nextcloud AIO."
echo "See https://github.com/nextcloud/all-in-one#how-to-adjust-the-internally-used-docker-api-version"
exit 1
fi
else
echo "LOCAL_API_VERSION_NUMB or API_VERSION_NUMB are not set correctly. Cannot check if the API version is supported."
sleep 10
# Export docker api version to use it everywhere
export DOCKER_API_VERSION="$API_VERSION"
fi
# Set a fallback docker api version. Needed for api version check.
# The check will not work otherwise on old docker versions
FALLBACK_DOCKER_API_VERSION="1.41"
# Check if docker info can be used
if ! sudo -E -u www-data docker info &>/dev/null; then
if ! sudo -E -u www-data DOCKER_API_VERSION="$FALLBACK_DOCKER_API_VERSION" docker info &>/dev/null; then
print_red "Cannot connect to the docker socket. Cannot proceed."
echo "Did you maybe remove group read permissions for the docker socket? AIO needs them in order to access the docker socket."
echo "If SELinux is enabled on your host, see https://github.com/nextcloud/all-in-one#are-there-known-problems-when-selinux-is-enabled"
echo "If you are on TrueNas SCALE, see https://github.com/nextcloud/all-in-one#can-i-run-aio-on-truenas-scale"
exit 1
fi
fi
# Docker api version check
# shellcheck disable=SC2001
API_VERSION_NUMB="$(echo "$API_VERSION" | sed 's/\.//')"
LOCAL_API_VERSION_NUMB="$(sudo -E -u www-data docker version | grep -i "api version" | grep -oP '[0-9]+.[0-9]+' | head -1 | sed 's/\.//')"
if [ -z "$LOCAL_API_VERSION_NUMB" ]; then
LOCAL_API_VERSION_NUMB="$(sudo -E -u www-data DOCKER_API_VERSION="$FALLBACK_DOCKER_API_VERSION" docker version | grep -i "api version" | grep -oP '[0-9]+.[0-9]+' | head -1 | sed 's/\.//')"
fi
if [ -n "$LOCAL_API_VERSION_NUMB" ] && [ -n "$API_VERSION_NUMB" ]; then
if ! [ "$LOCAL_API_VERSION_NUMB" -ge "$API_VERSION_NUMB" ]; then
print_red "Docker API v$API_VERSION is not supported by your docker engine. Cannot proceed. Please upgrade your docker engine if you want to run Nextcloud AIO!"
echo "Alternatively, set the DOCKER_API_VERSION environmental variable to a compatible version."
echo "However please note that only v$API_VERSION is officially supported and tested by the maintainers of Nextcloud AIO."
echo "See https://github.com/nextcloud/all-in-one#how-to-adjust-the-internally-used-docker-api-version"
exit 1
fi
else
echo "LOCAL_API_VERSION_NUMB or API_VERSION_NUMB are not set correctly. Cannot check if the API version is supported."
sleep 10
fi
# Check Storage drivers
STORAGE_DRIVER="$(sudo -E -u www-data docker info | grep "Storage Driver")"
# Check if vfs is used: https://github.com/nextcloud/all-in-one/discussions/1467

View file

@ -7,3 +7,11 @@ if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES')) {
),
);
}
if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_MYSQL')) {
$CONFIG = array(
'dbdriveroptions' => array(
'PDO::MYSQL_ATTR_SSL_CA' => '/var/www/html/data/certificates/MYSQL',
),
);
}

View file

@ -283,6 +283,10 @@ EOF
if [ -n "$NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES" ]; then
mkdir /var/www/html/data/certificates
echo "$NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES" > "/var/www/html/data/certificates/POSTGRES"
# Write out mysql root cert
elif [ -n "$NEXTCLOUD_TRUSTED_CERTIFICATES_MYSQL" ]; then
mkdir /var/www/html/data/certificates
echo "$NEXTCLOUD_TRUSTED_CERTIFICATES_MYSQL" > "/var/www/html/data/certificates/MYSQL"
fi
echo "Installing with $DATABASE_TYPE database"

View file

@ -68,11 +68,14 @@ fi
# Postgres root cert
if [ -f "/nextcloud/data/certificates/POSTGRES" ]; then
POSTGRES_CERT="?sslmode=verify-ca&sslrootcert=/nextcloud/data/certificates/POSTGRES"
CERT_OPTIONS="?sslmode=verify-ca&sslrootcert=/nextcloud/data/certificates/POSTGRES"
# Mysql root cert
elif [ -f "/nextcloud/data/certificates/MYSQL" ]; then
CERT_OPTIONS="?sslmode=verify-ca&ssl-ca=/nextcloud/data/certificates/MYSQL"
fi
# Set sensitive values as env
export DATABASE_URL="$DATABASE_TYPE://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB$POSTGRES_CERT"
export DATABASE_URL="$DATABASE_TYPE://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB$CERT_OPTIONS"
export REDIS_URL="redis://$REDIS_USER:$REDIS_HOST_PASSWORD@$REDIS_HOST/$REDIS_DB_INDEX"
# Run it

View file

@ -1,5 +1,5 @@
# syntax=docker/dockerfile:latest
FROM golang:1.25.4-alpine3.22 AS go
FROM golang:1.25.5-alpine3.22 AS go
ENV WATCHTOWER_COMMIT_HASH=6c5a1b0bea65cea1d4cc1de5196789a01617957a

View file

@ -3,7 +3,7 @@ This container bundles caddy and auto-configures it for you. It also covers [vau
### Notes
- This container is incompatible with the [npmplus](https://github.com/nextcloud/all-in-one/tree/main/community-containers/npmplus) community container. So make sure that you do not enable both at the same time!
- Make sure that no other service is using port 443 on your host as otherwise the containers will fail to start. You can check this with `sudo netstat -tulpn | grep 443` before installing AIO.
- Make sure that no other service is using port 443/tcp on your host as otherwise the containers will fail to start. You can check this with `sudo netstat -tulpn | grep 443` before installing AIO.
- Starting with AIO v12, the Talk port that was usually exposed on port 3478 is now set to port 443 udp and tcp and reachable via `your-nc-domain.com`. For the changes to become activated, you need to go to `https://your-nc-domain.com/settings/admin/talk` and delete all turn and stun servers. Then restart the containers and the new config should become active.
- Starting with AIO v12, you can also limit vaultwarden, stalwart and lldap to certain ip-addresses. You can do so by creating a `allowed-IPs-vaultwarden.txt`, `allowed-IPs-stalwart.txt`, or `allowed-IPs-lldap.txt` file in the `nextcloud-aio-caddy` directory of your admin user and adding the ip-addresses in these files.
- The container also supports the proxy protocol inside caddy. That means that you can run a supported web server in front of port 443/tcp and use the proxy protocol. You can enable this by configuring the `APACHE_IP_BINDING` environmental variable for the mastercontainer and set it to an ip-address from which the protocol shall be accepted. ⚠️ Note that the initial domain validation will not work correctly if you want to use the proxy protocol. So make sure to skip the domain validation in that case. See the [documentation](https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation).

View file

@ -104,7 +104,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
'is_backup_container_running' => $dockerActionManger->isBackupContainerRunning(),
'backup_exit_code' => $dockerActionManger->GetBackupcontainerExitCode(),
'is_instance_restore_attempt' => $configurationManager->isInstanceRestoreAttempt(),
'borg_backup_mode' => $configurationManager->GetBorgBackupMode(),
'borg_backup_mode' => $configurationManager->GetBackupMode(),
'was_start_button_clicked' => $configurationManager->wasStartButtonClicked(),
'has_update_available' => $dockerActionManger->isAnyUpdateAvailable(),
'last_backup_time' => $configurationManager->GetLastBackupTime(),

View file

@ -159,7 +159,7 @@ readonly class ConfigurationController {
}
if (isset($request->getParsedBody()['delete_borg_backup_location_vars'])) {
$this->configurationManager->DeleteBorgBackupLocationVars();
$this->configurationManager->DeleteBorgBackupLocationItems();
}
return $response->withStatus(201)->withHeader('Location', '.');

View file

@ -89,9 +89,7 @@ readonly class DockerController {
}
public function startBackup(bool $forceStopNextcloud = false) : void {
$config = $this->configurationManager->GetConfig();
$config['backup-mode'] = 'backup';
$this->configurationManager->WriteConfig($config);
$this->configurationManager->SetBackupMode('backup');
$id = self::TOP_CONTAINER;
$this->PerformRecursiveContainerStop($id, $forceStopNextcloud);
@ -111,26 +109,22 @@ readonly class DockerController {
}
public function checkBackup() : void {
$config = $this->configurationManager->GetConfig();
$config['backup-mode'] = 'check';
$this->configurationManager->WriteConfig($config);
$this->configurationManager->SetBackupMode('check');
$id = 'nextcloud-aio-borgbackup';
$this->PerformRecursiveContainerStart($id);
}
private function listBackup() : void {
$config = $this->configurationManager->GetConfig();
$config['backup-mode'] = 'list';
$this->configurationManager->WriteConfig($config);
private function listBackup() : void {
$this->configurationManager->SetBackupMode('list');
$id = 'nextcloud-aio-borgbackup';
$this->PerformRecursiveContainerStart($id);
}
public function StartBackupContainerRestore(Request $request, Response $response, array $args) : Response {
$this->configurationManager->SetBackupMode('restore');
$config = $this->configurationManager->GetConfig();
$config['backup-mode'] = 'restore';
$config['selected-restore-time'] = $request->getParsedBody()['selected_restore_time'] ?? '';
if (isset($request->getParsedBody()['restore-exclude-previews'])) {
$config['restore-exclude-previews'] = 1;
@ -150,24 +144,20 @@ readonly class DockerController {
}
public function StartBackupContainerCheckRepair(Request $request, Response $response, array $args) : Response {
$config = $this->configurationManager->GetConfig();
$config['backup-mode'] = 'check-repair';
$this->configurationManager->WriteConfig($config);
$this->configurationManager->SetBackupMode('check-repair');
$id = 'nextcloud-aio-borgbackup';
$this->PerformRecursiveContainerStart($id);
// Restore to backup check which is needed to make the UI logic work correctly
$config = $this->configurationManager->GetConfig();
$config['backup-mode'] = 'check';
$this->configurationManager->WriteConfig($config);
$this->configurationManager->SetBackupMode('check');
return $response->withStatus(201)->withHeader('Location', '.');
}
public function StartBackupContainerTest(Request $request, Response $response, array $args) : Response {
$this->configurationManager->SetBackupMode('test');
$config = $this->configurationManager->GetConfig();
$config['backup-mode'] = 'test';
$config['instance_restore_attempt'] = 0;
$this->configurationManager->WriteConfig($config);

View file

@ -426,6 +426,12 @@ class ConfigurationManager
return $config['backup-mode'];
}
public function SetBackupMode(string $mode) : void {
$config = $this->GetConfig();
$config['backup-mode'] = $mode;
$this->WriteConfig($config);
}
public function GetSelectedRestoreTime() : string {
$config = $this->GetConfig();
if(!isset($config['selected-restore-time'])) {
@ -506,11 +512,19 @@ class ConfigurationManager
}
}
public function DeleteBorgBackupLocationVars() : void {
public function DeleteBorgBackupLocationItems() : void {
// Delete the variables
$config = $this->GetConfig();
$config['borg_backup_host_location'] = '';
$config['borg_remote_repo'] = '';
$this->WriteConfig($config);
// Also delete the borg config file to be able to start over
if (file_exists(DataConst::GetBackupKeyFile())) {
if (unlink(DataConst::GetBackupKeyFile())) {
error_log('borg.config file deleted to be able to start over.');
}
}
}
/**
@ -667,15 +681,6 @@ class ConfigurationManager
return false;
}
public function GetBorgBackupMode() : string {
$config = $this->GetConfig();
if(!isset($config['backup-mode'])) {
$config['backup-mode'] = '';
}
return $config['backup-mode'];
}
public function GetNextcloudMount() : string {
$envVariableName = 'NEXTCLOUD_MOUNT';
$configName = 'nextcloud_mount';