mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +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
|
|
@ -114,6 +114,13 @@ It is set to '$APACHE_PORT'."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$APACHE_IP_BINDING" ]; then
|
||||||
|
if ! echo "$APACHE_IP_BINDING" | grep -q '^[0-9.]\+$'; then
|
||||||
|
echo "You provided an ip-address for the apache container's ip-binding but it was not a valid ip-address.
|
||||||
|
It is set to '$APACHE_IP_BINDING'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
if [ -n "$TALK_PORT" ]; then
|
if [ -n "$TALK_PORT" ]; then
|
||||||
if ! check_if_number "$TALK_PORT"; then
|
if ! check_if_number "$TALK_PORT"; then
|
||||||
echo "You provided an Talk port but did not only use numbers.
|
echo "You provided an Talk port but did not only use numbers.
|
||||||
|
|
|
||||||
|
|
@ -599,4 +599,11 @@ class ConfigurationManager
|
||||||
$config['collabora_dictionaries'] = '';
|
$config['collabora_dictionaries'] = '';
|
||||||
$this->WriteConfig($config);
|
$this->WriteConfig($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetApacheIPBinding() : string {
|
||||||
|
$envVariableName = 'APACHE_IP_BINDING';
|
||||||
|
$configName = 'apache_ip_binding';
|
||||||
|
$defaultValue = '';
|
||||||
|
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -314,8 +314,16 @@ class DockerActionManager
|
||||||
|
|
||||||
if(count($exposedPorts) > 0) {
|
if(count($exposedPorts) > 0) {
|
||||||
$requestBody['ExposedPorts'] = $exposedPorts;
|
$requestBody['ExposedPorts'] = $exposedPorts;
|
||||||
foreach($container->GetPorts()->GetPorts() as $port) {
|
foreach ($container->GetPorts()->GetPorts() as $port) {
|
||||||
$portNumber = explode("/", $port);
|
$portNumber = explode("/", $port);
|
||||||
|
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] = [
|
$requestBody['HostConfig']['PortBindings'][$port] = [
|
||||||
[
|
[
|
||||||
'HostPort' => $portNumber[0],
|
'HostPort' => $portNumber[0],
|
||||||
|
|
@ -323,6 +331,7 @@ class DockerActionManager
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Special things for the backup container which should not be exposed in the containers.json
|
// Special things for the backup container which should not be exposed in the containers.json
|
||||||
if ($container->GetIdentifier() === 'nextcloud-aio-borgbackup') {
|
if ($container->GetIdentifier() === 'nextcloud-aio-borgbackup') {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
# Environmental variables
|
# Environmental variables
|
||||||
|
|
||||||
- [ ] When starting the mastercontainer with `-e APACHE_PORT=11000` on a clean instance, the domaincheck container should be started with that same port published. That makes sure that also the Apache container will use that port later on. Using a value here that is not a port will not allow the mastercontainer to start correctly.
|
- [ ] When starting the mastercontainer with `-e APACHE_PORT=11000` on a clean instance, the domaincheck container should be started with that same port published. That makes sure that also the Apache container will use that port later on. Using a value here that is not a port will not allow the mastercontainer to start correctly.
|
||||||
|
- [ ] When starting the mastercontainer with `-e APACHE_IP_BINDING=127.0.0.1` on a clean instance, the domaincheck container's apache port should only listen on localhost on the host. Using a value here that is not a number or dot will not allow the mastercontainer to start correctly.
|
||||||
- [ ] When starting the mastercontainer with `-e TALK_PORT=3479` on a clean instance, the talk container should use this port later on. Using a value here that is not a port will not allow the mastercontainer to start correctly. Also it should stop if apache_port and talk_port are set to the same value.
|
- [ ] When starting the mastercontainer with `-e TALK_PORT=3479` on a clean instance, the talk container should use this port later on. Using a value here that is not a port will not allow the mastercontainer to start correctly. Also it should stop if apache_port and talk_port are set to the same value.
|
||||||
- [ ] Make also sure that reverse proxies work by following https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#reverse-proxy-documentation and following [001-initial-setup.md](./001-initial-setup.md) and [002-new-instance.md](./002-new-instance.md)
|
- [ ] Make also sure that reverse proxies work by following https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#reverse-proxy-documentation and following [001-initial-setup.md](./001-initial-setup.md) and [002-new-instance.md](./002-new-instance.md)
|
||||||
- [ ] When starting the mastercontainer with `-e SKIP_DOMAIN_VALIDATION=true` on a clean instance, it should skip the domain verification. So it should accept any domain that you type in then.
|
- [ ] When starting the mastercontainer with `-e SKIP_DOMAIN_VALIDATION=true` on a clean instance, it should skip the domain verification. So it should accept any domain that you type in then.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue