add new server

add new private key
check server connection
This commit is contained in:
Andras Bacsai
2023-04-26 15:38:50 +02:00
parent 2c68eed072
commit 2487dde69e
17 changed files with 145 additions and 20 deletions

View File

@@ -17,6 +17,7 @@ return new class extends Migration
$table->string('name');
$table->string('description')->nullable();
$table->longText('private_key');
$table->foreignId('team_id');
$table->timestamps();
});
}

View File

@@ -4,6 +4,7 @@ namespace Database\Seeders;
use App\Models\PrivateKey;
use App\Models\Server;
use App\Models\Team;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
@@ -14,8 +15,9 @@ class PrivateKeySeeder extends Seeder
*/
public function run(): void
{
$team_1 = Team::find(0);
PrivateKey::create([
"id" => 1,
"team_id" => $team_1->id,
"name" => "Testing-host",
"description" => "This is a test docker container",
"private_key" => "-----BEGIN OPENSSH PRIVATE KEY-----
@@ -26,9 +28,10 @@ AAAECBQw4jg1WRT2IGHMncCiZhURCts2s24HoDS0thHnnRKVuGmoeGq/pojrsyP1pszcNV
uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
-----END OPENSSH PRIVATE KEY-----
"
]);
PrivateKey::create([
"id" => 2,
"team_id" => $team_1->id,
"name" => "development-github-app",
"description" => "This is the key for using the development GitHub app",
"private_key" => "-----BEGIN RSA PRIVATE KEY-----
@@ -60,7 +63,7 @@ a1C8EDKapCw5hAhizEFOUQKOygL8Ipn+tmEUkORYdZ8Q8cWFCv9nIw==
-----END RSA PRIVATE KEY-----"
]);
PrivateKey::create([
"id" => 3,
"team_id" => $team_1->id,
"name" => "development-gitlab-app",
"description" => "This is the key for using the development Gitlab app",
"private_key" => "asdf"

View File

@@ -17,7 +17,6 @@ class ServerSeeder extends Seeder
$root_team = Team::find(0);
$private_key_1 = PrivateKey::find(1);
Server::create([
'id' => 1,
'name' => "testing-local-docker-container",
'description' => "This is a test docker container",
'ip' => "coolify-testing-host",
@@ -25,13 +24,11 @@ class ServerSeeder extends Seeder
'private_key_id' => $private_key_1->id,
]);
Server::create([
'id' => 2,
'name' => "testing-local-docker-container-2",
'description' => "This is a test docker container",
'ip' => "coolify-testing-host-2",
'team_id' => $root_team->id,
'private_key_id' => $private_key_1->id,
]);
}
}