Minor debug packet cosmetic changes, Remove database/ items in docker build, Node address validation changes

This commit is contained in:
Deon George 2021-07-17 17:15:00 +10:00
parent 1fa566b26c
commit 066154f310
6 changed files with 57 additions and 42 deletions

View File

@ -27,7 +27,7 @@ docker:
- if [ -f init ]; then chmod 500 init; fi - if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true" - ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true"
- echo -n ${CI_COMMIT_SHORT_SHA} > VERSION - echo -n ${CI_COMMIT_SHORT_SHA} > VERSION
- rm -rf vendor/ - rm -rf vendor/ database/schema database/seeders database/factories
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION} - docker push ${CI_REGISTRY_IMAGE}:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}

View File

@ -249,10 +249,11 @@ class Message extends FTNBase
case 'date': case 'date':
return Carbon::createFromFormat('d M y H:i:s O', return Carbon::createFromFormat('d M y H:i:s O',
sprintf('%s %s',chop(Arr::get($this->header,$key)),(is_null($x=$this->kludge->get('tzutc')) || ($x < 0)) ? $x : '+'.$x)); sprintf('%s %s',chop(Arr::get($this->header,$key)),(! is_null($x=$this->kludge->get('tzutc')) && ($x < 0)) ? $x : '+'.($x ?: '0000')));
case 'flags': case 'flags':
case 'cost': return Arr::get($this->header,$key); case 'cost':
return Arr::get($this->header,$key);
case 'message': case 'message':
case 'subject': case 'subject':
@ -461,24 +462,32 @@ class Message extends FTNBase
* s - this bit is supported by SEAdog only * s - this bit is supported by SEAdog only
* + - this bit is not zeroed before packeting * + - this bit is not zeroed before packeting
*/ */
/* public function flags(): Collection
public function flags(int $flags): array
{ {
return [ return collect([
'private' => $this->isFlagSet($flags,self::FLAG_PRIVATE), 'private' => $this->isFlagSet(self::FLAG_PRIVATE),
'crash' => $this->isFlagSet($flags,self::FLAG_CRASH), 'crash' => $this->isFlagSet(self::FLAG_CRASH),
'recd' => $this->isFlagSet($flags,self::FLAG_RECD), 'recd' => $this->isFlagSet(self::FLAG_RECD),
'sent' => $this->isFlagSet($flags,self::FLAG_SENT), 'sent' => $this->isFlagSet(self::FLAG_SENT),
'killsent' => $this->isFlagSet($flags,self::FLAG_KILLSENT), 'fileattach' => $this->isFlagSet(self::FLAG_FILEATTACH),
'local' => $this->isFlagSet($flags,self::FLAG_LOCAL), 'intransit' => $this->isFlagSet(self::FLAG_INTRANSIT),
]; 'orphan' => $this->isFlagSet(self::FLAG_ORPHAN),
'killsent' => $this->isFlagSet(self::FLAG_KILLSENT),
'local' => $this->isFlagSet(self::FLAG_LOCAL),
'hold' => $this->isFlagSet(self::FLAG_HOLD),
'unused-10' => $this->isFlagSet(self::FLAG_UNUSED_10),
'filereq' => $this->isFlagSet(self::FLAG_FREQ),
'receipt-req' => $this->isFlagSet(self::FLAG_RETRECEIPT),
'receipt' => $this->isFlagSet(self::FLAG_ISRETRECEIPT),
'audit' => $this->isFlagSet(self::FLAG_AUDITREQ),
'fileupdate' => $this->isFlagSet(self::FLAG_FILEUPDATEREQ),
]);
} }
private function isFlagSet($value,$flag): bool private function isFlagSet($flag): bool
{ {
return (($value & $flag) == $flag); return ($this->flags & $flag);
} }
*/
/** /**
* Process the data after the ORIGIN * Process the data after the ORIGIN

View File

@ -87,11 +87,11 @@ class HomeController extends Controller
->rightjoin('systems',['systems.id'=>'addresses.system_id']) ->rightjoin('systems',['systems.id'=>'addresses.system_id'])
->when($zone_id || $host_id || $node_id,function($query) use ($zone_id,$host_id,$node_id) { ->when($zone_id || $host_id || $node_id,function($query) use ($zone_id,$host_id,$node_id) {
return $query return $query
->when($zone_id,function($q,$zone_id) { return $q->where('zones.zone_id','ilike','%'.$zone_id.'%'); }) ->when($zone_id,function($q,$zone_id) { return $q->where('zones.zone_id',$zone_id); })
->where(function($q) use ($host_id) { ->where(function($q) use ($host_id) {
return $q return $q
->when($host_id,function($q,$host_id) { return $q->where('region_id','ilike','%'.$host_id.'%'); }) ->when($host_id,function($q,$host_id) { return $q->where('region_id',$host_id); })
->when($host_id,function($q,$host_id) { return $q->orWhere('host_id','ilike','%'.$host_id.'%'); }); ->when($host_id,function($q,$host_id) { return $q->orWhere('host_id',$host_id); });
}) })
->when($node_id,function($q,$node_id) { return $q->where('node_id','ilike','%'.$node_id.'%'); }); ->when($node_id,function($q,$node_id) { return $q->where('node_id','ilike','%'.$node_id.'%'); });
}) })

View File

@ -144,8 +144,7 @@ class SystemController extends Controller
return $query return $query
->where('host_id',$request->post('host_id')) ->where('host_id',$request->post('host_id'))
->where('node_id',$value) ->where('node_id',$value)
->where('point_id',0) ->where('point_id',0);
->where('role',DomainController::NODE_RC);
}); });
if ($o->count()) { if ($o->count()) {

View File

@ -543,6 +543,9 @@ pre code {
word-wrap:break-word; word-wrap:break-word;
text-indent:initial text-indent:initial
} }
pre.highlight {
color: #eee;
}
.row { .row {
text-align: left; text-align: left;

View File

@ -78,58 +78,62 @@
@endif @endif
<div class="row pb-2"> <div class="row pb-2">
<div class="col-8"> <div class="col-4">
<strong>DATE:</strong> {{ $msg->date }} DATE: <strong class="highlight">{{ $msg->date }}</strong>
</div>
<div class="col-4">
FLAGS: <strong class="highlight">{{ $msg->flags()->filter()->keys()->join(',') }}</strong>
</div> </div>
</div> </div>
<div class="row pb-2"> <div class="row pb-2">
<div class="col-4"> <div class="col-4">
<strong>FROM:</strong> {{ $msg->user_from }} ({{ $msg->fftn }}) FROM: <strong class="highlight">{{ $msg->user_from }}</strong> (<strong class="highlight">{{ $msg->fftn }}</strong>)
</div> </div>
<div class="col-4"> <div class="col-4">
<strong>TO:</strong> {{ $msg->user_to }} ({{ $msg->tftn }}) TO: <strong class="highlight">{{ $msg->user_to }}</strong> (<strong class="highlight">{{ $msg->tftn }}</strong>)
</div> </div>
</div> </div>
<div class="row pb-2"> <div class="row pb-2">
<div class="col-8"> <div class="col-8">
<strong>SUBJECT:</strong> {{ $msg->subject }} SUBJECT: <strong class="highlight">{{ $msg->subject }}</strong>
</div> </div>
</div> </div>
<div class="row pb-2"> <div class="row pb-2">
<div class="col-8"> <div class="col-8">
<div class="pad pb-0"> <div class="pad pb-0">
<pre>{!! \App\Classes\FTN\Message::tr($msg->message) !!}</pre> <pre class="highlight">{!! \App\Classes\FTN\Message::tr($msg->message) !!}</pre>
</div> </div>
</div> </div>
</div> </div>
<div class="row pb-2">
<div class="col-8">
<strong>SEENBY:</strong> <br>{!! join('<br>',$msg->seenby->toArray()) !!}
</div>
</div>
<div class="row pb-2">
<div class="col-8">
<strong>PATH:</strong> <br>{!! join('<br>',$msg->path->toArray()) !!}
</div>
</div>
@if($msg->isNetmail()) @if($msg->isNetmail())
<div class="row pb-2"> <div class="row pb-2">
<div class="col-8"> <div class="col-8">
<strong>VIA:</strong> <br>{!! join('<br>',$msg->via->toArray()) !!} VIA: <br><strong class="highlight">{!! join('</strong><br><strong class="highlight">',$msg->via->toArray()) !!}</strong>
</div>
</div>
@else
<div class="row pb-2">
<div class="col-8">
SEENBY: <br><strong class="highlight">{!! join('</strong><br><strong class="highlight">',$msg->seenby->toArray()) !!}</strong>
</div>
</div>
<div class="row pb-2">
<div class="col-8">
PATH: <br><strong class="highlight">{!! join('</strong><br><strong class="highlight">',$msg->path->toArray()) !!}</strong>
</div> </div>
</div> </div>
@endif @endif
<div class="row pb-2"> <div class="row pb-2">
<div class="col-8"> <div class="col-8">
<strong>KLUDGES:</strong> <br> <strong>KLUDGES:</strong> <br>
@foreach ($msg->kludge as $k => $v) @foreach ($msg->kludge->sort(function($v,$k) { return $k; })->reverse() as $k => $v)
<strong>{{ $k }}</strong> {{ $v }}<br> <strong class="highlight">{{ $k }}</strong> {{ $v }}<br>
@endforeach @endforeach
</div> </div>
</div> </div>