Save default container selection on setup.

Save the default container selection to the config, so it gets persisted
even
if people don't change anything in the UI. Without this any change to
the
defaults would be applied to existing instances.

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>

AI-assistant: Copilot v1.0.69 (Claude Sonnet 4.6)
This commit is contained in:
Pablo Zmdl
2026-07-17 21:13:57 +02:00
parent 8bc241bfc8
commit 4e03393d53
6 changed files with 55 additions and 3 deletions
+16
View File
@@ -18,7 +18,23 @@ readonly class Setup {
}
$password = $this->passwordGenerator->GeneratePassword(8);
// Save the password and the default container selection to the config, so it gets persisted even if
// people don't change anything in the UI. Without this any change to the defaults would be applied to
// existing instances.
$this->configurationManager->startTransaction();
$this->configurationManager->password = $password;
// Get the defaults for these config options from their own getters to avoid duplication of defaults.
// Makes the code look funny but works.
$this->configurationManager->officeSuite = $this->configurationManager->officeSuite;
$this->configurationManager->isClamavEnabled = $this->configurationManager->isClamavEnabled;
$this->configurationManager->isFulltextsearchEnabled = $this->configurationManager->isFulltextsearchEnabled;
$this->configurationManager->isImaginaryEnabled = $this->configurationManager->isImaginaryEnabled;
$this->configurationManager->isTalkEnabled = $this->configurationManager->isTalkEnabled;
$this->configurationManager->isTalkRecordingEnabled = $this->configurationManager->isTalkRecordingEnabled;
$this->configurationManager->isDockerSocketProxyEnabled = $this->configurationManager->isDockerSocketProxyEnabled;
$this->configurationManager->isHarpEnabled = $this->configurationManager->isHarpEnabled;
$this->configurationManager->isWhiteboardEnabled = $this->configurationManager->isWhiteboardEnabled;
$this->configurationManager->commitTransaction();
return $password;
}