2023-03-24 14:47:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Seeders;
|
|
|
|
|
2023-06-14 09:54:00 +00:00
|
|
|
use App\Actions\Proxy\InstallProxy;
|
2023-05-03 05:23:45 +00:00
|
|
|
use App\Data\ServerMetadata;
|
2023-05-16 09:39:18 +00:00
|
|
|
use App\Enums\ProxyStatus;
|
2023-05-03 05:23:45 +00:00
|
|
|
use App\Enums\ProxyTypes;
|
2023-03-27 12:31:42 +00:00
|
|
|
use App\Models\PrivateKey;
|
2023-03-24 14:47:58 +00:00
|
|
|
use App\Models\Server;
|
|
|
|
use App\Models\Team;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
|
|
|
|
class ServerSeeder extends Seeder
|
|
|
|
{
|
|
|
|
public function run(): void
|
|
|
|
{
|
2023-04-14 10:54:29 +00:00
|
|
|
$root_team = Team::find(0);
|
2023-03-27 12:31:42 +00:00
|
|
|
$private_key_1 = PrivateKey::find(1);
|
2023-05-03 05:23:45 +00:00
|
|
|
|
2023-03-24 21:15:36 +00:00
|
|
|
Server::create([
|
2023-06-14 10:48:29 +00:00
|
|
|
'id' => 0,
|
2023-04-14 08:00:42 +00:00
|
|
|
'name' => "testing-local-docker-container",
|
2023-03-24 21:15:36 +00:00
|
|
|
'description' => "This is a test docker container",
|
2023-04-14 08:00:42 +00:00
|
|
|
'ip' => "coolify-testing-host",
|
2023-03-24 21:15:36 +00:00
|
|
|
'team_id' => $root_team->id,
|
2023-03-27 12:31:42 +00:00
|
|
|
'private_key_id' => $private_key_1->id,
|
2023-06-20 18:19:31 +00:00
|
|
|
'proxy' => ServerMetadata::from([
|
|
|
|
'type' => ProxyTypes::TRAEFIK_V2->value,
|
|
|
|
'status' => ProxyStatus::EXITED->value
|
2023-05-03 05:23:45 +00:00
|
|
|
]),
|
2023-03-24 21:15:36 +00:00
|
|
|
]);
|
2023-03-28 13:47:37 +00:00
|
|
|
Server::create([
|
2023-04-14 08:00:42 +00:00
|
|
|
'name' => "testing-local-docker-container-2",
|
|
|
|
'description' => "This is a test docker container",
|
|
|
|
'ip' => "coolify-testing-host-2",
|
2023-03-28 13:47:37 +00:00
|
|
|
'team_id' => $root_team->id,
|
2023-06-02 13:15:12 +00:00
|
|
|
'private_key_id' => $private_key_1->id
|
2023-03-28 13:47:37 +00:00
|
|
|
]);
|
2023-03-24 14:47:58 +00:00
|
|
|
}
|
|
|
|
}
|