Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Fix Traefik warning persistence after proxy restart

Andras Bacsaie110e3232075
diff --git a/app/Listeners/ProxyStatusChangedNotification.php b/app/Listeners/ProxyStatusChangedNotification.php
index 7b23724e29..1d99e70571 100644
--- a/app/Listeners/ProxyStatusChangedNotification.php
+++ b/app/Listeners/ProxyStatusChangedNotification.php
@@ -2,10 +2,13 @@
namespace App\Listeners;
+use App\Enums\ProxyTypes;
use App\Events\ProxyStatusChanged;
use App\Events\ProxyStatusChangedUI;
+use App\Jobs\CheckTraefikVersionForServerJob;
use App\Models\Server;
use Illuminate\Contracts\Queue\ShouldQueueAfterCommit;
+use Illuminate\Support\Facades\Log;
class ProxyStatusChangedNotification implements ShouldQueueAfterCommit
{
@@ -32,6 +35,19 @@ class ProxyStatusChangedNotification implements ShouldQueueAfterCommit
$server->setupDynamicProxyConfiguration();
$server->proxy->force_stop = false;
$server->save();
+
+ // Check Traefik version after proxy is running
+ if ($server->proxyType() === ProxyTypes::TRAEFIK->value) {
+ $traefikVersions = get_traefik_versions();
+ if ($traefikVersions !== null) {
+ CheckTraefikVersionForServerJob::dispatch($server, $traefikVersions);
+ } else {
+ Log::warning('Traefik version check skipped after proxy status change: versions.json data unavailable', [
+ 'server_id' => $server->id,
+ 'server_name' => $server->name,
+ ]);
+ }
+ }
}
if ($status === 'created') {
instant_remote_process([
diff --git a/app/Livewire/Server/Navbar.php b/app/Livewire/Server/Navbar.php
index 6725e5d0ac..11effcdc44 100644
--- a/app/Livewire/Server/Navbar.php
+++ b/app/Livewire/Server/Navbar.php
@@ -5,12 +5,9 @@ namespace App\Livewire\Server;
use App\Actions\Proxy\CheckProxy;
use App\Actions\Proxy\StartProxy;
use App\Actions\Proxy\StopProxy;
-use App\Enums\ProxyTypes;
-use App\Jobs\CheckTraefikVersionForServerJob;
use App\Models\Server;
use App\Services\ProxyDashboardCacheService;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-use Illuminate\Support\Facades\Log;
use Livewire\Component;
class Navbar extends Component
@@ -70,19 +67,6 @@ class Navbar extends Component
$activity = StartProxy::run($this->server, force: true, restarting: true);
$this->dispatch('activityMonitor', $activity->id);
-
- // Check Traefik version after restart to provide immediate feedback
- if ($this->server->proxyType() === ProxyTypes::TRAEFIK->value) {
- $traefikVersions = get_traefik_versions();
- if ($traefikVersions !== null) {
- CheckTraefikVersionForServerJob::dispatch($this->server, $traefikVersions);
- } else {
- Log::warning('Traefik version check skipped: versions.json data unavailable', [
- 'server_id' => $this->server->id,
- 'server_name' => $this->server->name,
- ]);
- }
- }
} catch (\Throwable $e) {
return handleError($e, $this);
}