lasthourcloud/database/seeders/PrivateKeySeeder.php
Andras Bacsai f57684b024 Add Servers and PrivateKeys
Add new testhost
Remove privatekey injection from Dockerfile
2023-03-24 22:15:36 +01:00

35 lines
1.1 KiB
PHP

<?php
namespace Database\Seeders;
use App\Models\PrivateKey;
use App\Models\Server;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class PrivateKeySeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$server = Server::find(1);
$server2 = Server::find(2);
$private_key = PrivateKey::create([
"name" => "Testing-host",
"description" => "This is a test docker container",
"private_key" => "-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevAAAAJi/QySHv0Mk
hwAAAAtzc2gtZWQyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevA
AAAECBQw4jg1WRT2IGHMncCiZhURCts2s24HoDS0thHnnRKVuGmoeGq/pojrsyP1pszcNV
uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
-----END OPENSSH PRIVATE KEY-----
",
]);
$server->privateKeys()->attach($private_key);
$server2->privateKeys()->attach($private_key);
}
}