mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 12:14:07 +00:00
feat(server): improve private key and cloud link flows
Add server private key generation from the dropdown, prevent deleting private keys that are still in use, and close cloud provider link modals after successful linking.
This commit is contained in:
1 parent
9b8aeb4758
commit
0217e2b0c0
14 files changed
+822
-252
No files matched your search
@@ -55,6 +55,33 @@ class Show extends Component
|
||||
}
|
||||
}
|
||||
|
||||
public function generatePrivateKey(string $type): void
|
||||
{
|
||||
try {
|
||||
$this->authorize('create', PrivateKey::class);
|
||||
|
||||
if (! in_array($type, ['ed25519', 'rsa'], true)) {
|
||||
$this->dispatch('error', 'Invalid private key type.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$keyData = PrivateKey::generateNewKeyPair($type);
|
||||
$privateKey = PrivateKey::createAndStore([
|
||||
'name' => $keyData['name'],
|
||||
'description' => $keyData['description'],
|
||||
'private_key' => $keyData['private_key'],
|
||||
'team_id' => currentTeam()->id,
|
||||
]);
|
||||
|
||||
$this->privateKeys = PrivateKey::ownedByCurrentTeam()->get()->where('is_git_related', false);
|
||||
$this->dispatch('copyPublicKeyToClipboard', publicKey: $privateKey->public_key);
|
||||
$this->dispatch('success', 'Private key created successfully.');
|
||||
} catch (\Throwable $e) {
|
||||
handleError($e, $this);
|
||||
}
|
||||
}
|
||||
|
||||
public function checkConnection()
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user