Compare commits
2 Commits
85fce14cf6
...
c9eee48c6a
Author | SHA1 | Date | |
---|---|---|---|
c9eee48c6a | |||
8cc561ea2b |
@ -929,6 +929,8 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
||||
} catch (SocketException $e) {
|
||||
if ($c++ > 2)
|
||||
return self::TIMEOUT;
|
||||
else
|
||||
$ch = -2;
|
||||
}
|
||||
|
||||
if (static::DEBUG)
|
||||
|
@ -489,7 +489,7 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
* @param Send $send
|
||||
* @return int
|
||||
*/
|
||||
public function zmodem_sendfile(Send $send,Node $node): int
|
||||
public function zmodem_sendfile(Send $send,Node $node): void
|
||||
{
|
||||
Log::debug(sprintf('%s:+ zmodem_sendfile',self::LOGKEY));
|
||||
|
||||
@ -513,16 +513,16 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
break;
|
||||
}
|
||||
|
||||
return $rc;
|
||||
return;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error(sprintf('%s:! Error [%s]',self::LOGKEY,$e->getMessage()),['rc'=>$rc]);
|
||||
Log::error(sprintf('%s:! Error [%s]',self::LOGKEY,$e->getMessage()),['rc'=>$rc ?? '-UNDEFINED-']);
|
||||
|
||||
return $rc;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return self::OK;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -224,6 +224,7 @@ class HomeController extends Controller
|
||||
|
||||
$options->put('options',collect($request->post('options'))->sum());
|
||||
$options->put('msgs_pkt',$request->post('msgs_pkt'));
|
||||
$options->put('pkt_passwds',$request->post('pkt_passwds') === "1");
|
||||
|
||||
$o->servers = $servers;
|
||||
$o->options = $options;
|
||||
|
@ -27,7 +27,7 @@ class SystemSessionRequest extends FormRequest
|
||||
return [
|
||||
'zone_id' => 'required|exists:zones,id',
|
||||
'sespass' => 'required|string|min:4',
|
||||
'pktpass' => 'required|string|min:4|max:8',
|
||||
'pktpass' => [$this->route('o')->pkt_passwds ? 'required' : 'nullable','string','min:4','max:8'],
|
||||
'ticpass' => 'required|string|min:4',
|
||||
'fixpass' => 'required|string|min:4',
|
||||
];
|
||||
|
@ -9,11 +9,9 @@ use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
||||
use App\Classes\FTN\Message;
|
||||
use App\Models\{Address,Domain,System};
|
||||
use App\Notifications\Echomails\AbsentNodes;
|
||||
use App\Notifications\Emails\NodeMarkedDown as NodeMarkedDownEmail;
|
||||
@ -205,7 +203,7 @@ class AddressIdle implements ShouldQueue
|
||||
->whereIn('addresses.id',our_nodes($do)->pluck('id'))
|
||||
->when($ao,fn($query)=>$query->where('addresses.id',$ao->id))
|
||||
->where(fn($q)=>$q->where('last_session','<',$age)
|
||||
->orWhere(fn($q)=>$q->whereNull('last_session')->where('updated_at','<',Carbon::now()->subDays(14)->startOfDay())))
|
||||
->orWhere(fn($q)=>$q->whereNull('last_session')->where('addresses.updated_at','<',Carbon::now()->subDays(14)->startOfDay())))
|
||||
->whereRaw(sprintf('((role IS NULL) OR (role=0) OR ((role & %d) > 0))',$flags))
|
||||
->whereRaw(sprintf('((role IS NULL) OR ((role & %d) = 0))',Address::NODE_KEEP))
|
||||
->join('systems',['systems.id'=>'addresses.system_id'])
|
||||
|
@ -75,6 +75,9 @@ class Setup extends Model
|
||||
case 'msgs_pkt':
|
||||
return Arr::get($this->options,$key,self::MAX_MSGS_PKT);
|
||||
|
||||
case 'pkt_passwds':
|
||||
return Arr::get($this->options,$key,TRUE);
|
||||
|
||||
default:
|
||||
return parent::__get($key);
|
||||
}
|
||||
|
@ -190,6 +190,11 @@ class System extends Model
|
||||
return $val ?: Setup::findOrFail(config('app.id'))->batch_files;
|
||||
}
|
||||
|
||||
public function getPktPasswdsAttribute(?int $val): bool
|
||||
{
|
||||
return $val ?: Setup::findOrFail(config('app.id'))->pkt_passwds;
|
||||
}
|
||||
|
||||
public function getIsOwnedAttribute(): bool
|
||||
{
|
||||
return $this->users->count();
|
||||
|
@ -57,22 +57,30 @@ class AbsentNodes extends Echomails
|
||||
|
||||
$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
|
||||
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");
|
||||
|
||||
foreach ($x as $ao)
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
foreach ($x as $ao) {
|
||||
if (! $ao->system->last_seen)
|
||||
$msg->addText(sprintf('* %s (%s), not seen since registered %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->updated_at->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
else
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
}
|
||||
|
||||
$msg->addText("\r");
|
||||
}
|
||||
|
||||
// Nodes marked DOWN - will be delisted on...
|
||||
// Nodes marked DOWN
|
||||
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");
|
||||
|
||||
foreach ($x as $ao)
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
foreach ($x as $ao) {
|
||||
if (! $ao->system->last_seen)
|
||||
$msg->addText(sprintf('* %s (%s), not seen since registered %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->updated_at->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
else
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
}
|
||||
|
||||
$msg->addText("\r");
|
||||
}
|
||||
@ -81,8 +89,12 @@ class AbsentNodes extends Echomails
|
||||
if (($x=$this->aos->filter(fn($item)=>! $item->active))->count()) {
|
||||
$msg->addText("The following nodes have been DE-LISTED:\r");
|
||||
|
||||
foreach ($x as $ao)
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
foreach ($x as $ao) {
|
||||
if (! $ao->system->last_seen)
|
||||
$msg->addText(sprintf('* %s (%s), not seen since registered %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->updated_at->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
else
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
}
|
||||
|
||||
$msg->addText("\r");
|
||||
}
|
||||
|
@ -156,8 +156,6 @@
|
||||
<input class="form-check-input" type="checkbox" id="binkp_nr" name="binkp[nr]" value="{{ Binkp::F_NOREL }}" @if(old('binkp.nr',$o->optionGet(Binkp::F_NOREL,'binkp_options'))) checked @endif>
|
||||
<label class="form-check-label" for="binkp_nr">Non-Reliable Mode <sup>*</sup></label>
|
||||
</div>
|
||||
|
||||
<p class="pt-3"><sup>*</sup> Recommended Defaults</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -238,19 +236,34 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<h3>Echomail Settings</h3>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h3>Other Settings</h3>
|
||||
|
||||
<div class="form-group row pt-0">
|
||||
<div class="col-2">
|
||||
<input class="form-control text-end" type="text" id="msgs_pkt" name="msgs_pkt" value="{{ old('msgs_pkt',$o->msgs_pkt ?: Setup::MAX_MSGS_PKT) }}">
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<label class="col-form-label pt-2" for="msgs_pkt">Max Messages per Packet</label>
|
||||
<div class="form-group row pt-0">
|
||||
<div class="col-9">
|
||||
<label class="col-form-label pt-2" for="msgs_pkt">Max Messages per Packet</label>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<input class="form-control text-end @error('msgs_pkt')is-invalid @enderror" type="text" id="msgs_pkt" name="msgs_pkt" value="{{ old('msgs_pkt',$o->msgs_pkt ?: Setup::MAX_MSGS_PKT) }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-1 form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="pkt_passwds" name="pkt_passwds" value="1" @if(old('pkt_passwds',$o->pkt_passwds)) checked @endif>
|
||||
<label class="form-check-label" for="pkt_passwds">Force Packet Passwords <sup>*</sup></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="pt-3 float-end"><sup>*</sup> Recommended Defaults</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pt-5">
|
||||
<div class="col-2">
|
||||
<a href="{{ back()->getTargetUrl() }}" class="btn btn-danger">Cancel</a>
|
||||
|
@ -45,7 +45,7 @@
|
||||
<label for="pktpass" class="form-label">Packet Password</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-box"></i></span>
|
||||
<input type="text" style="width: 35%;" class="form-control @error('pktpass') is-invalid @enderror" id="pktpass" placeholder="Packet" name="pktpass" value="{{ old('pktpass') }}" required>
|
||||
<input type="text" style="width: 35%;" class="form-control @error('pktpass') is-invalid @enderror" id="pktpass" placeholder="Packet" name="pktpass" value="{{ old('pktpass') }}" @required($o->pkt_passwds)>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('pktpass')
|
||||
{{ $message }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user