mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
allow to specify an apache ip-binding
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
005ad34741
commit
482b279f3c
4 changed files with 30 additions and 6 deletions
|
|
@ -599,4 +599,11 @@ class ConfigurationManager
|
|||
$config['collabora_dictionaries'] = '';
|
||||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
public function GetApacheIPBinding() : string {
|
||||
$envVariableName = 'APACHE_IP_BINDING';
|
||||
$configName = 'apache_ip_binding';
|
||||
$defaultValue = '';
|
||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,13 +314,22 @@ class DockerActionManager
|
|||
|
||||
if(count($exposedPorts) > 0) {
|
||||
$requestBody['ExposedPorts'] = $exposedPorts;
|
||||
foreach($container->GetPorts()->GetPorts() as $port) {
|
||||
foreach ($container->GetPorts()->GetPorts() as $port) {
|
||||
$portNumber = explode("/", $port);
|
||||
$requestBody['HostConfig']['PortBindings'][$port] = [
|
||||
[
|
||||
'HostPort' => $portNumber[0],
|
||||
]
|
||||
];
|
||||
if ($this->configurationManager->GetApachePort() === $portNumber[0] && $this->configurationManager->GetApacheIPBinding() !== '') {
|
||||
$requestBody['HostConfig']['PortBindings'][$port] = [
|
||||
[
|
||||
'HostPort' => $portNumber[0],
|
||||
'HostIp' => $this->configurationManager->GetApacheIPBinding(),
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$requestBody['HostConfig']['PortBindings'][$port] = [
|
||||
[
|
||||
'HostPort' => $portNumber[0],
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue