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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: boarding again
Andras Bacsai9cba0a6df333
diff --git a/app/Actions/Server/InstallDocker.php b/app/Actions/Server/InstallDocker.phpindex 39d0718db0..2fb12d34c0 100644--- a/app/Actions/Server/InstallDocker.php+++ b/app/Actions/Server/InstallDocker.php@@ -7,7 +7,7 @@ use App\Models\StandaloneDocker;class InstallDocker{- public function __invoke(Server $server, bool $instant = false)+ public function __invoke(Server $server){$dockerVersion = '24.0';$config = base64_encode('{@@ -55,9 +55,6 @@ class InstallDocker"echo '####### Done!'"];}- if ($instant) {- return instant_remote_process($command, $server);- }return remote_process($command, $server);}}diff --git a/app/Data/CoolifyTaskArgs.php b/app/Data/CoolifyTaskArgs.phpindex 07d7c0c818..f73fd6318c 100644--- a/app/Data/CoolifyTaskArgs.php+++ b/app/Data/CoolifyTaskArgs.php@@ -17,8 +17,11 @@ class CoolifyTaskArgs extends Datapublic string $type,public ?string $type_uuid = null,public ?Model $model = null,- public string $status = ProcessStatus::QUEUED->value,+ public ?string $status = null ,public bool $ignore_errors = false,) {+ if(is_null($status)){+ $this->status = ProcessStatus::QUEUED->value;+ }}}diff --git a/app/Http/Livewire/Boarding/Index.php b/app/Http/Livewire/Boarding/Index.phpindex fc17843837..7c42df536d 100644--- a/app/Http/Livewire/Boarding/Index.php+++ b/app/Http/Livewire/Boarding/Index.php@@ -9,7 +9,6 @@ use App\Models\Server;use App\Models\Team;use Illuminate\Support\Collection;use Livewire\Component;-use Visus\Cuid2\Cuid2;class Index extends Component{@@ -40,8 +39,8 @@ class Index extends Componentpublic bool $dockerInstallationStarted = false;- public string $localhostPublicKey;- public bool $localhostReachable = true;+ public string $serverPublicKey;+ public bool $serverReachable = true;public function mount(){@@ -98,7 +97,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==if (!$this->createdServer) {return $this->emit('error', 'Localhost server is not found. Something went wrong during installation. Please try to reinstall or contact support.');}- $this->localhostPublicKey = $this->createdServer->privateKey->publicKey();+ $this->serverPublicKey = $this->createdServer->privateKey->publicKey();return $this->validateServer('localhost');} elseif ($this->selectedServerType === 'remote') {$this->privateKeys = PrivateKey::ownedByCurrentTeam(['name'])->where('id', '!=', 0)->get();@@ -123,6 +122,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==return;}$this->selectedExistingPrivateKey = $this->createdServer->privateKey->id;+ $this->serverPublicKey = $this->createdServer->privateKey->publicKey();$this->validateServer();}public function getProxyType()@@ -201,11 +201,11 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==instant_remote_process(['uptime'], $this->createdServer, true);- $this->createdServer->settings->update([+ $this->createdServer->settings()->update(['is_reachable' => true,]);} catch (\Throwable $e) {- $this->localhostReachable = false;+ $this->serverReachable = false;return handleError(error: $e, customErrorMessage: $customErrorMessage, livewire: $this);}@@ -216,8 +216,12 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==$this->currentState = 'install-docker';throw new \Exception('Docker version is not supported or not installed.');}- $this->dockerInstalledOrSkipped();+ $this->createdServer->settings()->update([+ 'is_usable' => true,+ ]);+ $this->getProxyType();} catch (\Throwable $e) {+ $this->dockerInstallationStarted = false;return handleError(error: $e, customErrorMessage: $customErrorMessage, livewire: $this);}}@@ -229,10 +233,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==}public function dockerInstalledOrSkipped(){- $this->createdServer->settings->update([- 'is_usable' => true,- ]);- $this->getProxyType();+ $this->validateServer();}public function selectProxy(string|null $proxyType = null){diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.phpindex 5982b46d85..7bf1947114 100644--- a/bootstrap/helpers/remoteProcess.php+++ b/bootstrap/helpers/remoteProcess.php@@ -18,12 +18,14 @@ use Spatie\Activitylog\Contracts\Activity;function remote_process(array $command,Server $server,- string $type = ActivityTypes::INLINE->value,+ ?string $type = null,?string $type_uuid = null,?Model $model = null,bool $ignore_errors = false,): Activity {-+ if (is_null($type)) {+ $type = ActivityTypes::INLINE->value;+ }$command_string = implode("\n", $command);if (auth()->user()) {$teams = auth()->user()->teams->pluck('id');diff --git a/bootstrap/helpers/subscriptions.php b/bootstrap/helpers/subscriptions.phpindex ac41b1a1d7..9ea76ec9b8 100644--- a/bootstrap/helpers/subscriptions.php+++ b/bootstrap/helpers/subscriptions.php@@ -138,5 +138,6 @@ function allowedPathsForBoardingAccounts()...allowedPathsForUnsubscribedAccounts(),'boarding','livewire/message/boarding.index',+ 'livewire/message/activity-monitor'];}diff --git a/resources/views/layouts/boarding.blade.php b/resources/views/layouts/boarding.blade.phpindex 39b1ae2526..fe48fc29b9 100644--- a/resources/views/layouts/boarding.blade.php+++ b/resources/views/layouts/boarding.blade.php@@ -1,17 +1,17 @@@extends('layouts.base')@section('body')+ <x-modal noSubmit modalId="installDocker">+ <x-slot:modalBody>+ <livewire:activity-monitor header="Docker Installation Logs" />+ </x-slot:modalBody>+ <x-slot:modalSubmit>+ <x-forms.button onclick="installDocker.close()" type="submit">+ Close+ </x-forms.button>+ </x-slot:modalSubmit>+ </x-modal><main class="min-h-screen hero"><div class="hero-content">- <x-modal modalId="installDocker">- <x-slot:modalBody>- <livewire:activity-monitor header="Docker Installation Logs" />- </x-slot:modalBody>- <x-slot:modalSubmit>- <x-forms.button onclick="installDocker.close()" type="submit">- Close- </x-forms.button>- </x-slot:modalSubmit>- </x-modal>{{ $slot }}</div></main>diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.phpindex b86320612e..37ed1cfd85 100644--- a/resources/views/livewire/boarding/index.blade.php+++ b/resources/views/livewire/boarding/index.blade.php@@ -50,13 +50,13 @@<x-forms.button class="justify-center box" wire:target="setServerType('remote')"wire:click="setServerType('remote')">Remote Server</x-forms.button>- @if (!$localhostReachable)+ @if (!$serverReachable)Localhost is not reachable with the following public key.<br /> <br />Please make sure you have the correct public key in your ~/.ssh/authorized_keys file for user'root' or skip the boarding process and add a new private key manually to Coolify and to theserver.- <x-forms.input readonly id="localhostPublicKey"></x-forms.input>+ <x-forms.input readonly id="serverPublicKey"></x-forms.input><x-forms.button class="box" wire:target="setServerType('localhost')"wire:click="setServerType('localhost')">Check again</x-forms.button>@@ -130,6 +130,17 @@<x-forms.button type="submit">Use this Server</x-forms.button></form></div>+ @if (!$serverReachable)+ This server is not reachable with the following public key.+ <br /> <br />+ Please make sure you have the correct public key in your ~/.ssh/authorized_keys file for user+ 'root' or skip the boarding process and add a new private key manually to Coolify and to the+ server.+ <x-forms.input readonly id="serverPublicKey"></x-forms.input>+ <x-forms.button class="box" wire:target="validateServer"+ wire:click="validateServer">Check again+ </x-forms.button>+ @endif</x-slot:actions><x-slot:explanation><p>Private Keys are used to connect to a remote server through a secure shell, called SSH.</p>@@ -214,10 +225,10 @@Could not find Docker Engine on your server. Do you want me to install it for you?</x-slot:question><x-slot:actions>+ @if ($dockerInstallationStarted)<x-forms.button class="justify-center box" wire:click="installDocker"onclick="installDocker.showModal()">Let's do it!</x-forms.button>- @if ($dockerInstallationStarted)<x-forms.button class="justify-center box" wire:click="dockerInstalledOrSkipped">Next</x-forms.button>@endif