diff --git a/app/Classes/FileReceive.php b/app/Classes/FileReceive.php
deleted file mode 100644
index 9e8f351..0000000
--- a/app/Classes/FileReceive.php
+++ /dev/null
@@ -1,20 +0,0 @@
-argument('file'));
-
- $this->info(sprintf('Packet: %s has %s messages. Addr: %s->%s (Date: %s)',
- $pkt->filename,
- $pkt->messages->count(),
- $pkt->pktsrc,
- $pkt->pktdst,
- $pkt->date
- ));
-
- foreach ($pkt->messages as $o)
- {
- $this->warn(sprintf('-- From: %s(%s)->%s(%s), Type: %s, Size: %d',
- $o->from,
- $o->fqfa,
- $o->to,
- $o->fqda,
- $o->type,
- strlen($o->message)
- ));
-
- if ($o->unknown->count())
- $this->error(sprintf('?? %s Unknown headers',$o->unknown->count()));
- }
-
- if ($this->option('detail'))
- dd($o);
-
- if ($this->option('dump'))
- echo $pkt->dump();
- }
-}
\ No newline at end of file
diff --git a/app/Console/Commands/ImportPacket.php b/app/Console/Commands/ImportPacket.php
deleted file mode 100644
index 6599ea2..0000000
--- a/app/Console/Commands/ImportPacket.php
+++ /dev/null
@@ -1,157 +0,0 @@
-argument('file'));
-
- foreach ($pkt->messages as $o)
- {
- $o->date->setTimezone(($o->tzutc >= 0 ? '+' : '').substr_replace($o->tzutc,':',2,0));
-
- switch ($o->type)
- {
- case 'echomail':
- // See if we already have this message.
- $oo = Echomail::firstOrNew([
- 'date'=>$o->date,
- 'from_ftn'=>$this->get_node(['z'=>$o->fz,'n'=>$o->fn,'f'=>$o->ff,'p'=>$o->fp])->id,
- 'msgid'=>$o->msgid,
- ]);
-
- if (md5(utf8_decode($eo->message)) == md5($o->message))
- {
- $this->warn(sprintf('Duplicate message: %s@%s with id: %s',$o->from,$o->fqfa,$o->msgid));
- break 2;
- }
-
- break;
-
- case 'netmail':
- // See if we already have this message.
- $oo = Netmail::firstOrNew([
- 'date'=>$o->date,
- 'from_ftn'=>$this->get_node(['z'=>$o->fz,'n'=>$o->fn,'f'=>$o->ff,'p'=>$o->fp])->id,
- 'msgid'=>$o->msgid,
- ]);
-
- $oo->to_ftn = $this->get_node(['z'=>$o->tz,'n'=>$o->tn,'f'=>$o->tf,'p'=>$o->tp])->id;
-
- break;
-
- default:
- abort(500,'Unknown type: '.$o->type);
- }
-
- if (md5(utf8_decode($oo->message)) == md5($o->message))
- {
- $this->warn(sprintf('Duplicate message: %s@%s with id: %s',$o->from,$o->fqfa,$o->msgid));
- if (! $this->option('force'))
- continue;
- }
-
- $oo->pkt_from = $this->get_node(['z'=>$pkt->sz,'n'=>$pkt->sn,'f'=>$pkt->sf,'p'=>$pkt->sp])->id;
- $oo->pkt_to = $this->get_node(['z'=>$pkt->dz,'n'=>$pkt->dn,'f'=>$pkt->df,'p'=>$pkt->dp])->id;
- $oo->pkt = $pkt->filename;
- $oo->pkt_date = $pkt->date;
- $oo->flags = $o->flags;
- $oo->cost = $o->cost;
- $oo->from_user = utf8_encode($o->from);
- $oo->to_user = utf8_encode($o->to);
- $oo->subject = utf8_encode($o->subject);
- $oo->tz = $o->tzutc;
- $oo->replyid = $o->replyid;
- $oo->message = utf8_encode($o->message);
- $oo->origin = utf8_encode($o->origin);
- $oo->save();
-
- foreach ($o->kludge as $k=>$v)
- {
- $oo->kludges()->attach($k,['value'=>json_encode($v)]);
- }
-
- foreach ($o->unknown as $v)
- {
- $oo->kludges()->attach('UNKNOWN',['value'=>json_encode($v)]);
- }
-
- // Finish off the import
- switch($o->type) {
- case 'echomail':
- foreach ($o->seenby as $v)
- {
- foreach ($this->parse_nodes(Zone::findOrFail($pkt->sz),$v) as $no)
- {
- $oo->seenbys()->attach($no->id);
- }
- }
-
- $seq = 0;
- foreach ($o->path as $v)
- {
- foreach ($this->parse_nodes(Zone::findOrFail($pkt->sz),$v) as $no)
- {
- $oo->paths()->attach($no->id,['sequence'=>$seq++]);
- }
- }
-
- break;
-
- case 'netmail':
- $seq = 0;
-
- foreach ($o->via as $v)
- {
- $data = preg_split('/\s/',$v);
- $ftno = $this->get_node(ftn_address_split($data[0]));
- unset($data[0]);
-
- $oo->paths()->attach($ftno->id,['sequence'=>$seq++,'value'=>json_encode($data)]);
- }
-
- break;
- }
- }
- }
-}
diff --git a/app/Http/Controllers/NodeController.php b/app/Http/Controllers/NodeController.php
deleted file mode 100644
index f6dcda5..0000000
--- a/app/Http/Controllers/NodeController.php
+++ /dev/null
@@ -1,46 +0,0 @@
-middleware('auth');
- }
-
- /**
- * Add or edit a node
- */
- public function add_edit(Request $request,Node $o)
- {
- if ($request->post()) {
- foreach ([
- 'zone_id','host_id','node_id','point_id',
- 'system','sysop','location','email',
- 'address','port','notes','software_id','protocol_id',
- 'sespass','pktpass','ticpass','fixpass'
- ] as $key)
- $o->{$key} = $request->post($key);
-
- foreach(['is_zc','is_rc','is_hub','is_host','active'] as $key)
- $o->{$key} = $request->post($key,FALSE);
-
- $o->save();
-
- return redirect()->action([self::class,'home']);
- }
-
- return view('node.addedit')
- ->with('o',$o);
- }
-
- public function home()
- {
- return view('node.home');
- }
-}
diff --git a/app/Models/Flag.php b/app/Models/Flag.php
deleted file mode 100644
index bb4b444..0000000
--- a/app/Models/Flag.php
+++ /dev/null
@@ -1,10 +0,0 @@
-'boolean',
- 'is_rc'=>'boolean',
- 'is_hub'=>'boolean',
- 'is_host'=>'boolean',
- ];
-
- protected $fillable = ['zone_id','host_id','node_id','point_id'];
-
- /* SCOPES */
-
- public function scopeHost()
- {
- // @todo
- }
-
- /* RELATIONS */
-
- /**
- * Node nodelist flags
- *
- * @return BelongsToMany
- */
- public function flags()
- {
- return $this->belongsToMany(Flag::class);
- }
-
- public function zone()
- {
- return $this->belongsTo(Zone::class);
- }
-
- /* ATTRIBUTES */
-
- /**
- * Render the node name in full 5D
- *
- * @return string
- */
- public function getFTNAttribute()
- {
- return $this->zone_id
- ? sprintf('%d:%d/%d.%d@%s',$this->zone->zone_id,$this->host_id,$this->node_id,$this->point_id,$this->zone->domain->name)
- : '-';
- }
-
- /**
- * Get this nodes uplink
- */
- public function getUplinkAttribute()
- {
- // @todo Need to work this out properly
- return static::where('zone_id','10')->where('host_id',1)->where('node_id',0)->where('point_id',0)->first();
- }
-
- /* METHODS */
-
- /**
- * Find a record in the DB for a node string, eg: 10:1/1.0
- *
- * @param string $ftn
- * @return Node|null
- * @throws Exception
- */
- public static function findFTN(string $ftn): ?self
- {
- $matches = [];
-
- // @todo domain can have more chars.
- if (! preg_match('#^([0-9]+):([0-9]+)/([0-9]+)(.([0-9]+))?(@([a-z]{0,8}))?$#',strtolower($ftn),$matches))
- throw new Exception('Invalid FTN: '.$ftn);
-
- // Check our numbers are correct.
- foreach ([1,2,3] as $i) {
- if (! $matches[$i] || ($matches[$i] > 0xffff))
- throw new Exception('Invalid FTN: '.$ftn);
- }
- if (isset($matches[5]) AND $matches[5] > 0xffff)
- throw new Exception('Invalid FTN: '.$ftn);
-
- return (new self)->active()
- ->select('nodes.*')
- ->where('zones.zone_id',$matches[1])
- ->where(function($query) use ($matches) {
- $query->where('hub_id',$matches[2])
- ->orWhere('host_id',$matches[2]);
- })
- ->join('zones',['zones.id'=>'nodes.zone_id'])
- ->join('domains',['domains.id'=>'zones.domain_id'])
- ->where('zones.active',TRUE)
- ->where('node_id',$matches[3])
- ->where('point_id',(isset($matches[5]) AND $matches[5]) ? $matches[5] : 0)
- ->when(isset($matches[7]),function($query) use ($matches) {
- $query->where('domains.name',$matches[7]);
- })
- ->when((! isset($matches[7]) OR ! $matches[7]),function($query) {
- $query->where('domains.default',TRUE);
- })
- ->single();
- }
-
- public function hasFlag($relation,$model): bool
- {
- return (bool) $this->{$relation}()
- ->wherePivot($model->getForeignKey(),$model->{$model->getKeyName()})
- ->count();
- }
-}
\ No newline at end of file
diff --git a/app/Models/Path.php b/app/Models/Path.php
deleted file mode 100644
index 2d70c7b..0000000
--- a/app/Models/Path.php
+++ /dev/null
@@ -1,10 +0,0 @@
-push($this->get_node(['z'=>$zo->id,'n'=>$net,'f'=>$node,'p'=>0],$create));
- }
-
- return $result;
- }
-}
\ No newline at end of file
diff --git a/database/migrations/2021_12_24_101812_drop_node.php b/database/migrations/2021_12_24_101812_drop_node.php
new file mode 100644
index 0000000..7a62571
--- /dev/null
+++ b/database/migrations/2021_12_24_101812_drop_node.php
@@ -0,0 +1,42 @@
+
ID | -Domain | -Node | -Active | -System | -Sysop | -
---|---|---|---|---|---|
Add New Node | -|||||
{{ $oo->id }} | -@if ($oo->zone_id){{ $oo->zone->name }}@else - @endif | -{{ $oo->ftn }} | -{{ $oo->active ? 'YES' : 'NO' }} | -{{ $oo->system }} | -{{ $oo->sysop }} | -