diff --git a/app/Actions/Database/StartMariadb.php b/app/Actions/Database/StartMariadb.php index f44008085..c4f98cfdf 100644 --- a/app/Actions/Database/StartMariadb.php +++ b/app/Actions/Database/StartMariadb.php @@ -211,7 +211,7 @@ public function handle(StandaloneMariadb $database) $this->commands[] = dockerStopCommand(10, $container_name, $this->database->destination->server).' 2>/dev/null || true'; $this->commands[] = "docker rm -f $container_name 2>/dev/null || true"; if ($this->database->enable_ssl) { - $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml run --rm --no-deps --user root --entrypoint chown $container_name mysql:mysql /etc/mysql/certs/server.key /etc/mysql/certs/server.crt"; + $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml run --rm --no-deps --user root --entrypoint chown $container_name mysql:mysql /etc/mysql/certs/server.key /etc/mysql/certs/server.crt < /dev/null"; } $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml up -d"; $this->commands[] = "echo 'Database started.'"; diff --git a/app/Actions/Database/StartMongodb.php b/app/Actions/Database/StartMongodb.php index b31251ce2..0f9bba679 100644 --- a/app/Actions/Database/StartMongodb.php +++ b/app/Actions/Database/StartMongodb.php @@ -260,7 +260,7 @@ public function handle(StandaloneMongodb $database) $this->commands[] = dockerStopCommand(10, $container_name, $this->database->destination->server).' 2>/dev/null || true'; $this->commands[] = "docker rm -f $container_name 2>/dev/null || true"; if ($this->database->enable_ssl) { - $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml run --rm --no-deps --user root --entrypoint chown $container_name mongodb:mongodb /etc/mongo/certs/server.pem"; + $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml run --rm --no-deps --user root --entrypoint chown $container_name mongodb:mongodb /etc/mongo/certs/server.pem < /dev/null"; } $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml up -d"; $this->commands[] = "echo 'Database started.'"; diff --git a/app/Actions/Database/StartMysql.php b/app/Actions/Database/StartMysql.php index 16b8e1585..3eab00464 100644 --- a/app/Actions/Database/StartMysql.php +++ b/app/Actions/Database/StartMysql.php @@ -212,7 +212,7 @@ public function handle(StandaloneMysql $database) $this->commands[] = dockerStopCommand(10, $container_name, $this->database->destination->server).' 2>/dev/null || true'; $this->commands[] = "docker rm -f $container_name 2>/dev/null || true"; if ($this->database->enable_ssl) { - $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml run --rm --no-deps --user root --entrypoint chown $container_name mysql:mysql /etc/mysql/certs/server.key /etc/mysql/certs/server.crt"; + $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml run --rm --no-deps --user root --entrypoint chown $container_name mysql:mysql /etc/mysql/certs/server.key /etc/mysql/certs/server.crt < /dev/null"; } $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml up -d"; diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.php index 3b0f820df..21cb278fb 100644 --- a/app/Actions/Database/StartPostgresql.php +++ b/app/Actions/Database/StartPostgresql.php @@ -222,7 +222,7 @@ public function handle(StandalonePostgresql $database) $this->commands[] = dockerStopCommand(10, $container_name, $this->database->destination->server).' 2>/dev/null || true'; $this->commands[] = "docker rm -f $container_name 2>/dev/null || true"; if ($this->database->enable_ssl) { - $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml run --rm --no-deps --user root --entrypoint chown $container_name postgres:postgres /var/lib/postgresql/certs/server.key /var/lib/postgresql/certs/server.crt"; + $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml run --rm --no-deps --user root --entrypoint chown $container_name postgres:postgres /var/lib/postgresql/certs/server.key /var/lib/postgresql/certs/server.crt < /dev/null"; } $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml up -d"; $this->commands[] = "echo 'Database started.'"; diff --git a/app/Models/S3Storage.php b/app/Models/S3Storage.php index e8e1788e3..e4b1e2fd6 100644 --- a/app/Models/S3Storage.php +++ b/app/Models/S3Storage.php @@ -198,7 +198,7 @@ public function testConnection(bool $shouldSave = false) try { $mail = new MailMessage; $mail->subject('Coolify: S3 Storage Connection Error'); - $mail->view('emails.s3-connection-error', ['name' => $this->name, 'reason' => $exception->getMessage(), 'url' => route('storage.show', ['storage_uuid' => $this->uuid])]); + $mail->view('emails.s3-connection-error', ['name' => $this->name, 'reason' => $e->getMessage(), 'url' => base_url().'/storages/'.$this->uuid]); // Load the team with its members and their roles explicitly $team = $this->team()->with(['members' => function ($query) { diff --git a/app/Models/Server.php b/app/Models/Server.php index 1acc4e45f..0f5a35364 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -736,6 +736,9 @@ public function setupDynamicProxyConfiguration() ]; $traefik_dynamic_conf['http']['routers']['coolify-https'] = [ + 'middlewares' => [ + 0 => 'gzip', + ], 'entryPoints' => [ 0 => 'https', ], @@ -791,6 +794,7 @@ public function setupDynamicProxyConfiguration() $schema = $url->getScheme(); $caddy_file = " $schema://$host { + encode zstd gzip handle /app/* { reverse_proxy coolify-realtime:6001 } diff --git a/resources/views/livewire/upgrade.blade.php b/resources/views/livewire/upgrade.blade.php index f93c7bcea..97c08c035 100644 --- a/resources/views/livewire/upgrade.blade.php +++ b/resources/views/livewire/upgrade.blade.php @@ -295,6 +295,16 @@ class="flex flex-wrap items-center justify-end gap-2 border-t border-neutral-200 } throw error; } + if (!data) { + if (this.instanceWentDown) { + // The upgraded instance can no longer return data for the old Livewire component. + // A healthy response after observed downtime confirms that the restart completed. + this.showSuccess(); + } else { + this.currentStatus = this.getReviveStatusMessage(elapsedMinutes, this.healthCheckAttempts); + } + return; + } if (data.status === 'complete') { this.showSuccess(); } else if (data.status === 'error') { diff --git a/tests/Unit/CoolifyUpgradeStatusTest.php b/tests/Unit/CoolifyUpgradeStatusTest.php index a00283615..2248e382b 100644 --- a/tests/Unit/CoolifyUpgradeStatusTest.php +++ b/tests/Unit/CoolifyUpgradeStatusTest.php @@ -149,6 +149,16 @@ ->toContain('return;'); }); +it('finishes when the post-restart Livewire status response is undefined', function () { + $upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php'); + + expect($upgradeView) + ->toContain('if (!data) {') + ->toContain('if (this.instanceWentDown) {') + ->toContain('this.showSuccess();') + ->toContain('return;'); +}); + it('tells users to reload manually if the automatic reload does not happen', function () { $upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');