Compare commits

...

5 Commits

Author SHA1 Message Date
d3a9e36bb7 Debugging when msgid's are auto added
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 39s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m51s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
2024-06-26 16:49:29 +10:00
2f55de2ddf We need to reload the system address for notifications 2024-06-26 16:49:11 +10:00
b34b046d3c Fix polling for messages sent via uplinks, where those systems which had a status of HOLD 2024-06-26 16:47:10 +10:00
7c23971e58 Recognise all AKAs for a system when we are polling it with one of it's AKAs in a domain 2024-06-26 16:03:58 +10:00
91d4cd0b2f Lower the severity of a message when an AKA is not in our domain 2024-06-26 16:02:26 +10:00
5 changed files with 23 additions and 34 deletions

View File

@ -38,6 +38,7 @@ class Node
private Collection $ftns_authed; // The FTNs we have validated
private Collection $ftns_other; // Other FTN addresses presented
private bool $authed; // Have we authenticated the remote.
private Address $originate; // When we originate a call, this is who we are after
private int $options; // This nodes capabilities/options
@ -84,9 +85,9 @@ class Node
// The nodes password
case 'password':
// If we have already authed, we'll use that password.
if ($this->ftns_authed->count())
return $this->ftns_authed->first()->pass_session;
// If we are originating a session, we'll use that password.
if (isset($this->originate))
return $this->originate->pass_session;
else
return ($this->ftns->count() && ($x=$this->ftns->first()->pass_session)) ? $x : '-';
@ -194,6 +195,8 @@ class Node
throw new Exception('Already authed');
foreach ($this->ftns as $o) {
Log::debug(sprintf('%s:- Attempting to authenticate [%s] with [%s]',self::LOGKEY,$o->ftn,$o->pass_session));
if (! $sespass=$o->pass_session)
continue;
@ -269,7 +272,8 @@ class Node
*/
public function originate(Address $o): void
{
$this->ftns_authed->push($o);
$this->originate = $o;
$this->ftns_authed = $o->system->match($o->zone);
}
/**
@ -283,19 +287,9 @@ class Node
if ($this->authed)
return TRUE;
if ($this->ftns_authed->count() !== 1 || ! $this->ftns->count())
return FALSE;
Log::debug(sprintf('%s:- Making sure we called [%s] from [%s]',self::LOGKEY,$this->originate->ftn,$this->ftns->pluck('ftn')->join(',')));
$ftn = $this->ftns_authed->first()->ftn;
return $this->ftns->search(function($item) use ($ftn) {
if ($item->ftn === $ftn) {
$item->system->last_session = Carbon::now();
$item->system->save();
$this->authed = TRUE;
return TRUE;
}
}) !== FALSE;
return $this->ftns->pluck('ftn')->contains($this->originate->ftn);
}
public function optionClear(int $key): void

View File

@ -711,7 +711,7 @@ final class Binkp extends BaseProtocol
// If we only present limited AKAs dont validate password against akas outside of the domains we present
} elseif (is_null(our_address($o))) {
Log::alert(sprintf('%s:/ AKA domain [%s] is not in our domain(s) [%s] - ignoring',self::LOGKEY,$o->zone->domain->name,our_address()->pluck('zone.domain.name')->unique()->join(',')));
Log::debug(sprintf('%s:/ AKA domain [%s] is not in our domain(s) [%s] - ignoring',self::LOGKEY,$o->zone->domain->name,our_address()->pluck('zone.domain.name')->unique()->join(',')));
$this->node->ftn_other = $rem_aka;
continue;

View File

@ -48,21 +48,6 @@ class MailSend #implements ShouldQueue
->join('systems',['systems.id'=>'a.system_id'])
->join('zones',['zones.id'=>'a.zone_id'])
->join('domains',['domains.id'=>'zones.domain_id'])
->where(function($query) {
return $query->whereNull('autohold')
->orWhere('autohold',FALSE);
})
->when(! is_null($this->crash),function($query) {
return $query->when(
$this->crash,
function($query) {
return $query->where('pollmode',$this->crash);
},
function($query) {
return $query->whereNotNull('pollmode');
}
);
})
->groupBy('a.system_id','a.id','a.zone_id','addresses.region_id','a.host_id','a.node_id','a.point_id','addresses.hub_id','addresses.role')
->with(['system','zone.domain'])
->dontCache()
@ -80,7 +65,14 @@ class MailSend #implements ShouldQueue
} else {
return $item;
}
});
})
->filter(function($item) {
if ($item->ftn3d === '1337:1/100') dump(['item'=>$item,'ftn'=>$item->ftn,'autohold'=>$item->system->authold,'pollmode'=>$item->system->pollmode,'crash'=>$this->crash]);
if ($item->system->autohold)
return NULL;
return is_null($this->crash) || ($item->system->pollmode) || ($item->system->pollmode === $this->crash) ? $item : NULL;
});
foreach ($u->groupBy('ftn') as $oo) {
if (Job::where('queue','poll')->get()->pluck('command.address.id')->search(($x=$oo->first())->id) === FALSE) {

View File

@ -51,6 +51,7 @@ abstract class Netmails extends Notification //implements ShouldQueue
{
// @todo Redirect netmails to Hubs or higher to the admin
$ao = $notifiable->routeNotificationFor(static::via);
$ao->load('system');
$o = new Netmail;
$o->to = $ao->system->sysop;

View File

@ -6,9 +6,9 @@
namespace App\Traits;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use App\Classes\FTN\Message;
use App\Models\Setup;
trait MsgID
{
@ -18,6 +18,8 @@ trait MsgID
if ((! $this->exists) && ($this->flags & Message::FLAG_LOCAL) && (is_null(Arr::get($this->attributes,'msgid')))) {
$ftn = our_address($this->fftn);
$this->attributes['msgid'] = sprintf('%s %08x',$ftn->ftn4d,timew());
Log::debug(sprintf('%s:- Auto setting msgid to [%s]',self::LOGKEY,$this->attributes['msgid']));
}
return parent::save($options);