Feat: Store all keys on disk by default
This commit is contained in:
parent
b09017ea46
commit
0bfdc1c531
2 changed files with 5 additions and 13 deletions
|
|
@ -10,7 +10,6 @@
|
|||
{
|
||||
public function up()
|
||||
{
|
||||
// Empty the SSH keys folder
|
||||
Storage::disk('ssh-keys')->deleteDirectory('');
|
||||
Storage::disk('ssh-keys')->makeDirectory('');
|
||||
|
||||
|
|
@ -19,7 +18,6 @@ public function up()
|
|||
$table->boolean('is_sftp_key')->default(false);
|
||||
});
|
||||
|
||||
// Re-save SSH keys on server only for records with is_server_ssh_key = true
|
||||
PrivateKey::where('is_server_ssh_key', true)->chunk(100, function ($keys) {
|
||||
foreach ($keys as $key) {
|
||||
$key->storeInFileSystem();
|
||||
|
|
@ -30,8 +28,8 @@ public function up()
|
|||
public function down()
|
||||
{
|
||||
Schema::table('private_keys', function (Blueprint $table) {
|
||||
$table->dropColumn('is_sftp_storage_key');
|
||||
$table->dropColumn('is_server_ssh_key');
|
||||
$table->dropColumn('is_sftp_key');
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public function run(): void
|
|||
PrivateKey::create([
|
||||
'id' => 0,
|
||||
'team_id' => 0,
|
||||
'name' => 'Testing-host',
|
||||
'name' => 'Testing Host Key',
|
||||
'description' => 'This is a test docker container',
|
||||
'private_key' => '-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
||||
|
|
@ -25,8 +25,9 @@ public function run(): void
|
|||
uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
|
||||
-----END OPENSSH PRIVATE KEY-----
|
||||
',
|
||||
|
||||
'is_server_ssh_key' => true,
|
||||
]);
|
||||
|
||||
PrivateKey::create([
|
||||
'id' => 1,
|
||||
'team_id' => 0,
|
||||
|
|
@ -61,12 +62,5 @@ public function run(): void
|
|||
-----END RSA PRIVATE KEY-----',
|
||||
'is_git_related' => true,
|
||||
]);
|
||||
PrivateKey::create([
|
||||
'id' => 2,
|
||||
'team_id' => 0,
|
||||
'name' => 'development-gitlab-app',
|
||||
'description' => 'This is the key for using the development Gitlab app',
|
||||
'private_key' => 'asdf',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue