feat: if proxy stopped manually, it won't start back again
This commit is contained in:
parent
c102c23831
commit
cccf86d388
@ -13,7 +13,9 @@ class CheckProxy
|
|||||||
if (!$server->isFunctional()) {
|
if (!$server->isFunctional()) {
|
||||||
return false;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
['uptime' => $uptime, 'error' => $error] = $server->validateConnection();
|
['uptime' => $uptime, 'error' => $error] = $server->validateConnection();
|
||||||
|
@ -15,7 +15,7 @@ class StartProxy
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$proxyType = $server->proxyType();
|
$proxyType = $server->proxyType();
|
||||||
if (is_null($proxyType) || $proxyType === 'NONE') {
|
if (is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop) {
|
||||||
return 'OK';
|
return 'OK';
|
||||||
}
|
}
|
||||||
$commands = collect([]);
|
$commands = collect([]);
|
||||||
|
@ -17,5 +17,7 @@ class ProxyStartedNotification
|
|||||||
$this->server = data_get($event, 'data');
|
$this->server = data_get($event, 'data');
|
||||||
$this->server->setupDefault404Redirect();
|
$this->server->setupDefault404Redirect();
|
||||||
$this->server->setupDynamicProxyConfiguration();
|
$this->server->setupDynamicProxyConfiguration();
|
||||||
|
$this->server->proxy->force_stop = false;
|
||||||
|
$this->server->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,17 +86,15 @@ class Deploy extends Component
|
|||||||
instant_remote_process([
|
instant_remote_process([
|
||||||
"docker service rm coolify-proxy_traefik",
|
"docker service rm coolify-proxy_traefik",
|
||||||
], $this->server);
|
], $this->server);
|
||||||
$this->server->proxy->status = 'exited';
|
|
||||||
$this->server->save();
|
|
||||||
$this->dispatch('proxyStatusUpdated');
|
|
||||||
} else {
|
} else {
|
||||||
instant_remote_process([
|
instant_remote_process([
|
||||||
"docker rm -f coolify-proxy",
|
"docker rm -f coolify-proxy",
|
||||||
], $this->server);
|
], $this->server);
|
||||||
|
}
|
||||||
$this->server->proxy->status = 'exited';
|
$this->server->proxy->status = 'exited';
|
||||||
|
$this->server->proxy->force_stop = true;
|
||||||
$this->server->save();
|
$this->server->save();
|
||||||
$this->dispatch('proxyStatusUpdated');
|
$this->dispatch('proxyStatusUpdated');
|
||||||
}
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user