Skip to content

Commit

Permalink
display warning if domaincheck container could not be started instead…
Browse files Browse the repository at this point in the history
… of bugging out

Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Jul 19, 2023
1 parent 70b4609 commit 54d9181
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions php/containers.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@
"protocol": "tcp"
}
],
"internal_port": "%APACHE_PORT%",
"environment": [
"INSTANCE_ID=%INSTANCE_ID%",
"APACHE_PORT=%APACHE_PORT%"
Expand Down
2 changes: 1 addition & 1 deletion php/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@
}
});

$errorMiddleware = $app->addErrorMiddleware(true, true, true);
$errorMiddleware = $app->addErrorMiddleware(false, true, true);

$app->run();
6 changes: 5 additions & 1 deletion php/src/Controller/DockerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ public function StartDomaincheckContainer() : void
}

$this->StopDomaincheckContainer();
$this->PerformRecursiveContainerStart($id);
try {
$this->PerformRecursiveContainerStart($id);
} catch (\Exception $e) {
error_log('Could not start domaincheck container: ' . $e->getMessage());
}

// Cache the start for 10 minutes
apcu_add($cacheKey, '1', 600);
Expand Down
9 changes: 8 additions & 1 deletion php/templates/containers.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
{% set isAnyRunning = false %}
{% set isAnyRestarting = false %}
{% set isWatchtowerRunning = false %}
{% set isDomaincheckRunning = false %}
{% set isBackupOrRestoreRunning = false %}
{% set isApacheStarting = false %}
{# Setting newMajorVersion to '' will hide corresponding options/elements, can be set to an integer like 26 in order to show corresponding elements. If set, also increase installLatestMajor in https://github.com/nextcloud/all-in-one/blob/main/php/src/Controller/DockerController.php #}
Expand All @@ -45,6 +46,9 @@
{% if container.GetIdentifier() == 'nextcloud-aio-watchtower' and class(container.GetRunningState()) == 'AIO\\Container\\State\\RunningState' %}
{% set isWatchtowerRunning = true %}
{% endif %}
{% if container.GetIdentifier() == 'nextcloud-aio-domaincheck' and class(container.GetRunningState()) == 'AIO\\Container\\State\\RunningState' %}
{% set isDomaincheckRunning = true %}
{% endif %}
{% if container.GetIdentifier() == 'nextcloud-aio-apache' and class(container.GetStartingState()) == 'AIO\\Container\\State\\StartingState' %}
{% set isApacheStarting = true %}
{% endif %}
Expand All @@ -69,7 +73,10 @@
<a href="" class="button reload">Reload ↻</a><br/>
{% else %}
{% if is_backup_container_running == false and domain == "" %}
{% if is_mastercontainer_update_available == true %}
{% if isDomaincheckRunning == false %}
<h2>Domaincheck container is not running</h2>
This is not expected. Most likely this happened because port {{ apache_port }} is already in use on your server. You can check the mastercontainer logs and domaincheck container logs for further clues. You should be able to resolve this by adjusting the APACHE_PORT by following the <b><a href="https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md">reverse proxy documentation</a></b>. Advice: have a detailed look at the changed docker run command for AIO.
{% elseif is_mastercontainer_update_available == true %}
<h2>Mastercontainer update</h2>
⚠️ A mastercontainer update is available. Please click on the button below to update it. Afterwards, you will be able to proceed with the setup.<br><br>
<form method="POST" action="/api/docker/watchtower" class="xhr">
Expand Down

0 comments on commit 54d9181

Please sign in to comment.