fix: store original root key in the original location
This commit is contained in:
@@ -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('id.root@host.docker.internal', $key->private_key);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user