mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
Merge pull request #4912 from nextcloud/no-listen
Implement internal mode
This commit is contained in:
commit
d304c791ff
4 changed files with 9 additions and 8 deletions
|
|
@ -180,7 +180,7 @@ It is set to '$APACHE_PORT'."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -n "$APACHE_IP_BINDING" ]; then
|
if [ -n "$APACHE_IP_BINDING" ]; then
|
||||||
if ! echo "$APACHE_IP_BINDING" | grep -q '^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$\|^[0-9a-f:]\+$'; then
|
if ! echo "$APACHE_IP_BINDING" | grep -q '^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$\|^[0-9a-f:]\+$\|^@INTERNAL$'; then
|
||||||
print_red "You provided an ip-address for the apache container's ip-binding but it was not a valid ip-address.
|
print_red "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'."
|
It is set to '$APACHE_IP_BINDING'."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aio_variables": [
|
"aio_variables": [
|
||||||
"apache_ip_binding=127.0.0.1",
|
"apache_ip_binding=@INTERNAL",
|
||||||
"apache_port=11000"
|
"apache_port=11000"
|
||||||
],
|
],
|
||||||
"nextcloud_exec_commands": [
|
"nextcloud_exec_commands": [
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,6 @@
|
||||||
"DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%",
|
"DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%",
|
||||||
"REMOVE_DISABLED_APPS=%REMOVE_DISABLED_APPS%",
|
"REMOVE_DISABLED_APPS=%REMOVE_DISABLED_APPS%",
|
||||||
"APACHE_PORT=%APACHE_PORT%",
|
"APACHE_PORT=%APACHE_PORT%",
|
||||||
"APACHE_IP_BINDING=%APACHE_IP_BINDING%",
|
|
||||||
"ADDITIONAL_TRUSTED_PROXY=%CADDY_IP_ADDRESS%",
|
"ADDITIONAL_TRUSTED_PROXY=%CADDY_IP_ADDRESS%",
|
||||||
"THIS_IS_AIO=true",
|
"THIS_IS_AIO=true",
|
||||||
"IMAGINARY_SECRET=%IMAGINARY_SECRET%"
|
"IMAGINARY_SECRET=%IMAGINARY_SECRET%"
|
||||||
|
|
|
||||||
|
|
@ -295,8 +295,6 @@ class DockerActionManager
|
||||||
$replacements[1] = $this->configurationManager->GetSelectedRestoreTime();
|
$replacements[1] = $this->configurationManager->GetSelectedRestoreTime();
|
||||||
} elseif ($out[1] === 'APACHE_PORT') {
|
} elseif ($out[1] === 'APACHE_PORT') {
|
||||||
$replacements[1] = $this->configurationManager->GetApachePort();
|
$replacements[1] = $this->configurationManager->GetApachePort();
|
||||||
} elseif ($out[1] === 'APACHE_IP_BINDING') {
|
|
||||||
$replacements[1] = $this->configurationManager->GetApacheIPBinding();
|
|
||||||
} elseif ($out[1] === 'TALK_PORT') {
|
} elseif ($out[1] === 'TALK_PORT') {
|
||||||
$replacements[1] = $this->configurationManager->GetTalkPort();
|
$replacements[1] = $this->configurationManager->GetTalkPort();
|
||||||
} elseif ($out[1] === 'NEXTCLOUD_MOUNT') {
|
} elseif ($out[1] === 'NEXTCLOUD_MOUNT') {
|
||||||
|
|
@ -478,6 +476,10 @@ class DockerActionManager
|
||||||
$ipBinding = $value->ipBinding;
|
$ipBinding = $value->ipBinding;
|
||||||
if ($ipBinding === '%APACHE_IP_BINDING%') {
|
if ($ipBinding === '%APACHE_IP_BINDING%') {
|
||||||
$ipBinding = $this->configurationManager->GetApacheIPBinding();
|
$ipBinding = $this->configurationManager->GetApacheIPBinding();
|
||||||
|
// Do not expose if AIO is in internal network mode
|
||||||
|
if ($ipBinding === '@INTERNAL') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$portWithProtocol = $port . '/' . $protocol;
|
$portWithProtocol = $port . '/' . $protocol;
|
||||||
$requestBody['HostConfig']['PortBindings'][$portWithProtocol] = [
|
$requestBody['HostConfig']['PortBindings'][$portWithProtocol] = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue