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.

feat: if proxy stopped manually, it won't start back again

Andras Bacsaicccf86d388f0
diff --git a/app/Actions/Proxy/CheckProxy.php b/app/Actions/Proxy/CheckProxy.php
index 6f0bbddeed..8804eba230 100644
--- a/app/Actions/Proxy/CheckProxy.php
+++ b/app/Actions/Proxy/CheckProxy.php
@@ -13,7 +13,9 @@ class CheckProxy
if (!$server->isFunctional()) {
return false;
}
- if ($server->proxyType() === 'NONE') {
+ $proxyType = $server->proxyType();
+ if (is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop) {
+ ray('Not starting proxy');
return false;
}
['uptime' => $uptime, 'error' => $error] = $server->validateConnection();
diff --git a/app/Actions/Proxy/StartProxy.php b/app/Actions/Proxy/StartProxy.php
index 5b1ffa4096..3e41708d4a 100644
--- a/app/Actions/Proxy/StartProxy.php
+++ b/app/Actions/Proxy/StartProxy.php
@@ -15,7 +15,7 @@ class StartProxy
{
try {
$proxyType = $server->proxyType();
- if (is_null($proxyType) || $proxyType === 'NONE') {
+ if (is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop) {
return 'OK';
}
$commands = collect([]);
diff --git a/app/Listeners/ProxyStartedNotification.php b/app/Listeners/ProxyStartedNotification.php
index e6be605ce5..1a4fe97bbb 100644
--- a/app/Listeners/ProxyStartedNotification.php
+++ b/app/Listeners/ProxyStartedNotification.php
@@ -17,5 +17,7 @@ class ProxyStartedNotification
$this->server = data_get($event, 'data');
$this->server->setupDefault404Redirect();
$this->server->setupDynamicProxyConfiguration();
+ $this->server->proxy->force_stop = false;
+ $this->server->save();
}
}
diff --git a/app/Livewire/Server/Proxy/Deploy.php b/app/Livewire/Server/Proxy/Deploy.php
index 82925c3964..2ebaa1a38f 100644
--- a/app/Livewire/Server/Proxy/Deploy.php
+++ b/app/Livewire/Server/Proxy/Deploy.php
@@ -86,17 +86,15 @@ class Deploy extends Component
instant_remote_process([
"docker service rm coolify-proxy_traefik",
], $this->server);
- $this->server->proxy->status = 'exited';
- $this->server->save();
- $this->dispatch('proxyStatusUpdated');
} else {
instant_remote_process([
"docker rm -f coolify-proxy",
], $this->server);
- $this->server->proxy->status = 'exited';
- $this->server->save();
- $this->dispatch('proxyStatusUpdated');
}
+ $this->server->proxy->status = 'exited';
+ $this->server->proxy->force_stop = true;
+ $this->server->save();
+ $this->dispatch('proxyStatusUpdated');
} catch (\Throwable $e) {
return handleError($e, $this);
}