fix: server validation

This commit is contained in:
Andras Bacsai
2024-02-22 11:28:45 +01:00
parent 5179129a6b
commit 4ae2087c2e
4 changed files with 81 additions and 51 deletions

View File

@@ -398,10 +398,10 @@ class Server extends BaseModel
}
});
if ($supported->count() === 1) {
ray('supported');
// ray('supported');
return str($supported->first());
} else {
ray('not supported');
// ray('not supported');
return false;
}
}
@@ -468,6 +468,16 @@ class Server extends BaseModel
}
return false;
}
try {
$dockerRunning = instant_remote_process(["docker version"], $this);
} catch (\Throwable $e) {
$this->settings->is_usable = false;
$this->settings->save();
if ($throwError) {
throw new \Exception('Server is not usable. Docker Engine is not running.');
}
return false;
}
$this->settings->is_usable = true;
$this->settings->save();
$this->validateCoolifyNetwork(isSwarm: false, isBuildServer: $this->settings->is_build_server);