Fixes
This commit is contained in:
@@ -156,6 +156,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
|
|||||||
$this->servers = Server::ownedByCurrentTeam(['name'])->where('id', '!=', 0)->get();
|
$this->servers = Server::ownedByCurrentTeam(['name'])->where('id', '!=', 0)->get();
|
||||||
if ($this->servers->count() > 0) {
|
if ($this->servers->count() > 0) {
|
||||||
$this->selectedExistingServer = $this->servers->first()->id;
|
$this->selectedExistingServer = $this->servers->first()->id;
|
||||||
|
$this->updateServerDetails();
|
||||||
$this->currentState = 'select-existing-server';
|
$this->currentState = 'select-existing-server';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -175,11 +176,18 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
|
|||||||
}
|
}
|
||||||
$this->selectedExistingPrivateKey = $this->createdServer->privateKey->id;
|
$this->selectedExistingPrivateKey = $this->createdServer->privateKey->id;
|
||||||
$this->serverPublicKey = $this->createdServer->privateKey->publicKey();
|
$this->serverPublicKey = $this->createdServer->privateKey->publicKey();
|
||||||
$this->remoteServerPort = $this->createdServer->port;
|
$this->updateServerDetails();
|
||||||
$this->remoteServerUser = $this->createdServer->user;
|
|
||||||
$this->currentState = 'validate-server';
|
$this->currentState = 'validate-server';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function updateServerDetails()
|
||||||
|
{
|
||||||
|
if ($this->createdServer) {
|
||||||
|
$this->remoteServerPort = $this->createdServer->port;
|
||||||
|
$this->remoteServerUser = $this->createdServer->user;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getProxyType()
|
public function getProxyType()
|
||||||
{
|
{
|
||||||
// Set Default Proxy Type
|
// Set Default Proxy Type
|
||||||
@@ -367,23 +375,12 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
|
|||||||
'remoteServerUser' => 'required|string',
|
'remoteServerUser' => 'required|string',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!$this->createdServer) {
|
$this->createdServer->update([
|
||||||
$this->createdServer = Server::create([
|
'name' => $this->remoteServerName,
|
||||||
'name' => $this->remoteServerName ?? 'New Server',
|
'port' => $this->remoteServerPort,
|
||||||
'ip' => $this->remoteServerHost,
|
'user' => $this->remoteServerUser,
|
||||||
'port' => $this->remoteServerPort,
|
|
||||||
'user' => $this->remoteServerUser,
|
|
||||||
'team_id' => currentTeam()->id,
|
|
||||||
'timezone' => 'UTC',
|
'timezone' => 'UTC',
|
||||||
]);
|
]);
|
||||||
} else {
|
|
||||||
$this->createdServer->update([
|
|
||||||
'port' => $this->remoteServerPort,
|
|
||||||
'user' => $this->remoteServerUser,
|
|
||||||
'timezone' => 'UTC',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->validateServer();
|
$this->validateServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -64,9 +64,9 @@
|
|||||||
<p class="mb-4">Please check the connection details below and correct them if they are incorrect.</p>
|
<p class="mb-4">Please check the connection details below and correct them if they are incorrect.</p>
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
||||||
<x-forms.input placeholder="Default is 22" label="Port" id="remoteServerPort" wire:model.live="remoteServerPort" />
|
<x-forms.input placeholder="Default is 22" label="Port" id="remoteServerPort" wire:model="remoteServerPort" :value="$remoteServerPort" />
|
||||||
<div>
|
<div>
|
||||||
<x-forms.input placeholder="Default is root" label="User" id="remoteServerUser" wire:model.live="remoteServerUser" />
|
<x-forms.input placeholder="Default is root" label="User" id="remoteServerUser" wire:model="remoteServerUser" :value="$remoteServerUser" />
|
||||||
<p class="text-xs mt-1">
|
<p class="text-xs mt-1">
|
||||||
Non-root user is experimental:
|
Non-root user is experimental:
|
||||||
<a class="font-bold underline" target="_blank" href="https://coolify.io/docs/knowledge-base/server/non-root-user">docs</a>
|
<a class="font-bold underline" target="_blank" href="https://coolify.io/docs/knowledge-base/server/non-root-user">docs</a>
|
||||||
@@ -147,11 +147,7 @@
|
|||||||
<x-slot:actions>
|
<x-slot:actions>
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<div>
|
<div>
|
||||||
<x-forms.button class="justify-center w-64 box-boarding" wire:click="createNewServer">No
|
<x-forms.button class="justify-center w-64 box-boarding" wire:click="createNewServer">No (create one for me)
|
||||||
(create
|
|
||||||
one
|
|
||||||
for
|
|
||||||
me)
|
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -167,18 +163,39 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if (!$serverReachable)
|
@if (!$serverReachable)
|
||||||
This server is not reachable with the following public key.
|
<div class="mt-6 p-4 bg-red-100 dark:bg-red-950 rounded-lg text-gray-800 dark:text-gray-200">
|
||||||
<br /> <br />
|
<h2 class="text-lg font-bold mb-2">Server is not reachable</h2>
|
||||||
Please make sure you have the correct public key in your ~/.ssh/authorized_keys file for
|
<p class="mb-4">Please check the connection details below and correct them if they are incorrect.</p>
|
||||||
user or skip the boarding process and add a new private key manually to Coolify and to the
|
|
||||||
server.
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
||||||
<br />
|
<x-forms.input placeholder="Default is 22" label="Port" id="remoteServerPort" wire:model="remoteServerPort" :value="$remoteServerPort" />
|
||||||
Check this <a target="_blank" class="underline" href="https://coolify.io/docs/knowledge-base/server/openssh">documentation</a> for further
|
<div>
|
||||||
help.
|
<x-forms.input placeholder="Default is root" label="User" id="remoteServerUser" wire:model="remoteServerUser" :value="$remoteServerUser" />
|
||||||
<x-forms.input readonly id="serverPublicKey"></x-forms.input>
|
<p class="text-xs mt-1">
|
||||||
<x-forms.button class="w-64 box-boarding" wire:target="validateServer" wire:click="validateServer">Check
|
Non-root user is experimental:
|
||||||
again
|
<a class="font-bold underline" target="_blank" href="https://coolify.io/docs/knowledge-base/server/non-root-user">docs</a>
|
||||||
</x-forms.button>
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
<p class="mb-2">If the connection details are correct, please ensure:</p>
|
||||||
|
<ul class="list-disc list-inside">
|
||||||
|
<li>The correct public key is in your <code class="bg-red-200 dark:bg-red-900 px-1 rounded">~/.ssh/authorized_keys</code> file for the specified user</li>
|
||||||
|
<li>Or skip the boarding process and manually add a new private key to Coolify and the server</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="mb-4">
|
||||||
|
For more help, check this <a target="_blank" class="underline font-semibold" href="https://coolify.io/docs/knowledge-base/server/openssh">documentation</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<x-forms.input readonly id="serverPublicKey" class="mb-4" label="Current Public Key"></x-forms.input>
|
||||||
|
|
||||||
|
<x-forms.button class="w-full md:w-auto box-boarding" wire:click="saveAndValidateServer">
|
||||||
|
Check again
|
||||||
|
</x-forms.button>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</x-slot:actions>
|
</x-slot:actions>
|
||||||
<x-slot:explanation>
|
<x-slot:explanation>
|
||||||
@@ -225,27 +242,27 @@
|
|||||||
<x-slot:actions>
|
<x-slot:actions>
|
||||||
<form wire:submit='saveServer' class="flex flex-col w-full gap-4 lg:pr-10">
|
<form wire:submit='saveServer' class="flex flex-col w-full gap-4 lg:pr-10">
|
||||||
<div class="flex flex-col gap-2 lg:flex-row">
|
<div class="flex flex-col gap-2 lg:flex-row">
|
||||||
<x-forms.input required placeholder="Choose a name for your Server. Could be anything." label="Name" id="remoteServerName" />
|
<x-forms.input required placeholder="Choose a name for your Server. Could be anything." label="Name" id="remoteServerName" wire:model="remoteServerName" />
|
||||||
<x-forms.input placeholder="Description, so others will know more about this." label="Description" id="remoteServerDescription" />
|
<x-forms.input placeholder="Description, so others will know more about this." label="Description" id="remoteServerDescription" wire:model="remoteServerDescription" />
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-2 lg:flex-row ">
|
<div class="flex flex-col gap-2 lg:flex-row ">
|
||||||
<x-forms.input required placeholder="127.0.0.1" label="IP Address" id="remoteServerHost" />
|
<x-forms.input required placeholder="127.0.0.1" label="IP Address" id="remoteServerHost" wire:model="remoteServerHost" />
|
||||||
</div>
|
</div>
|
||||||
<div x-data="{ showAdvanced: false }" class="flex flex-col gap-2">
|
<div x-data="{ showAdvanced: false }" class="flex flex-col gap-2">
|
||||||
<button @click="showAdvanced = !showAdvanced" type="button" class="text-left text-sm text-gray-600 dark:text-gray-300 hover:underline">
|
<button @click="showAdvanced = !showAdvanced" type="button" class="text-left text-sm text-gray-600 dark:text-gray-300 hover:underline">
|
||||||
Advanced Settings
|
Advanced Settings
|
||||||
</button>
|
</button>
|
||||||
<div x-show="showAdvanced" class="flex flex-col gap-2 lg:flex-row">
|
<div x-show="showAdvanced" class="flex flex-col gap-2 lg:flex-row">
|
||||||
<x-forms.input placeholder="Port number of your server. Default is 22." label="Port" id="remoteServerPort" wire:model.lazy="remoteServerPort" />
|
<x-forms.input placeholder="Port number of your server. Default is 22." label="Port" id="remoteServerPort" wire:model="remoteServerPort" />
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<x-forms.input placeholder="User to connect to your server. Default is root." label="User" id="remoteServerUser" wire:model.lazy="remoteServerUser" />
|
<x-forms.input placeholder="Default is root." label="User" id="remoteServerUser" wire:model="remoteServerUser" />
|
||||||
<div class="text-xs text-gray-600 dark:text-gray-300">Non-root user is experimental: <a class="font-bold underline" target="_blank" href="https://coolify.io/docs/knowledge-base/server/non-root-user">docs</a>.
|
<div class="text-xs text-gray-600 dark:text-gray-300">Non-root user is experimental: <a class="font-bold underline" target="_blank" href="https://coolify.io/docs/knowledge-base/server/non-root-user">docs</a>.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="lg:w-64">
|
<div class="lg:w-64">
|
||||||
<x-forms.checkbox helper="If you are using Cloudflare Tunnels, enable this. It will proxy all ssh requests to your server through Cloudflare.<br><span class='dark:text-warning'>Coolify does not install/setup Cloudflare (cloudflared) on your server.</span>" id="isCloudflareTunnel" label="Cloudflare Tunnel" />
|
<x-forms.checkbox helper="If you are using Cloudflare Tunnels, enable this. It will proxy all ssh requests to your server through Cloudflare.<br><span class='dark:text-warning'>Coolify does not install/setup Cloudflare (cloudflared) on your server.</span>" id="isCloudflareTunnel" label="Cloudflare Tunnel" wire:model="isCloudflareTunnel" />
|
||||||
</div>
|
</div>
|
||||||
<x-forms.button type="submit">Continue</x-forms.button>
|
<x-forms.button type="submit">Continue</x-forms.button>
|
||||||
</form>
|
</form>
|
||||||
|
Reference in New Issue
Block a user