mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-10 07:47:59 +00:00
Method to set dynamic config variables for DockerActionManager->CreateContainer()
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
fa50f5c141
commit
71b898ef14
2 changed files with 12 additions and 4 deletions
|
|
@ -25,6 +25,16 @@ class ConfigurationManager
|
|||
return $this->config;
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper for setter methods, and to allow DockerActionManager->CreateContainer() to set dynamic
|
||||
* variables.
|
||||
* This method must be public for the latter purpose.
|
||||
*/
|
||||
public function set(string $key, mixed $value) : void {
|
||||
$this->GetConfig();
|
||||
$this->config[$key] = $value;
|
||||
}
|
||||
|
||||
public function GetPassword() : string {
|
||||
return $this->GetConfig()['password'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,13 +230,11 @@ readonly class DockerActionManager {
|
|||
|
||||
$aioVariables = $container->GetAioVariables()->GetVariables();
|
||||
foreach ($aioVariables as $variable) {
|
||||
$config = $this->configurationManager->GetConfig();
|
||||
$variable = $this->replaceEnvPlaceholders($variable);
|
||||
$variableArray = explode('=', $variable);
|
||||
$config[$variableArray[0]] = $variableArray[1];
|
||||
$this->configurationManager->WriteConfig($config);
|
||||
sleep(1);
|
||||
$this->configurationManager->set($variableArray[0], $variableArray[1]);
|
||||
}
|
||||
$this->configurationManager->save();
|
||||
|
||||
$envs = $container->GetEnvironmentVariables()->GetVariables();
|
||||
// Special thing for the nextcloud container
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue