Updates now that we have updated our_address() to differentiate public/mailer advertised addresses with all our addresses
This commit is contained in:
parent
b59317871a
commit
c49daadc5f
@ -194,7 +194,7 @@ class AddressIdle implements ShouldQueue
|
|||||||
return collect();
|
return collect();
|
||||||
|
|
||||||
$age = Carbon::now()->subDays($days)->endOfDay();
|
$age = Carbon::now()->subDays($days)->endOfDay();
|
||||||
$ours = our_address($do)->pluck('ftn');
|
$ours = our_address($do,FALSE)->pluck('ftn');
|
||||||
|
|
||||||
return Address::FTN()
|
return Address::FTN()
|
||||||
->ActiveFTN()
|
->ActiveFTN()
|
||||||
|
@ -60,7 +60,7 @@ class MessageProcess implements ShouldQueue
|
|||||||
$this->mo = unserialize(utf8_decode($this->mo));
|
$this->mo = unserialize(utf8_decode($this->mo));
|
||||||
|
|
||||||
// Load our details
|
// Load our details
|
||||||
$ftns = our_address();
|
$ftns = our_address(NULL,FALSE);
|
||||||
|
|
||||||
// If we are a netmail
|
// If we are a netmail
|
||||||
if ($this->mo instanceof Netmail) {
|
if ($this->mo instanceof Netmail) {
|
||||||
|
@ -115,12 +115,12 @@ class NodelistImport implements ShouldQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
$file_crc = (int)$matches[4];
|
$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) {
|
if (! $do) {
|
||||||
Log::error(sprintf('%s:! Domain not found [%s].',static::LOGKEY,strtolower($matches[1] ?: $this->domain)));
|
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');
|
$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()) {
|
elseif ($no->addresses->count()) {
|
||||||
Log::error(sprintf('%s:! Nodelist [%s] for [%s] has existing records [%d]',self::LOGKEY,$date,$do->name,$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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,7 +293,7 @@ class NodelistImport implements ShouldQueue
|
|||||||
Log::info(sprintf('%s:- Processing existing address [%s] (%d)',self::LOGKEY,$ao->ftn,$ao->id));
|
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 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));
|
Log::info(sprintf('%s:! Limiting update to an address belonging to me',self::LOGKEY));
|
||||||
$protect = TRUE;
|
$protect = TRUE;
|
||||||
|
|
||||||
@ -563,7 +565,7 @@ class NodelistImport implements ShouldQueue
|
|||||||
->filter(fn($item)=>(! $item->point_id))
|
->filter(fn($item)=>(! $item->point_id))
|
||||||
->pluck('id')
|
->pluck('id')
|
||||||
->diff($no->addresses->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'));
|
->diff(our_nodes($do)->pluck('id'));
|
||||||
|
|
||||||
$remove = Address::whereIn('id',$remove)->get();
|
$remove = Address::whereIn('id',$remove)->get();
|
||||||
|
@ -89,7 +89,7 @@ class PacketProcess implements ShouldQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check the packet is to our address, if not we'll reject it.
|
// 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));
|
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));
|
// @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));
|
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 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));
|
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));
|
Notification::route('netmail',$msg->fftn)->notify(new NetmailNoDestination($msg));
|
||||||
|
@ -1024,7 +1024,7 @@ class Address extends Model
|
|||||||
public function downlinks(): Collection
|
public function downlinks(): Collection
|
||||||
{
|
{
|
||||||
// We have no session data for this address, (and its not our address), by definition it has no children
|
// 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;
|
return new Collection;
|
||||||
|
|
||||||
// If this system is not marked to default route for this address
|
// If this system is not marked to default route for this address
|
||||||
|
@ -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));
|
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
|
// 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))) {
|
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));
|
Log::alert(sprintf('%s:? Echomail adding sender to start of PATH [%s].',self::LOGKEY,$model->fftn_id));
|
||||||
$path->prepend($model->fftn_id);
|
$path->prepend($model->fftn_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure our pktsrc is last in the path
|
// 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)) {
|
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));
|
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);
|
$path->push($model->set->get('set_sender')->id);
|
||||||
@ -257,7 +259,7 @@ final class Echomail extends Model implements Packet
|
|||||||
->addresses
|
->addresses
|
||||||
->filter(function($item) use ($model) { return $model->echoarea->can_read($item->security); })
|
->filter(function($item) use ($model) { return $model->echoarea->can_read($item->security); })
|
||||||
->pluck('id')
|
->pluck('id')
|
||||||
->diff(our_address($model->fftn->zone->domain)->pluck('id'))
|
->diff(our_address($model->fftn->zone->domain,FALSE)->pluck('id'))
|
||||||
->diff($seenby);
|
->diff($seenby);
|
||||||
|
|
||||||
if ($exportto->count()) {
|
if ($exportto->count()) {
|
||||||
|
@ -155,7 +155,7 @@ function our_address(Domain|Address $o=NULL,bool $public=TRUE): Collection|Addre
|
|||||||
|
|
||||||
function our_hostname(Address $o): string
|
function our_hostname(Address $o): string
|
||||||
{
|
{
|
||||||
$our = our_address($o->domain)->first();
|
$our = our_address($o->domain,FALSE)->first();
|
||||||
$ourhostname = $our->system->address;
|
$ourhostname = $our->system->address;
|
||||||
|
|
||||||
switch ($our->role_id) {
|
switch ($our->role_id) {
|
||||||
|
@ -24,7 +24,7 @@ $user->load(['systems.akas.zone.domain.echoareas','systems.akas.echoareas']);
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@if(($x=$user
|
@if(($x=$user
|
||||||
->addresses()
|
->addresses()
|
||||||
->diff(our_address())
|
->diff(our_address(NULL,FALSE))
|
||||||
->filter(fn($item)=>($item->point_id === 0) && ($item->zone->domain->isManaged())))->count())
|
->filter(fn($item)=>($item->point_id === 0) && ($item->zone->domain->isManaged())))->count())
|
||||||
<h2>Hub Details for your nets</h2>
|
<h2>Hub Details for your nets</h2>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user