Compare commits
4 Commits
d5bcda7fec
...
d870a2a7d9
Author | SHA1 | Date | |
---|---|---|---|
d870a2a7d9 | |||
b920adf649 | |||
9987a8c32b | |||
3eea32a530 |
@ -277,7 +277,7 @@ class Node
|
|||||||
public function originate(Address $o): void
|
public function originate(Address $o): void
|
||||||
{
|
{
|
||||||
$this->originate = $o;
|
$this->originate = $o;
|
||||||
$this->ftns_authed = $o->system->match($o->zone);
|
$this->ftns_authed = $o->system->match($o->zone,Address::NODE_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -332,13 +332,13 @@ class Page
|
|||||||
$subtext = substr($this->text,$current_pos,$space_pos);
|
$subtext = substr($this->text,$current_pos,$space_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the reset of the string will fit on the current line
|
// If the rest of the string will fit on the current line
|
||||||
} elseif ($text_length-$current_pos < static::MSG_WIDTH-$buffer) {
|
} elseif ($text_length-$current_pos < static::MSG_WIDTH-$this->x-$buffer) {
|
||||||
$subtext = substr($this->text,$current_pos);
|
$subtext = substr($this->text,$current_pos);
|
||||||
|
|
||||||
// Get the next lines worth of chars, breaking on a space
|
// Get the next lines worth of chars, breaking on a space
|
||||||
} else {
|
} else {
|
||||||
$subtext = $this->text_substr(substr($this->text,$current_pos),static::MSG_WIDTH-$buffer);
|
$subtext = $this->text_substr(substr($this->text,$current_pos),static::MSG_WIDTH-$this->x-$buffer);
|
||||||
|
|
||||||
// Include the text up to the last space
|
// Include the text up to the last space
|
||||||
if (substr($this->text,$current_pos+strlen($subtext),1) !== ' ')
|
if (substr($this->text,$current_pos+strlen($subtext),1) !== ' ')
|
||||||
|
@ -51,8 +51,8 @@ class AddressIdle implements ShouldQueue
|
|||||||
// Delist DOWN nodes
|
// Delist DOWN nodes
|
||||||
foreach ($this->old($this->do,config('fido.idle.delist'),Address::NODE_DOWN,$this->ao) as $ao) {
|
foreach ($this->old($this->do,config('fido.idle.delist'),Address::NODE_DOWN,$this->ao) as $ao) {
|
||||||
// Only delist system that has been marked down
|
// Only delist system that has been marked down
|
||||||
// Only mark delist them if its been 7 days since they were marked DOWN
|
// Only mark delist them if its been 14 days since they were marked DOWN
|
||||||
if ((! $ao->is_down) || ($ao->updated_at->isPast(Carbon::now()->subWeek())))
|
if ((! $ao->is_down) || ($ao->updated_at->greaterThan(Carbon::now()->subWeeks(2))))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Log::info(sprintf('%s:- Delisting [%s], not seen for [%d] days',self::LOGKEY,$ao->ftn,config('fido.idle.delist')));
|
Log::info(sprintf('%s:- Delisting [%s], not seen for [%d] days',self::LOGKEY,$ao->ftn,config('fido.idle.delist')));
|
||||||
@ -130,8 +130,9 @@ class AddressIdle implements ShouldQueue
|
|||||||
$result->push($ao);
|
$result->push($ao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @todo Make sure we only process addresses that we are responsible for, eg: 1/999 shouldnt have been processed even though 3/999 as eligible (and they are were connected to the same system)
|
||||||
// Mark nodes as HOLD
|
// Mark nodes as HOLD
|
||||||
foreach ($this->old($this->do,config('fido.idle.hold'),0,$this->ao) as $ao) {
|
foreach ($this->old($this->do,config('fido.idle.hold'),Address::NODE_ALL,$this->ao) as $ao) {
|
||||||
// Ignore any systems that are a Discoverd System
|
// Ignore any systems that are a Discoverd System
|
||||||
if ($ao->system->name === System::default) {
|
if ($ao->system->name === System::default) {
|
||||||
Log::alert(sprintf('%s:! Ignoring HOLD for discovered System [%s]',self::LOGKEY,$ao->ftn));
|
Log::alert(sprintf('%s:! Ignoring HOLD for discovered System [%s]',self::LOGKEY,$ao->ftn));
|
||||||
|
@ -67,7 +67,6 @@ class MailSend #implements ShouldQueue
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
->filter(function($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)
|
if ($item->system->autohold)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ class Address extends Model
|
|||||||
})
|
})
|
||||||
->orWhere('host_id',$ftn['n']);
|
->orWhere('host_id',$ftn['n']);
|
||||||
})
|
})
|
||||||
->with(['system:id,active,name,address,pkt_msgs'])
|
->with(['system:id,active,name,address,pkt_msgs,last_session'])
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
// Check and see if we are a flattened domain, our address might be available with a different zone.
|
// Check and see if we are a flattened domain, our address might be available with a different zone.
|
||||||
@ -1193,10 +1193,17 @@ class Address extends Model
|
|||||||
*/
|
*/
|
||||||
public function netmailWaiting(): Builder
|
public function netmailWaiting(): Builder
|
||||||
{
|
{
|
||||||
|
// Addresses that our downstream of this address, except anybody that has session details with us
|
||||||
|
$ours = our_nodes($this->zone->domain)->pluck('id');
|
||||||
|
|
||||||
|
$addresses = $this->downstream()
|
||||||
|
->filter(fn($item)=>! $ours->contains($item->id))
|
||||||
|
->merge($this->system->match($this->zone,Address::NODE_ALL));
|
||||||
|
|
||||||
$netmails = $this
|
$netmails = $this
|
||||||
->UncollectedNetmail()
|
->UncollectedNetmail()
|
||||||
->select('netmails.id')
|
->select('netmails.id')
|
||||||
->whereIn('addresses.id',$this->downlinks()->add($this)->pluck('id'))
|
->whereIn('addresses.id',$addresses->pluck('id'))
|
||||||
->groupBy(['netmails.id'])
|
->groupBy(['netmails.id'])
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class AbsentNodes extends Echomails
|
|||||||
$msg->addText("The following nodes have had their status changed, because they are absent from the network.\r\r");
|
$msg->addText("The following nodes have had their status changed, because they are absent from the network.\r\r");
|
||||||
|
|
||||||
// Nodes marked HOLD - will be marked down ...
|
// Nodes marked HOLD - will be marked down ...
|
||||||
if (($x=$this->aos->filter(fn($item)=>$item->role & Address::NODE_HOLD))->count()) {
|
if (($x=$this->aos->filter(fn($item)=>$item->active && ($item->role & Address::NODE_HOLD)))->count()) {
|
||||||
$msg->addText("The following nodes have been marked HOLD:\r");
|
$msg->addText("The following nodes have been marked HOLD:\r");
|
||||||
|
|
||||||
foreach ($x as $ao)
|
foreach ($x as $ao)
|
||||||
@ -68,7 +68,7 @@ class AbsentNodes extends Echomails
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Nodes marked DOWN - will be delisted on...
|
// Nodes marked DOWN - will be delisted on...
|
||||||
if (($x=$this->aos->filter(fn($item)=>$item->role & Address::NODE_DOWN))->count()) {
|
if (($x=$this->aos->filter(fn($item)=>$item->active && ($item->role & Address::NODE_DOWN)))->count()) {
|
||||||
$msg->addText("The following nodes have been marked DOWN:\r");
|
$msg->addText("The following nodes have been marked DOWN:\r");
|
||||||
|
|
||||||
foreach ($x as $ao)
|
foreach ($x as $ao)
|
||||||
|
@ -63,7 +63,7 @@ class Echomail extends Matrix
|
|||||||
->withQueryParameters(['user_id'=>$user])
|
->withQueryParameters(['user_id'=>$user])
|
||||||
->post(sprintf('https://%s/_matrix/client/v3/rooms/%s/send/m.room.message',config('matrix.server'),$room),[
|
->post(sprintf('https://%s/_matrix/client/v3/rooms/%s/send/m.room.message',config('matrix.server'),$room),[
|
||||||
'msgtype'=>'m.text',
|
'msgtype'=>'m.text',
|
||||||
'body'=>mb_convert_encoding(str_replace("\r","\n",$this->o->msg),'UTF-8','IBM850'),
|
'formatted_body'=>sprintf("```\n%s\n```",mb_convert_encoding(str_replace("\r","\n",$this->o->msg),'UTF-8','IBM850')),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
switch ($msg->status()) {
|
switch ($msg->status()) {
|
||||||
|
@ -35,9 +35,9 @@ class NodeDelisted extends Netmails //implements ShouldQueue
|
|||||||
$o = $this->setupNetmail($notifiable);
|
$o = $this->setupNetmail($notifiable);
|
||||||
$ao = $notifiable->routeNotificationFor(static::via);
|
$ao = $notifiable->routeNotificationFor(static::via);
|
||||||
|
|
||||||
Log::info(sprintf('%s:+ Sending a NODE MARKED HOLD for address [%s]',self::LOGKEY,$ao->ftn));
|
Log::info(sprintf('%s:+ Sending a NODE DE-LISTED for address [%s]',self::LOGKEY,$ao->ftn));
|
||||||
|
|
||||||
$o->subject = sprintf('Your system has been DE-LISTED from %s',$x=$ao->zone->domain->name);
|
$o->subject = sprintf('Your system has been DE-LISTED from %s',$x=$this->ao->zone->domain->name);
|
||||||
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
|
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
|
||||||
|
|
||||||
// Message
|
// Message
|
||||||
@ -46,7 +46,7 @@ class NodeDelisted extends Netmails //implements ShouldQueue
|
|||||||
$msg->addText(sprintf("Hi %s,\r\r",$this->ao->system->sysop))
|
$msg->addText(sprintf("Hi %s,\r\r",$this->ao->system->sysop))
|
||||||
->addText(sprintf("Your system has been marked **DE-LISTED**, because it hasnt polled **%s** with address %s since **%s** (%d days).\r",$this->ao->zone->domain->name,$this->ao->ftn4d,$this->ao->system->last_session->format('Y-m-d'),$this->ao->system->last_session->diffInDays($now)))
|
->addText(sprintf("Your system has been marked **DE-LISTED**, because it hasnt polled **%s** with address %s since **%s** (%d days).\r",$this->ao->zone->domain->name,$this->ao->ftn4d,$this->ao->system->last_session->format('Y-m-d'),$this->ao->system->last_session->diffInDays($now)))
|
||||||
->addText("\r")
|
->addText("\r")
|
||||||
->addText("If you think this was a mistake, please let me know.\r")
|
->addText("If you think this was a mistake, please let me know.\r\r")
|
||||||
->addText(sprintf('If you think about returning to %s, then reach out and we can get you back online pretty quickly.',$x));
|
->addText(sprintf('If you think about returning to %s, then reach out and we can get you back online pretty quickly.',$x));
|
||||||
|
|
||||||
$o->msg = $msg->render();
|
$o->msg = $msg->render();
|
||||||
|
@ -180,6 +180,9 @@
|
|||||||
@if (($x=$o->uplink()) && ($x->id !== $o->id))
|
@if (($x=$o->uplink()) && ($x->id !== $o->id))
|
||||||
<br><small>[via <a href="{{ url('system/addedit',$x->system_id) }}">{{ $x->ftn4d }}</a>]</small>
|
<br><small>[via <a href="{{ url('system/addedit',$x->system_id) }}">{{ $x->ftn4d }}</a>]</small>
|
||||||
@endif
|
@endif
|
||||||
|
@if($o->is_down || $o->is_hold)
|
||||||
|
<br><div class="btn btn-sm btn-secondary p-1 m-0"><small>@if($o->is_down)DOWN @elseif($o->is_hold)HOLD @else? @endif</small></div>
|
||||||
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $o->ftn4d }}</td>
|
<td>{{ $o->ftn4d }}</td>
|
||||||
<td class="text-end">{{ number_format($o->uncollected_echomail ?? 0) }}</td>
|
<td class="text-end">{{ number_format($o->uncollected_echomail ?? 0) }}</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user