diff --git a/app/Jobs/AddressIdle.php b/app/Jobs/AddressIdle.php index d65742c..c24245d 100644 --- a/app/Jobs/AddressIdle.php +++ b/app/Jobs/AddressIdle.php @@ -194,7 +194,7 @@ class AddressIdle implements ShouldQueue return collect(); $age = Carbon::now()->subDays($days)->endOfDay(); - $ours = our_address($do)->pluck('ftn'); + $ours = our_address($do,FALSE)->pluck('ftn'); return Address::FTN() ->ActiveFTN() diff --git a/app/Jobs/MessageProcess.php b/app/Jobs/MessageProcess.php index aa4fb9c..cba855b 100644 --- a/app/Jobs/MessageProcess.php +++ b/app/Jobs/MessageProcess.php @@ -60,7 +60,7 @@ class MessageProcess implements ShouldQueue $this->mo = unserialize(utf8_decode($this->mo)); // Load our details - $ftns = our_address(); + $ftns = our_address(NULL,FALSE); // If we are a netmail if ($this->mo instanceof Netmail) { diff --git a/app/Jobs/NodelistImport.php b/app/Jobs/NodelistImport.php index 94d96c6..040b450 100644 --- a/app/Jobs/NodelistImport.php +++ b/app/Jobs/NodelistImport.php @@ -115,12 +115,12 @@ class NodelistImport implements ShouldQueue } $file_crc = (int)$matches[4]; - $do = Domain::where('name',strtolower($matches[1] ?: $this->domain))->single(); + $do = Domain::where('name',strtolower($this->domain ?: $matches[1]))->single(); if (! $do) { Log::error(sprintf('%s:! Domain not found [%s].',static::LOGKEY,strtolower($matches[1] ?: $this->domain))); - throw new \Exception('Nodelist Domain not found: '.$this->file); + throw new \Exception('Nodelist Domain not found: '.($this->domain ?: $matches[1])); } $date = Carbon::createFromFormat('D, M d, Y H:i',$matches[2].'0:00'); @@ -143,6 +143,8 @@ class NodelistImport implements ShouldQueue elseif ($no->addresses->count()) { Log::error(sprintf('%s:! Nodelist [%s] for [%s] has existing records [%d]',self::LOGKEY,$date,$do->name,$no->addresses->count())); + // This can occur when a nodelist doesnt change, but is sent out anyway + // @todo Need to immediately fail this job return; } @@ -291,7 +293,7 @@ class NodelistImport implements ShouldQueue Log::info(sprintf('%s:- Processing existing address [%s] (%d)',self::LOGKEY,$ao->ftn,$ao->id)); // If the address is linked to a user's system, or our system, we'll not process it any further - if (our_address()->contains($ao->id)) { + if (our_address(NULL,FALSE)->contains($ao->id)) { Log::info(sprintf('%s:! Limiting update to an address belonging to me',self::LOGKEY)); $protect = TRUE; @@ -563,7 +565,7 @@ class NodelistImport implements ShouldQueue ->filter(fn($item)=>(! $item->point_id)) ->pluck('id') ->diff($no->addresses->pluck('id')) - ->diff(our_address($do)->pluck('id')) + ->diff(our_address($do,FALSE)->pluck('id')) ->diff(our_nodes($do)->pluck('id')); $remove = Address::whereIn('id',$remove)->get(); diff --git a/app/Jobs/PacketProcess.php b/app/Jobs/PacketProcess.php index ba185a5..f77d9dc 100644 --- a/app/Jobs/PacketProcess.php +++ b/app/Jobs/PacketProcess.php @@ -89,7 +89,7 @@ class PacketProcess implements ShouldQueue } // Check the packet is to our address, if not we'll reject it. - if (! our_address($pkt->tftn->zone->domain)->contains($pkt->tftn)) { + if (! our_address($pkt->tftn->zone->domain,FALSE)->contains($pkt->tftn)) { Log::error(sprintf('%s:! Packet [%s] is not to our address? [%s]',self::LOGKEY,$this->filename,$pkt->tftn->ftn)); // @todo Notification::route('netmail',$pkt->fftn)->notify(new UnexpectedPacketToUs($this->filename)); @@ -123,7 +123,7 @@ class PacketProcess implements ShouldQueue Log::info(sprintf('%s:- Netmail from [%s] to [%s]',self::LOGKEY,$msg->fftn->ftn,$msg->tftn?->ftn ?: $msg->set_tftn)); // If we dont have a destination, we need to bounce it, if we would be the parent of the address - if ((! $msg->tftn) && our_address()->contains(Address::newFTN($msg->set_tftn)?->parent())) { + if ((! $msg->tftn) && our_address(NULL,FALSE)->contains(Address::newFTN($msg->set_tftn)?->parent())) { Log::alert(sprintf('%s:! Netmail destination [%s] doesnt exist, bouncing back to [%s]',self::LOGKEY,$msg->set_tftn,$pkt->fftn->ftn)); Notification::route('netmail',$msg->fftn)->notify(new NetmailNoDestination($msg)); diff --git a/app/Models/Address.php b/app/Models/Address.php index e3e2665..2cd197b 100644 --- a/app/Models/Address.php +++ b/app/Models/Address.php @@ -1024,7 +1024,7 @@ class Address extends Model public function downlinks(): Collection { // We have no session data for this address, (and its not our address), by definition it has no children - if (! $this->is_hosted && (! our_address()->pluck('id')->contains($this->id))) + if (! $this->is_hosted && (! our_address(NULL,FALSE)->pluck('id')->contains($this->id))) return new Collection; // If this system is not marked to default route for this address diff --git a/app/Models/Echomail.php b/app/Models/Echomail.php index a37cf19..1cf4709 100644 --- a/app/Models/Echomail.php +++ b/app/Models/Echomail.php @@ -184,12 +184,14 @@ final class Echomail extends Model implements Packet Log::debug(sprintf('%s:^ Message [%d] from point address is [%d]',self::LOGKEY,$model->id,$model->fftn->point_id)); // Make sure our sender is first in the path + // @todo we need to capture the path for mail directly from points so we dont re-export to it. if (($model->fftn->point_id === 0) && (! $model->isFlagSet(Message::FLAG_LOCAL)) && (! $path->contains($model->fftn_id))) { Log::alert(sprintf('%s:? Echomail adding sender to start of PATH [%s].',self::LOGKEY,$model->fftn_id)); $path->prepend($model->fftn_id); } // Make sure our pktsrc is last in the path + // @todo mail directly from points may have a blank path, so we need to make one up. if ($model->set->has('set_sender') && (! $path->contains($model->set->get('set_sender')->id)) && ($model->set->get('set_sender')->point_id === 0)) { Log::alert(sprintf('%s:? Echomail adding pktsrc to end of PATH [%s].',self::LOGKEY,$model->set->get('set_sender')->ftn)); $path->push($model->set->get('set_sender')->id); @@ -257,7 +259,7 @@ final class Echomail extends Model implements Packet ->addresses ->filter(function($item) use ($model) { return $model->echoarea->can_read($item->security); }) ->pluck('id') - ->diff(our_address($model->fftn->zone->domain)->pluck('id')) + ->diff(our_address($model->fftn->zone->domain,FALSE)->pluck('id')) ->diff($seenby); if ($exportto->count()) { diff --git a/app/helpers.php b/app/helpers.php index e54aca4..ada1663 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -155,7 +155,7 @@ function our_address(Domain|Address $o=NULL,bool $public=TRUE): Collection|Addre function our_hostname(Address $o): string { - $our = our_address($o->domain)->first(); + $our = our_address($o->domain,FALSE)->first(); $ourhostname = $our->system->address; switch ($our->role_id) { diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 3c9d744..b1e197c 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -24,7 +24,7 @@ $user->load(['systems.akas.zone.domain.echoareas','systems.akas.echoareas']);