From 75c2407afa4be55087093aa6076ee01bd039743c Mon Sep 17 00:00:00 2001 From: Apoorv Parle <19315187+apparle@users.noreply.github.com> Date: Mon, 4 Nov 2024 02:44:10 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Simon L. Signed-off-by: Apoorv Parle <19315187+apparle@users.noreply.github.com> --- php/src/Docker/DockerActionManager.php | 10 +++++----- reverse-proxy.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index bfd22c2a4ff..8cce610389f 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -850,7 +850,7 @@ private function ConnectContainerIdToNetwork(string $id, string $internalPort, s return; } - if($createNetwork) { + if ($createNetwork) { $url = $this->BuildApiUrl('networks/create'); try { $this->guzzleClient->request( @@ -876,9 +876,9 @@ private function ConnectContainerIdToNetwork(string $id, string $internalPort, s $url = $this->BuildApiUrl( sprintf('networks/%s/connect', $network) ); - $json_payload = [ 'Container' => $id ]; + $jsonPayload = [ 'Container' => $id ]; if ($alias !== '' ) { - $json_payload['EndpointConfig'] = [ 'Aliases' => [ $alias ] ]; + $jsonPayload['EndpointConfig'] = ['Aliases' => [ $alias ]]; } try { @@ -886,7 +886,7 @@ private function ConnectContainerIdToNetwork(string $id, string $internalPort, s 'POST', $url, [ - 'json' => $json_payload + 'json' => $jsonPayload ] ); } catch (RequestException $e) { @@ -921,7 +921,7 @@ public function ConnectContainerToNetwork(Container $container) : void if ($container->GetIdentifier() === 'nextcloud-aio-apache' || $container->GetIdentifier() === 'nextcloud-aio-domaincheck') { $apacheAdditionalNetwork = $this->configurationManager->GetApacheAdditionalNetwork(); if ($apacheAdditionalNetwork !== '') { - $this->ConnectContainerIdToNetwork($container->GetIdentifier(), $container->GetInternalPort(), $apacheAdditionalNetwork, false, alias: $alias); + $this->ConnectContainerIdToNetwork($container->GetIdentifier(), $container->GetInternalPort(), $apacheAdditionalNetwork, false, $alias); } } } diff --git a/reverse-proxy.md b/reverse-proxy.md index b58b5a20917..a7eea8c241c 100644 --- a/reverse-proxy.md +++ b/reverse-proxy.md @@ -46,7 +46,7 @@ All examples below will use port `11000` as `APACHE_PORT`. This port will be exp The reverse-proxy container needs to be connected to the nextcloud containers. This can be achieved one of these 3 ways: 1. Utilize host networking instead of docker bridge networking: Specify `--network host` option (or `network_mode: host` for docker-compose) as setting for the reverse proxy container to connect it to the host network. If you are using a firewall on the server, you need to open ports 80 and 443 for the reverse proxy manually. With this setup, the default sample configurations with reverse-proxy pointing to `localhost:$APACHE_PORT` should work directly. - 1. Connect nextcloud's external-facing containers to the reverse-proxy's docker network by specifying env variable APACHE_ADDITIONAL_NETWORK. With this setup, the reverse proxy can utilize Docker bridge network's DNS name resolution to access nextcloud at `http://nextcloud-aio-apache:$APACHE_PORT`. Note, the specified network must already exist before Nextcloud AIO is started. + 1. Connect nextcloud's external-facing containers to the reverse-proxy's docker network by specifying env variable APACHE_ADDITIONAL_NETWORK. With this setup, the reverse proxy can utilize Docker bridge network's DNS name resolution to access nextcloud at `http://nextcloud-aio-apache:$APACHE_PORT`. ⚠️⚠️⚠️ Note, the specified network must already exist before Nextcloud AIO is started. Otherwise it will fail to start the container because the network is not existing. 1. Connect the reverse-proxy container to the `nextcloud-aio` network by specifying it as a secondary (external) network for the reverse proxy container. With this setup also, the reverse proxy can utilize Docker bridge network's DNS name resolution to access nextcloud at `http://nextcloud-aio-apache:$APACHE_PORT` .