Compare commits
4 Commits
b1eaec3271
...
2458ca2408
Author | SHA1 | Date | |
---|---|---|---|
2458ca2408 | |||
3797f3c7c5 | |||
bbc013a7a0 | |||
db34b2b641 |
@ -18,7 +18,7 @@ class NodelistSegment extends Dynamic
|
|||||||
{
|
{
|
||||||
private const LOGKEY = 'DNL';
|
private const LOGKEY = 'DNL';
|
||||||
|
|
||||||
private string $name = '';
|
private ?string $name;
|
||||||
private Address $our_address;
|
private Address $our_address;
|
||||||
private Carbon $now;
|
private Carbon $now;
|
||||||
|
|
||||||
@ -27,11 +27,7 @@ class NodelistSegment extends Dynamic
|
|||||||
$this->our_address = our_address($ao->zone->domain)->first();
|
$this->our_address = our_address($ao->zone->domain)->first();
|
||||||
$this->now = Carbon::now();
|
$this->now = Carbon::now();
|
||||||
|
|
||||||
$this->name = sprintf('z%dn%d.%d',
|
$this->name = $arg->get('name','');
|
||||||
$this->our_address->zone->zone_id,
|
|
||||||
$this->our_address->host_id,
|
|
||||||
$this->now->format('z'),
|
|
||||||
);
|
|
||||||
|
|
||||||
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]);
|
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
|
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'));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -26,7 +26,9 @@ class DynamicItem extends Command
|
|||||||
$d = new Dynamic($do,$do->address,Send::T_FILE);
|
$d = new Dynamic($do,$do->address,Send::T_FILE);
|
||||||
|
|
||||||
$d->open();
|
$d->open();
|
||||||
echo $d->read($d->size);
|
echo $d->read($d->size)."\n";
|
||||||
|
|
||||||
|
$this->alert('File sent as:'.$d->nameas);
|
||||||
|
|
||||||
return self::SUCCESS;
|
return self::SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -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));
|
Log::info(sprintf('%s:+ Sending a NODE MARKED DOWN EMAIL for address [%s]',self::LOGKEY,$this->ao->ftn));
|
||||||
|
|
||||||
$now = Carbon::now();
|
$now = Carbon::now();
|
||||||
|
$delist = $now->addDays(7);
|
||||||
|
|
||||||
return (new MailMessage)
|
return (new MailMessage)
|
||||||
->cc(our_address($this->ao)->system->users->first()->email)
|
->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).',
|
->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->zone->domain->name,
|
||||||
$this->ao->ftn4d,
|
$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 Echomails',number_format($this->ao->echomailWaiting()->count())))
|
||||||
->line(sprintf('* %s Files',number_format($this->ao->filesWaiting()->count())))
|
->line(sprintf('* %s Files',number_format($this->ao->filesWaiting()->count())))
|
||||||
->line('')
|
->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.');
|
->line('If you think you\'ve received this email by mistake or need help, please let me know.');
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -32,11 +32,12 @@ class NodeMarkedDown extends Netmails //implements ShouldQueue
|
|||||||
{
|
{
|
||||||
$now = Carbon::now();
|
$now = Carbon::now();
|
||||||
$ao = $notifiable->routeNotificationFor(static::via);
|
$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));
|
Log::info(sprintf('%s:+ Sending a NODE MARKED DOWN NETMAIL for address [%s]',self::LOGKEY,$ao->ftn));
|
||||||
|
|
||||||
$o = $this->setupNetmail($notifiable);
|
$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);
|
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
|
||||||
|
|
||||||
// Message
|
// 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 Echomails\r",number_format($this->ao->echomailWaiting()->count())))
|
||||||
->addText(sprintf("* %s Files\r",number_format($this->ao->filesWaiting()->count())))
|
->addText(sprintf("* %s Files\r",number_format($this->ao->filesWaiting()->count())))
|
||||||
->addText("\r")
|
->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");
|
->addText("If you think you've received this netmail by mistake or need help, please let me know.\r");
|
||||||
|
|
||||||
$o->msg = $msg->render();
|
$o->msg = $msg->render();
|
||||||
|
@ -141,22 +141,23 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
|
|||||||
function our_hostname(Address $o): string
|
function our_hostname(Address $o): string
|
||||||
{
|
{
|
||||||
$our = our_address($o->domain)->first();
|
$our = our_address($o->domain)->first();
|
||||||
|
$ourhostname = $our->system->address;
|
||||||
|
|
||||||
switch ($our->role_id) {
|
switch ($our->role_id) {
|
||||||
case Address::NODE_ZC:
|
case Address::NODE_ZC:
|
||||||
$domain = collect(explode('.',gethostname()))->forget(0)
|
$domain = collect(explode('.',$ourhostname))->forget(0)
|
||||||
->prepend(sprintf('z%d',$our->zone->zone_id));
|
->prepend(sprintf('z%d',$our->zone->zone_id));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Address::NODE_RC:
|
case Address::NODE_RC:
|
||||||
case Address::NODE_NC:
|
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('z%d',$our->zone->zone_id))
|
||||||
->prepend(sprintf('n%d',$our->host_id));
|
->prepend(sprintf('n%d',$our->host_id));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Address::NODE_HC:
|
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('z%d',$our->zone->zone_id))
|
||||||
->prepend(sprintf('n%d',$our->host_id))
|
->prepend(sprintf('n%d',$our->host_id))
|
||||||
->prepend(sprintf('f%d',$our->node_id));
|
->prepend(sprintf('f%d',$our->node_id));
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
Allow: /about
|
Disallow: /address
|
||||||
Disallow: /
|
Disallow: /echomail
|
||||||
|
Disallow: /login
|
||||||
|
Disallow: /netmail
|
||||||
|
Disallow: /search
|
||||||
|
Disallow: /status
|
||||||
|
Disallow: /user
|
||||||
|
@ -144,12 +144,12 @@
|
|||||||
|
|
||||||
<div class="row pt-4">
|
<div class="row pt-4">
|
||||||
<!-- Mailer Details -->
|
<!-- Mailer Details -->
|
||||||
<div class="col-12">
|
<div class="col-3">
|
||||||
<h4 class="mb-0 pb-2">Mailer Details</h4>
|
<h4 class="mb-0 pb-2">Mailer Details</h4>
|
||||||
|
|
||||||
<!-- Mailer Ports -->
|
<!-- Mailer Ports -->
|
||||||
<div class="row pt-0">
|
<div class="row pt-0">
|
||||||
<div class="col-3">
|
<div class="col-12">
|
||||||
@foreach (Mailer::all() as $mo)
|
@foreach (Mailer::all() as $mo)
|
||||||
@php($x=$o->mailers->find($mo))
|
@php($x=$o->mailers->find($mo))
|
||||||
<div class="row pt-0">
|
<div class="row pt-0">
|
||||||
@ -171,14 +171,19 @@
|
|||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</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 -->
|
<!-- 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)"/>
|
<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>
|
</div>
|
||||||
|
|
||||||
<!-- Packet Msgs -->
|
<!-- Packet Msgs -->
|
||||||
<div class="col-2">
|
<div class="col-3">
|
||||||
<label for="pkt_msgs" class="form-label w-100">Packet Msgs</label>
|
<label for="pkt_msgs" class="form-label w-100">Packet Msgs</label>
|
||||||
<div class="input-group has-validation">
|
<div class="input-group has-validation">
|
||||||
<span class="input-group-text"><i class="bi bi-hash"></i></span>
|
<span class="input-group-text"><i class="bi bi-hash"></i></span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user