mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
Fix: Make sure in use private keys are not deleted
This commit is contained in:
parent
2ec66fd146
commit
6a6b947fba
1 changed files with 4 additions and 0 deletions
|
|
@ -144,6 +144,10 @@ class PrivateKey extends BaseModel
|
|||
|
||||
public static function deleteFromStorage(self $privateKey)
|
||||
{
|
||||
if ($privateKey->isInUse()) {
|
||||
throw new \Exception('Cannot delete a private key that is in use.');
|
||||
}
|
||||
|
||||
$filename = "ssh@{$privateKey->uuid}";
|
||||
Storage::disk('ssh-keys')->delete($filename);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue