allow to keep disabled apps

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-07-19 21:29:24 +02:00
parent faf1e4b2a9
commit 2e0410a704
8 changed files with 44 additions and 14 deletions

View file

@ -205,7 +205,8 @@
"RECORDING_SECRET=%RECORDING_SECRET%",
"TALK_RECORDING_HOST=nextcloud-aio-talk-recording",
"FULLTEXTSEARCH_PASSWORD=%FULLTEXTSEARCH_PASSWORD%",
"DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%"
"DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%",
"REMOVE_DISABLED_APPS=%REMOVE_DISABLED_APPS%"
],
"restart": "unless-stopped",
"devices": [

View file

@ -888,4 +888,19 @@ class ConfigurationManager
return false;
}
}
private function GetKeepDisabledApps() : string {
$envVariableName = 'NEXTCLOUD_KEEP_DISABLED_APPS';
$configName = 'nextcloud_keep_disabled_apps';
$defaultValue = '';
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
}
public function shouldDisabledAppsGetRemoved() : bool {
if ($this->GetKeepDisabledApps() === 'true') {
return false;
} else {
return true;
}
}
}

View file

@ -386,6 +386,12 @@ class DockerActionManager
} else {
$replacements[1] = '';
}
} elseif ($out[1] === 'REMOVE_DISABLED_APPS') {
if ($this->configurationManager->shouldDisabledAppsGetRemoved()) {
$replacements[1] = 'yes';
} else {
$replacements[1] = '';
}
} else {
$secret = $this->configurationManager->GetSecret($out[1]);
if ($secret === "") {