Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

cleanup ssh dir on start

Andras Bacsai70ecb92e82c6
diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php
index 6abac70298..31d7639bea 100644
--- a/app/Console/Commands/Init.php
+++ b/app/Console/Commands/Init.php
@@ -10,6 +10,7 @@ use App\Models\StandaloneMongodb;
use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
use Illuminate\Console\Command;
+use Illuminate\Support\Facades\Storage;
class Init extends Command
{
@@ -21,8 +22,23 @@ class Init extends Command
ray()->clearAll();
$this->cleanup_in_progress_application_deployments();
$this->cleanup_stucked_resources();
+ $this->cleanup_ssh();
}
+ private function cleanup_ssh() {
+ try {
+ $files = Storage::allFiles('ssh/keys');
+ foreach ($files as $file) {
+ Storage::delete($file);
+ }
+ $files = Storage::allFiles('ssh/mux');
+ foreach ($files as $file) {
+ Storage::delete($file);
+ }
+ } catch (\Throwable $e) {
+ echo "Error: {$e->getMessage()}\n";
+ }
+ }
private function cleanup_in_progress_application_deployments()
{
// Cleanup any failed deployments