diff --git a/app/Console/Commands/Setup/GenerateSshKey.php b/app/Console/Commands/Setup/GenerateSshKey.php new file mode 100644 index 0000000..17013ea --- /dev/null +++ b/app/Console/Commands/Setup/GenerateSshKey.php @@ -0,0 +1,37 @@ +components->info('SSH key pair already exists.'); + return; + } + + $this->components->info('Generating SSH key pair...'); + if (!file_exists(storage_path('app/private/ssh'))) { + $this->components->info('ssh directory does not exist. Creating it now...'); + mkdir(storage_path('app/private/ssh'), 0755, true); + } + + $result = Process::run(['ssh-keygen', '-t', 'ed25519', '-f', storage_path('app/private/ssh/id_ed25519'), '-N', '']); + + if (!$result->successful()) { + $this->components->error('Failed to generate SSH key pair.'); + $this->line($result->output()); + $this->line($result->errorOutput()); + return; + } + + $this->components->success('SSH key pair generated successfully.'); + } +} diff --git a/app/Console/Commands/Setup/Setup.php b/app/Console/Commands/Setup/Setup.php new file mode 100644 index 0000000..736501b --- /dev/null +++ b/app/Console/Commands/Setup/Setup.php @@ -0,0 +1,17 @@ +call('migrate'); + $this->call(GenerateSshKey::class); + } +} diff --git a/app/Enums/ServerStatus.php b/app/Enums/ServerStatus.php new file mode 100644 index 0000000..04c4e56 --- /dev/null +++ b/app/Enums/ServerStatus.php @@ -0,0 +1,13 @@ + ServerProvider::class, + 'status' => ServerStatus::class, ]; }