mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
generate ssh keys command
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
use Filament\Notifications\Actions\Action;
|
||||
use Filament\Notifications\Notification;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
function generate_public_key($privateKeyPath, $publicKeyPath): void
|
||||
@ -56,6 +57,10 @@ function convert_time_format($string): string
|
||||
|
||||
function get_public_key_content(): string
|
||||
{
|
||||
if (! file_exists(storage_path(config('core.ssh_public_key_name')))) {
|
||||
Artisan::call('ssh-key:generate --force');
|
||||
}
|
||||
|
||||
return str(file_get_contents(storage_path(config('core.ssh_public_key_name'))))
|
||||
->replace("\n", '')
|
||||
->toString();
|
||||
|
Reference in New Issue
Block a user