Skip to content

Commit

Permalink
Merge pull request #3515 from nextcloud/enh/3461/do-not-expose-udp
Browse files Browse the repository at this point in the history
  • Loading branch information
szaimen authored Oct 18, 2023
2 parents 3f5854c + b56555e commit 1daacdf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,17 @@ public function CreateContainer(Container $container) : void {
if ($container->GetInternalPort() !== 'host') {
foreach($container->GetPorts()->GetPorts() as $value) {
$port = $value->port;
$protocol = $value->protocol;
if ($port === '%APACHE_PORT%') {
$port = $this->configurationManager->GetApachePort();
// Do not expose udp if AIO is in reverse proxy mode
if ($port !== '443' && $protocol === 'udp') {
continue;
}
} else if ($port === '%TALK_PORT%') {
$port = $this->configurationManager->GetTalkPort();
}
$portWithProtocol = $port . '/' . $value->protocol;
$portWithProtocol = $port . '/' . $protocol;
$exposedPorts[$portWithProtocol] = null;
}
$requestBody['HostConfig']['NetworkMode'] = 'nextcloud-aio';
Expand All @@ -442,16 +447,20 @@ public function CreateContainer(Container $container) : void {
$requestBody['ExposedPorts'] = $exposedPorts;
foreach ($container->GetPorts()->GetPorts() as $value) {
$port = $value->port;
$protocol = $value->protocol;
if ($port === '%APACHE_PORT%') {
$port = $this->configurationManager->GetApachePort();
// Do not expose udp if AIO is in reverse proxy mode
if ($port !== '443' && $protocol === 'udp') {
continue;
}
} else if ($port === '%TALK_PORT%') {
$port = $this->configurationManager->GetTalkPort();
}
$ipBinding = $value->ipBinding;
if ($ipBinding === '%APACHE_IP_BINDING%') {
$ipBinding = $this->configurationManager->GetApacheIPBinding();
}
$protocol = $value->protocol;
$portWithProtocol = $port . '/' . $protocol;
$requestBody['HostConfig']['PortBindings'][$portWithProtocol] = [
[
Expand Down

0 comments on commit 1daacdf

Please sign in to comment.