feat: implement prerequisite validation and installation for server setup

This commit is contained in:
Andras Bacsai
2025-11-21 09:49:33 +01:00
parent ce4f8d02a2
commit 01957f2752
9 changed files with 218 additions and 32 deletions

View File

@@ -320,6 +320,21 @@ class Index extends Component
return handleError(error: $e, livewire: $this);
}
try {
// Check prerequisites
$prerequisitesInstalled = $this->createdServer->validatePrerequisites();
if (! $prerequisitesInstalled) {
$this->createdServer->installPrerequisites();
// Recheck after installation
$prerequisitesInstalled = $this->createdServer->validatePrerequisites();
if (! $prerequisitesInstalled) {
throw new \Exception('Prerequisites (git, curl, jq) could not be installed. Please install them manually.');
}
}
} catch (\Throwable $e) {
return handleError(error: $e, livewire: $this);
}
try {
$dockerVersion = instant_remote_process(["docker version|head -2|grep -i version| awk '{print $2}'"], $this->createdServer, true);
$dockerVersion = checkMinimumDockerEngineVersion($dockerVersion);