Compare commits

...

4 Commits

Author SHA1 Message Date
2458ca2408 Fix nodelist segment being sent from queue where gethostname() is only a container name, added ability to control filename when sending nodelist segment
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 38s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m38s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
2025-03-18 17:26:17 +11:00
3797f3c7c5 Update robots.txt 2025-03-18 17:26:17 +11:00
bbc013a7a0 Fix Delist warning date on subject line of messages 2025-03-18 17:26:17 +11:00
db34b2b641 Highlight packet configuration is not mailer configuration in system/addedit 2025-02-07 13:47:36 +11:00
7 changed files with 34 additions and 21 deletions

View File

@ -18,7 +18,7 @@ class NodelistSegment extends Dynamic
{
private const LOGKEY = 'DNL';
private string $name = '';
private ?string $name;
private Address $our_address;
private Carbon $now;
@ -27,11 +27,7 @@ class NodelistSegment extends Dynamic
$this->our_address = our_address($ao->zone->domain)->first();
$this->now = Carbon::now();
$this->name = sprintf('z%dn%d.%d',
$this->our_address->zone->zone_id,
$this->our_address->host_id,
$this->now->format('z'),
);
$this->name = $arg->get('name','');
Log::debug(sprintf('%s:- Generating Nodelist for [%s] from [%s] as [%s] with arguments',self::LOGKEY,$ao->ftn,$this->our_address->ftn,$this->our_address->role_name),['args'=>$arg]);
}
@ -157,6 +153,8 @@ class NodelistSegment extends Dynamic
public function getName(): string
{
return $this->name;
return ($this->name ?: sprintf('z%dn%d',
$this->our_address->zone->zone_id,
$this->our_address->host_id)).'.'.sprintf('%03d',$this->now->format('z'));
}
}

View File

@ -26,7 +26,9 @@ class DynamicItem extends Command
$d = new Dynamic($do,$do->address,Send::T_FILE);
$d->open();
echo $d->read($d->size);
echo $d->read($d->size)."\n";
$this->alert('File sent as:'.$d->nameas);
return self::SUCCESS;
}

View File

@ -42,10 +42,11 @@ class NodeMarkedDown extends Notification //implements ShouldQueue
Log::info(sprintf('%s:+ Sending a NODE MARKED DOWN EMAIL for address [%s]',self::LOGKEY,$this->ao->ftn));
$now = Carbon::now();
$delist = $now->addDays(7);
return (new MailMessage)
->cc(our_address($this->ao)->system->users->first()->email)
->subject(sprintf('ACTION REQUIRED: Your system will be delisted on %s',$now->format('Y-m-d')))
->subject(sprintf('ACTION REQUIRED: Your system will be delisted on %s',$delist->format('Y-m-d')))
->line(sprintf('Your system has been marked **DOWN**, because it hasnt polled **%s** with address %s since **%s** (%d days).',
$this->ao->zone->domain->name,
$this->ao->ftn4d,
@ -57,7 +58,7 @@ class NodeMarkedDown extends Notification //implements ShouldQueue
->line(sprintf('* %s Echomails',number_format($this->ao->echomailWaiting()->count())))
->line(sprintf('* %s Files',number_format($this->ao->filesWaiting()->count())))
->line('')
->line(sprintf('Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**',$now->addDays(7)->format('Y-m-d')))
->line(sprintf('Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**',$delist->format('Y-m-d')))
->line('If you think you\'ve received this email by mistake or need help, please let me know.');
}
}

View File

@ -32,11 +32,12 @@ class NodeMarkedDown extends Netmails //implements ShouldQueue
{
$now = Carbon::now();
$ao = $notifiable->routeNotificationFor(static::via);
$delist = $now->addDays(7);
Log::info(sprintf('%s:+ Sending a NODE MARKED DOWN NETMAIL for address [%s]',self::LOGKEY,$ao->ftn));
$o = $this->setupNetmail($notifiable);
$o->subject = sprintf('ACTION REQUIRED: Your system will be delisted on %s',$now->format('Y-m-d'));
$o->subject = sprintf('ACTION REQUIRED: Your system will be delisted on %s',$delist->format('Y-m-d'));
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
// Message
@ -50,7 +51,7 @@ class NodeMarkedDown extends Netmails //implements ShouldQueue
->addText(sprintf("* %s Echomails\r",number_format($this->ao->echomailWaiting()->count())))
->addText(sprintf("* %s Files\r",number_format($this->ao->filesWaiting()->count())))
->addText("\r")
->addText(sprintf("Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**\r\r",$now->addDays(7)->format('Y-m-d')))
->addText(sprintf("Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**\r\r",$delist->format('Y-m-d')))
->addText("If you think you've received this netmail by mistake or need help, please let me know.\r");
$o->msg = $msg->render();

View File

@ -141,22 +141,23 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
function our_hostname(Address $o): string
{
$our = our_address($o->domain)->first();
$ourhostname = $our->system->address;
switch ($our->role_id) {
case Address::NODE_ZC:
$domain = collect(explode('.',gethostname()))->forget(0)
$domain = collect(explode('.',$ourhostname))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id));
break;
case Address::NODE_RC:
case Address::NODE_NC:
$domain = collect(explode('.',gethostname()))->forget(0)
$domain = collect(explode('.',$ourhostname))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id))
->prepend(sprintf('n%d',$our->host_id));
break;
case Address::NODE_HC:
$domain = collect(explode('.',gethostname()))->forget(0)
$domain = collect(explode('.',$ourhostname))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id))
->prepend(sprintf('n%d',$our->host_id))
->prepend(sprintf('f%d',$our->node_id));

View File

@ -1,3 +1,8 @@
User-agent: *
Allow: /about
Disallow: /
Disallow: /address
Disallow: /echomail
Disallow: /login
Disallow: /netmail
Disallow: /search
Disallow: /status
Disallow: /user

View File

@ -144,12 +144,12 @@
<div class="row pt-4">
<!-- Mailer Details -->
<div class="col-12">
<div class="col-3">
<h4 class="mb-0 pb-2">Mailer Details</h4>
<!-- Mailer Ports -->
<div class="row pt-0">
<div class="col-3">
<div class="col-12">
@foreach (Mailer::all() as $mo)
@php($x=$o->mailers->find($mo))
<div class="row pt-0">
@ -171,14 +171,19 @@
</div>
@endforeach
</div>
</div>
</div>
<div class="offset-1 col-8">
<h4 class="mb-0 pb-2">Packet Details</h4>
<div class="row pt-0">
<!-- Mail Packet -->
<div class="col-4">
<div class="col-6">
<x-form.select name="pkt_type" icon="bi-ui-radios" label="Mail Packet" feedback="Set a packet type" :value="$o->pkt_type ?: config('fido.packet_default')" :options="collect(Packet::PACKET_TYPES)->map(fn($item,$key)=>['id'=>$key,'value'=>$key])" required :disabled="Gate::denies('update_nn',$o)"/>
</div>
<!-- Packet Msgs -->
<div class="col-2">
<div class="col-3">
<label for="pkt_msgs" class="form-label w-100">Packet Msgs</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>