Make install_latest_major an attribute

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl 2026-01-19 13:06:59 +01:00
parent 68c508f281
commit c608009981
3 changed files with 7 additions and 19 deletions

View file

@ -181,16 +181,7 @@ readonly class DockerController {
$port = 443;
}
if (isset($request->getParsedBody()['install_latest_major'])) {
$installLatestMajor = 32;
} else {
$installLatestMajor = "";
}
$config = $this->configurationManager->GetConfig();
// set install_latest_major
$config['install_latest_major'] = $installLatestMajor;
$this->configurationManager->WriteConfig($config);
$this->configurationManager->install_latest_major = isset($request->getParsedBody()['install_latest_major']);
// set AIO_URL
$this->configurationManager->AIO_URL = $host . ':' . (string)$port . $path;
// set wasStartButtonClicked

View file

@ -33,6 +33,11 @@ class ConfigurationManager
set { $this->set('wasStartButtonClicked', $value); }
}
public bool $install_latest_major {
get => $this->get('install_latest_major', false);
set { $this->set('install_latest_major', $value); }
}
public function GetConfig() : array
{
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
@ -889,14 +894,6 @@ class ConfigurationManager
}
}
public function shouldLatestMajorGetInstalled() : bool {
$config = $this->GetConfig();
if(!isset($config['install_latest_major'])) {
$config['install_latest_major'] = '';
}
return $config['install_latest_major'] !== '';
}
public function GetAdditionalBackupDirectoriesString() : string {
if (!file_exists(DataConst::GetAdditionalBackupDirectoriesFile())) {
return '';

View file

@ -595,7 +595,7 @@ readonly class DockerActionManager {
'NEXTCLOUD_STARTUP_APPS' => $this->configurationManager->GetNextcloudStartupApps(),
'NEXTCLOUD_ADDITIONAL_APKS' => $this->configurationManager->GetNextcloudAdditionalApks(),
'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS' => $this->configurationManager->GetNextcloudAdditionalPhpExtensions(),
'INSTALL_LATEST_MAJOR' => $this->configurationManager->shouldLatestMajorGetInstalled() ? 'yes' : '',
'INSTALL_LATEST_MAJOR' => $this->configurationManager->install_latest_major ? 'yes' : '',
'REMOVE_DISABLED_APPS' => $this->configurationManager->shouldDisabledAppsGetRemoved() ? 'yes' : '',
// Allow to get local ip-address of database container which allows to talk to it even in host mode (the container that requires this needs to be started first then)
'AIO_DATABASE_HOST' => gethostbyname('nextcloud-aio-database'),