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.

fix: store original root key in the original location

Andras Bacsai1815c9dccf5b
diff --git a/database/migrations/2024_09_16_170001_populate_ssh_keys_and_clear_mux_directory.php b/database/migrations/2024_09_16_170001_populate_ssh_keys_and_clear_mux_directory.php
index 944b00e13b..6b5d09fd80 100644
--- a/database/migrations/2024_09_16_170001_populate_ssh_keys_and_clear_mux_directory.php
+++ b/database/migrations/2024_09_16_170001_populate_ssh_keys_and_clear_mux_directory.php
@@ -1,8 +1,8 @@
<?php
+use App\Models\PrivateKey;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Storage;
-use App\Models\PrivateKey;
class PopulateSshKeysAndClearMuxDirectory extends Migration
{
@@ -13,10 +13,12 @@ class PopulateSshKeysAndClearMuxDirectory extends Migration
Storage::disk('ssh-mux')->deleteDirectory('');
Storage::disk('ssh-mux')->makeDirectory('');
-
PrivateKey::chunk(100, function ($keys) {
foreach ($keys as $key) {
$key->storeInFileSystem();
+ if ($key->id === 0) {
+ Storage::disk('ssh-keys')->put('[email protected]', $key->private_key);
+ }
}
});
}