diff --git a/develop.md b/develop.md index 6c5faf2d..457b3a76 100644 --- a/develop.md +++ b/develop.md @@ -67,6 +67,6 @@ docker buildx build --file Containers/nextcloud/Dockerfile --tag ghcr.io/nextclo # For all other containers docker buildx build --file Containers/{container}/Dockerfile --tag ghcr.io/nextcloud-releases/aio-{container}:develop --load Containers/{container} ``` -1. Stop the containers using the AIO admin interface. -1. Reload the AIO admin interface with the param `bypass_container_update` to avoid overwriting your local changes, e.g. `https://localhost:8080/containers?bypass_container_update`. +1. Stop the containers using the AIO interface. +1. Reload the AIO interface with the param `bypass_container_update` to avoid overwriting your local changes, e.g. `https://localhost:8080/containers?bypass_container_update`. 1. Click "Start and update containers" and test your changes. Containers will not be updated, despite the button text. diff --git a/manual-upgrade.md b/manual-upgrade.md index 84c742e5..fbc07d3e 100644 --- a/manual-upgrade.md +++ b/manual-upgrade.md @@ -108,7 +108,7 @@ However, if you are unsure check the ghcr.io (https://github.com/nextcloud-relea Once you see no more activities in the logs or a message like ```NOTICE: ready to handle connections```, we've done it! -#### Now you can handle everything through the AIO admin interface and stop and restart the containers normally. +#### Now you can handle everything through the AIO interface and stop and restart the containers normally. --- diff --git a/php/public/index.php b/php/public/index.php index d3fbbeb9..6406d1b0 100644 --- a/php/public/index.php +++ b/php/public/index.php @@ -87,6 +87,7 @@ $app->get('/containers', function (Request $request, Response $response, array $ $params = $request->getQueryParams(); $bypass_mastercontainer_update = isset($params['bypass_mastercontainer_update']); $bypass_container_update = isset($params['bypass_container_update']); + $skip_domain_validation = isset($params['skip_domain_validation']); return $view->render($response, 'containers.twig', [ 'domain' => $configurationManager->GetDomain(), @@ -116,7 +117,7 @@ $app->get('/containers', function (Request $request, Response $response, array $ 'daily_backup_time' => $configurationManager->GetDailyBackupTime(), 'is_daily_backup_running' => $configurationManager->isDailyBackupRunning(), 'timezone' => $configurationManager->GetTimezone(), - 'skip_domain_validation' => $configurationManager->shouldDomainValidationBeSkipped(), + 'skip_domain_validation' => ( $skip_domain_validation ? true : $configurationManager->shouldDomainValidationBeSkipped(false) ), 'talk_port' => $configurationManager->GetTalkPort(), 'collabora_dictionaries' => $configurationManager->GetCollaboraDictionaries(), 'collabora_additional_options' => $configurationManager->GetAdditionalCollaboraOptions(), diff --git a/php/src/Controller/ConfigurationController.php b/php/src/Controller/ConfigurationController.php index 5727c364..051f8d9e 100644 --- a/php/src/Controller/ConfigurationController.php +++ b/php/src/Controller/ConfigurationController.php @@ -19,7 +19,8 @@ readonly class ConfigurationController { try { if (isset($request->getParsedBody()['domain'])) { $domain = $request->getParsedBody()['domain'] ?? ''; - $this->configurationManager->SetDomain($domain); + $skipDomainValidation = isset($request->getParsedBody()['skip_domain_validation']); + $this->configurationManager->SetDomain($domain, $skipDomainValidation); } if (isset($request->getParsedBody()['current-master-password']) || isset($request->getParsedBody()['new-master-password'])) { diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index b9163baa..a04158dc 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -288,7 +288,7 @@ class ConfigurationManager /** * @throws InvalidSettingConfigurationException */ - public function SetDomain(string $domain) : void { + public function SetDomain(string $domain, bool $skipDomainValidation) : void { // Validate that at least one dot is contained if (!str_contains($domain, '.')) { throw new InvalidSettingConfigurationException("Domain must contain at least one dot!"); @@ -315,7 +315,7 @@ class ConfigurationManager } // Skip domain validation if opted in to do so - if (!$this->shouldDomainValidationBeSkipped()) { + if (!$this->shouldDomainValidationBeSkipped($skipDomainValidation)) { $dnsRecordIP = gethostbyname($domain); if ($dnsRecordIP === $domain) { @@ -898,8 +898,9 @@ class ConfigurationManager $this->WriteConfig($config); } - public function shouldDomainValidationBeSkipped() : bool { - if (getenv('SKIP_DOMAIN_VALIDATION') === 'true') { + public function shouldDomainValidationBeSkipped(bool $skipDomainValidation) : bool { + if ($skipDomainValidation || getenv('SKIP_DOMAIN_VALIDATION') === 'true') { + error_log('Skipping domain validation'); return true; } return false; diff --git a/php/templates/containers.twig b/php/templates/containers.twig index 5d479538..90156bf8 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -112,6 +112,9 @@ + {% if skip_domain_validation == true %} + + {% endif %} {% if skip_domain_validation == false %} diff --git a/readme.md b/readme.md index 6290c1e5..49ac1d1f 100644 --- a/readme.md +++ b/readme.md @@ -376,6 +376,8 @@ Apart from that there is now a community container that can be added to the AIO ### How to skip the domain validation? If you are completely sure that you've configured everything correctly and are not able to pass the domain validation, you may skip the domain validation by adding `--env SKIP_DOMAIN_VALIDATION=true` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/all-in-one:latest`! If it was started already, you will need to stop the mastercontainer, remove it (no data will be lost) and recreate it using the docker run command that you initially used). +Alternatively, if the container is already running, reload the AIO interface with the param `skip_domain_validation` to skip the domain validation on the fly: e.g. `https://ip.address.of.the.server:8080/containers?skip_domain_validation`. + ### How to resolve firewall problems with Fedora Linux, RHEL OS, CentOS, SUSE Linux and others? It is known that Linux distros that use [firewalld](https://firewalld.org) as their firewall daemon have problems with docker networks. In case the containers are not able to communicate with each other, you may change your firewalld to use the iptables backend by running: ``` diff --git a/reverse-proxy.md b/reverse-proxy.md index b1eb353c..52c830e0 100644 --- a/reverse-proxy.md +++ b/reverse-proxy.md @@ -1049,7 +1049,7 @@ ghcr.io/nextcloud-releases/all-in-one:latest - `--env APACHE_PORT=11000` This is the port that is published on the host that runs Docker and Nextcloud AIO at which the reverse proxy should point at. - `--env APACHE_IP_BINDING=0.0.0.0` This can be modified to allow access to the published port on the host only from certain ip-addresses. [See this documentation](#3-limit-the-access-to-the-apache-container) - `--env APACHE_ADDITIONAL_NETWORK=""` This can be used to put the sibling apache container that is created by AIO into a specified network - useful if your reverse proxy runs as a container on the same host. [See this documentation](#adapting-the-sample-web-server-configurations-below) -- `--env SKIP_DOMAIN_VALIDATION=false` This can be set to `true` if the domain validation does not work and you are sure that you configured everything correctly after you followed [the debug documentation](#7-how-to-debug-things). +- `--env SKIP_DOMAIN_VALIDATION=false` This can be set to `true` if the domain validation does not work and you are sure that you configured everything correctly after you followed [the debug documentation](#7-how-to-debug-things). Also see [this documentation](https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation). - `--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config` This means that the files that are created by the mastercontainer will be stored in a docker volume that is called `nextcloud_aio_mastercontainer`. This line is not allowed to be changed, since built-in backups would fail later on. - `--volume /var/run/docker.sock:/var/run/docker.sock:ro` The docker socket is mounted into the container which is used for spinning up all the other containers and for further features. It needs to be adjusted on Windows/macOS and on docker rootless. See the applicable documentation on this. If adjusting, don't forget to also set `WATCHTOWER_DOCKER_SOCKET_PATH`! If you dislike this, see https://github.com/nextcloud/all-in-one/tree/main/manual-install. - `ghcr.io/nextcloud-releases/all-in-one:latest` This is the docker container image that is used. @@ -1162,7 +1162,7 @@ If something does not work, follow the steps below: 1. Check if you have a public IPv4- and public IPv6-address. If you only have a public IPv6-address (e.g. due to DS-Lite), make sure to enable IPv6 in Docker and your whole networking infrastructure (e.g. also by adding an AAAA DNS-entry to your domain)! 1. [Enable Hairpin NAT in your router](https://github.com/nextcloud/all-in-one/discussions/5849) or [set up a local DNS server and add a custom dns-record](https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally) that allows the server to reach itself locally 1. Try to configure everything from scratch - if it still does not work by following https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance. -1. As last resort, you may disable the domain validation by adding `--env SKIP_DOMAIN_VALIDATION=true` to the docker run command. But only use this if you are completely sure that you've correctly configured everything! +1. As last resort, you may disable the domain validation by adding `--env SKIP_DOMAIN_VALIDATION=true` to the docker run command. But only use this if you are completely sure that you've correctly configured everything! Also see [this documentation](https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation). ### 8. Removing the reverse proxy