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.

Feat: Store all keys on disk by default

peaklabs-dev0bfdc1c5314b
diff --git a/database/migrations/2024_09_16_160709_add_ssh_sftp_fields_to_private_keys_table.php b/database/migrations/2024_09_16_160709_add_ssh_sftp_fields_to_private_keys_table.php
index a12cd04e90..8297ec75fd 100644
--- a/database/migrations/2024_09_16_160709_add_ssh_sftp_fields_to_private_keys_table.php
+++ b/database/migrations/2024_09_16_160709_add_ssh_sftp_fields_to_private_keys_table.php
@@ -10,7 +10,6 @@ return new class extends Migration
{
public function up()
{
- // Empty the SSH keys folder
Storage::disk('ssh-keys')->deleteDirectory('');
Storage::disk('ssh-keys')->makeDirectory('');
@@ -19,7 +18,6 @@ return new class extends Migration
$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 @@ return new class extends Migration
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');
});
}
-};
\ No newline at end of file
+};
diff --git a/database/seeders/PrivateKeySeeder.php b/database/seeders/PrivateKeySeeder.php
index 8a70cf56d8..315c988a56 100644
--- a/database/seeders/PrivateKeySeeder.php
+++ b/database/seeders/PrivateKeySeeder.php
@@ -15,7 +15,7 @@ class PrivateKeySeeder extends Seeder
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 @@ AAAECBQw4jg1WRT2IGHMncCiZhURCts2s24HoDS0thHnnRKVuGmoeGq/pojrsyP1pszcNV
uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
-----END OPENSSH PRIVATE KEY-----
',
-
+ 'is_server_ssh_key' => true,
]);
+
PrivateKey::create([
'id' => 1,
'team_id' => 0,
@@ -61,12 +62,5 @@ a1C8EDKapCw5hAhizEFOUQKOygL8Ipn+tmEUkORYdZ8Q8cWFCv9nIw==
-----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',
- ]);
}
}