Mail routing parent/children, domain name validation, nodelist import changes and other fixes
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
use App\Models\Software;
|
||||
use App\Models\{Domain,Software,System,Zone};
|
||||
|
||||
class InitialSetupSeeder extends Seeder
|
||||
{
|
||||
@@ -32,65 +33,49 @@ class InitialSetupSeeder extends Seeder
|
||||
'type'=>Software::SOFTWARE_MAILER,
|
||||
]);
|
||||
|
||||
DB::table('domains')->insert([
|
||||
$so = new System;
|
||||
$so->forceFill([
|
||||
'name'=>'Clearing Houz - Dev',
|
||||
'sysop'=>'System Sysop',
|
||||
'location'=>'Melbourne, AU',
|
||||
'active'=>TRUE,
|
||||
]);
|
||||
$so->save();
|
||||
|
||||
$do = new Domain;
|
||||
$do->forceFill([
|
||||
'name'=>'private',
|
||||
'default'=>TRUE,
|
||||
'active'=>TRUE,
|
||||
'public'=>TRUE,
|
||||
'notes'=>'PrivateNet: Internal Testing Network'
|
||||
]);
|
||||
$do->save();
|
||||
|
||||
DB::table('zones')->insert([
|
||||
$zo = new Zone;
|
||||
$zo->forceFill([
|
||||
'zone_id'=>'10',
|
||||
'domain_id'=>1,
|
||||
'active'=>TRUE,
|
||||
'system_id'=>$so->id,
|
||||
]);
|
||||
|
||||
DB::table('nodes')->insert([
|
||||
'zone_id'=>'1',
|
||||
'host_id'=>'999',
|
||||
'node_id'=>'2',
|
||||
'is_host'=>TRUE,
|
||||
'active'=>TRUE,
|
||||
'system'=>'FTN Clearing House Dev',
|
||||
'sysop'=>'Deon George',
|
||||
'location'=>'Parkdale, AUS',
|
||||
'email'=>'deon@leenooks.net',
|
||||
'address'=>'10.1.3.165',
|
||||
'port'=>24554,
|
||||
'protocol_id'=>1,
|
||||
'software_id'=>1,
|
||||
]);
|
||||
|
||||
DB::table('nodes')->insert([
|
||||
'zone_id'=>'1',
|
||||
'host_id'=>'999',
|
||||
'node_id'=>'1',
|
||||
'is_host'=>TRUE,
|
||||
'active'=>TRUE,
|
||||
'system'=>'Alterant MailHUB DEV',
|
||||
'sysop'=>'Deon George',
|
||||
'location'=>'Parkdale, AUS',
|
||||
'email'=>'deon@leenooks.net',
|
||||
'address'=>'d-1-4.ipv4.leenooks.vpn',
|
||||
'port'=>14554,
|
||||
'sespass'=>'PASSWORD',
|
||||
'protocol_id'=>1,
|
||||
'software_id'=>1,
|
||||
]);
|
||||
$do->zones()->save($zo);
|
||||
|
||||
DB::table('setups')->insert([
|
||||
'opt_md'=>'1',
|
||||
]);
|
||||
|
||||
DB::table('node_setup')->insert([
|
||||
'node_id'=>'1',
|
||||
'setup_id'=>'1',
|
||||
'system_id'=>$so->id,
|
||||
'zmodem'=>0,
|
||||
'emsi_protocols'=>0,
|
||||
'binkp'=>0,
|
||||
'protocols'=>0,
|
||||
'permissions'=>0,
|
||||
'options'=>0,
|
||||
]);
|
||||
|
||||
DB::table('users')->insert([
|
||||
'name'=>'Deon George',
|
||||
'email'=>'deon@leenooks.net',
|
||||
'email_verified_at'=>Carbon::now(),
|
||||
'admin'=>TRUE,
|
||||
'active'=>TRUE,
|
||||
'password'=>'$2y$10$bJQDLfxnKrh6o5Sa02MZOukXcLTNQiByXSTJ7fTr.kHMpV2wxbG6.',
|
||||
]);
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ class NodeHierarchy extends Seeder
|
||||
{
|
||||
DB::table('domains')
|
||||
->insert([
|
||||
'name'=>'Domain A',
|
||||
'name'=>'domain-a',
|
||||
'active'=>TRUE,
|
||||
'public'=>TRUE,
|
||||
'default'=>FALSE,
|
||||
@@ -30,7 +30,7 @@ class NodeHierarchy extends Seeder
|
||||
|
||||
DB::table('domains')
|
||||
->insert([
|
||||
'name'=>'Domain B',
|
||||
'name'=>'domain-b',
|
||||
'active'=>TRUE,
|
||||
'public'=>TRUE,
|
||||
'default'=>FALSE,
|
||||
@@ -38,7 +38,7 @@ class NodeHierarchy extends Seeder
|
||||
'updated_at'=>Carbon::now(),
|
||||
]);
|
||||
|
||||
foreach (['Domain A','Domain B'] as $domain) {
|
||||
foreach (['domain-a','domain-b'] as $domain) {
|
||||
$domain = Domain::where('name',$domain)->singleOrFail();
|
||||
$this->hierarchy($domain,100);
|
||||
$this->hierarchy($domain,101);
|
||||
@@ -66,6 +66,19 @@ class NodeHierarchy extends Seeder
|
||||
]);
|
||||
|
||||
$zo = Zone::where('zone_id',$zoneid)->where('domain_id',$domain->id)->singleOrFail();
|
||||
DB::table('addresses')
|
||||
->insert([
|
||||
'zone_id'=>$zo->id,
|
||||
'active'=>TRUE,
|
||||
'region_id'=>0,
|
||||
'host_id'=>0,
|
||||
'node_id'=>0,
|
||||
'point_id'=>0,
|
||||
'system_id'=>$so->id,
|
||||
'role'=>DomainController::NODE_ZC,
|
||||
'created_at'=>Carbon::now(),
|
||||
'updated_at'=>Carbon::now(),
|
||||
]);
|
||||
|
||||
// Nodes
|
||||
foreach ($nodes as $nid) {
|
||||
@@ -120,7 +133,7 @@ class NodeHierarchy extends Seeder
|
||||
|
||||
// Hosts
|
||||
foreach ($hosts as $hid) {
|
||||
$hostid = $rid*100+$hid;
|
||||
$hostid = $rid*10+$hid;
|
||||
$so = $this->system(sprintf('Host %03d:%03d/0.0@%s (Region %03d)',$zoneid,$hostid,$domain->name,$rid));
|
||||
DB::table('addresses')
|
||||
->insert([
|
||||
|
Reference in New Issue
Block a user