mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
secrets should only get generated if defined in secrets of container.json
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
4750fb228f
commit
27bd5ce1a4
3 changed files with 22 additions and 5 deletions
|
|
@ -230,6 +230,10 @@ class DockerActionManager
|
|||
$requestBody['HostConfig']['Binds'] = $volumes;
|
||||
}
|
||||
|
||||
foreach($container->GetSecrets() as $secret) {
|
||||
$this->configurationManager->GetAndGenerateSecret($secret);
|
||||
}
|
||||
|
||||
$envs = $container->GetEnvironmentVariables()->GetVariables();
|
||||
foreach($envs as $key => $env) {
|
||||
$patterns = ['/%(.*)%/'];
|
||||
|
|
@ -337,7 +341,11 @@ class DockerActionManager
|
|||
} elseif ($out[1] === 'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS') {
|
||||
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalPhpExtensions();
|
||||
} else {
|
||||
$replacements[1] = $this->configurationManager->GetSecret($out[1]);
|
||||
$secret = $this->configurationManager->GetSecret($out[1]);
|
||||
if ($secret === "") {
|
||||
throw new \Exception("The secret " . $out[1] . " is empty. Cannot substitute its value. Pleas check if it is defined in secrets of containers.json.");
|
||||
}
|
||||
$replacements[1] = $secret;
|
||||
}
|
||||
|
||||
$envs[$key] = preg_replace($patterns, $replacements, $env);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue