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.

fix boarding

Andras Bacsai5eb41e1a1527
diff --git a/app/Http/Livewire/Boarding/Index.php b/app/Http/Livewire/Boarding/Index.php
index d704f4f023..539751ceba 100644
--- a/app/Http/Livewire/Boarding/Index.php
+++ b/app/Http/Livewire/Boarding/Index.php
@@ -1,15 +1,20 @@
<?php
namespace App\Http\Livewire\Boarding;
+
use App\Actions\Server\InstallDocker;
use App\Models\PrivateKey;
use App\Models\Project;
use App\Models\Server;
+use Illuminate\Database\Eloquent\Collection;
use Livewire\Component;
class Index extends Component
-{ public string $currentState = 'welcome';
+{
+ public string $currentState = 'welcome';
+ public ?Collection $privateKeys = null;
+ public ?int $selectedExistingPrivateKey = null;
public ?string $privateKeyType = null;
public ?string $privateKey = null;
public ?string $publicKey = null;
@@ -70,9 +75,14 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
}
$this->currentState = 'select-proxy';
} elseif ($type === 'remote') {
+ $this->privateKeys = PrivateKey::ownedByCurrentTeam(['name'])->get();
$this->currentState = 'private-key';
}
}
+ public function selectExistingPrivateKey()
+ {
+ ray($this->selectedExistingPrivateKey);
+ }
public function setPrivateKey(string $type)
{
$this->privateKeyType = $type;
@@ -174,7 +184,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
{
$this->privateKeyName = generate_random_name();
$this->privateKeyDescription = 'Created by Coolify';
- ['private' => $this->privateKey, 'public'=> $this->publicKey] = generateSSHKey();
+ ['private' => $this->privateKey, 'public' => $this->publicKey] = generateSSHKey();
}
public function render()
{
diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.php
index 4bda0e4dcf..06ff5661b0 100644
--- a/resources/views/livewire/boarding/index.blade.php
+++ b/resources/views/livewire/boarding/index.blade.php
@@ -41,6 +41,14 @@
</div>
<div class="justify-center box" wire:click="setPrivateKey('create')">No (create one for me)
</div>
+ <form wire:submit.prevent='selectExistingPrivateKey'>
+ <x-forms.select wire:model.defer='selectedExistingPrivateKey'>
+ @foreach ($privateKeys as $privateKey)
+ <option value="{{ $privateKey->id }}">{{ $privateKey->name }}</option>
+ @endforeach
+ </x-forms.select>
+ <x-forms.button type="submit">Select this</x-forms.button>
+ </form>
</x-slot:actions>
<x-slot:explanation>
<p>SSH Keys are used to connect to a remote server through a secure shell, called SSH.</p>