mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-06-10 08:37:02 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e746abd156 | |||
| 2121fec318 |
@@ -105,6 +105,7 @@ $app->post('/api/docker/restore', AIO\Controller\DockerController::class . ':Sta
|
|||||||
$app->post('/api/docker/stop', AIO\Controller\DockerController::class . ':StopContainer');
|
$app->post('/api/docker/stop', AIO\Controller\DockerController::class . ':StopContainer');
|
||||||
$app->post('/api/docker/backup-reset-location', AIO\Controller\DockerController::class . ':DeleteBorgBackupConfig');
|
$app->post('/api/docker/backup-reset-location', AIO\Controller\DockerController::class . ':DeleteBorgBackupConfig');
|
||||||
$app->post('/api/docker/prune', AIO\Controller\DockerController::class . ':SystemPrune');
|
$app->post('/api/docker/prune', AIO\Controller\DockerController::class . ':SystemPrune');
|
||||||
|
$app->post('/api/docker/pull-images', AIO\Controller\DockerController::class . ':PullImages');
|
||||||
$app->get('/api/docker/logs', AIO\Controller\DockerController::class . ':GetLogs');
|
$app->get('/api/docker/logs', AIO\Controller\DockerController::class . ':GetLogs');
|
||||||
$app->post('/api/auth/login', AIO\Controller\LoginController::class . ':TryLogin');
|
$app->post('/api/auth/login', AIO\Controller\LoginController::class . ':TryLogin');
|
||||||
$app->get('/api/auth/getlogin', AIO\Controller\LoginController::class . ':GetTryLogin');
|
$app->get('/api/auth/getlogin', AIO\Controller\LoginController::class . ':GetTryLogin');
|
||||||
|
|||||||
@@ -45,15 +45,15 @@ readonly class DockerController {
|
|||||||
$this->dockerActionManager->ConnectContainerToNetwork($container);
|
$this->dockerActionManager->ConnectContainerToNetwork($container);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function PerformRecursiveImagePull(string $id) : void {
|
private function PerformRecursiveImagePull(string $id, ?\Closure $addToStreamingResponseBody = null) : void {
|
||||||
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
||||||
|
|
||||||
// Pull all dependencies first and then itself
|
// Pull all dependencies first and then itself
|
||||||
foreach($container->dependsOn as $dependency) {
|
foreach($container->dependsOn as $dependency) {
|
||||||
$this->PerformRecursiveImagePull($dependency);
|
$this->PerformRecursiveImagePull($dependency, $addToStreamingResponseBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->dockerActionManager->PullImage($container, true);
|
$this->dockerActionManager->PullImage($container, true, $addToStreamingResponseBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function PullAllContainerImages(): void {
|
public function PullAllContainerImages(): void {
|
||||||
@@ -63,6 +63,19 @@ readonly class DockerController {
|
|||||||
$this->PerformRecursiveImagePull($id);
|
$this->PerformRecursiveImagePull($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function PullImages(Request $request, Response $response, array $args) : Response {
|
||||||
|
// Get streaming response start and closure
|
||||||
|
$nonbufResp = $this->startStreamingResponse($response);
|
||||||
|
$addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);
|
||||||
|
|
||||||
|
$id = self::TOP_CONTAINER;
|
||||||
|
$this->PerformRecursiveImagePull($id, $addToStreamingResponseBody);
|
||||||
|
|
||||||
|
// End streaming response
|
||||||
|
$this->finalizeStreamingResponse($nonbufResp);
|
||||||
|
return $nonbufResp;
|
||||||
|
}
|
||||||
|
|
||||||
public function GetLogs(Request $request, Response $response, array $args) : Response
|
public function GetLogs(Request $request, Response $response, array $args) : Response
|
||||||
{
|
{
|
||||||
$requestParams = $request->getQueryParams();
|
$requestParams = $request->getQueryParams();
|
||||||
|
|||||||
@@ -291,6 +291,14 @@
|
|||||||
{% if has_update_available == true %}
|
{% if has_update_available == true %}
|
||||||
{% if is_mastercontainer_update_available == false %}
|
{% if is_mastercontainer_update_available == false %}
|
||||||
<p>⚠️ Container updates are available. Click on <strong>Stop containers</strong> and <strong>Start and update containers</strong> to update them. You should consider creating a backup first.</p>
|
<p>⚠️ Container updates are available. Click on <strong>Stop containers</strong> and <strong>Start and update containers</strong> to update them. You should consider creating a backup first.</p>
|
||||||
|
{% if isAnyRunning == true and isApacheStarting != true %}
|
||||||
|
<p>Alternatively, you can already pull the new images now while the containers are still running. Depending on your internet connection and image sizes, this can take a few minutes. The new images will automatically be used whenever the containers are recreated – either manually via <strong>Stop containers</strong> + <strong>Start and update containers</strong>, or automatically via AIO's daily backup/update schedule.</p>
|
||||||
|
<form method="POST" action="api/docker/pull-images" target="overlay-log">
|
||||||
|
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||||
|
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||||
|
<input type="submit" value="Pull new images" />
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if is_mastercontainer_update_available == false %}
|
{% if is_mastercontainer_update_available == false %}
|
||||||
|
|||||||
Reference in New Issue
Block a user