2022-12-02 13:22:56 +00:00
<!-- $o = Setup :: class -->
2024-12-05 21:33:24 +00:00
@ use ( App\Classes\Protocol\Binkp )
@ use ( App\Classes\Protocol\EMSI )
@ use ( App\Models\Setup )
@ use ( App\Models\System )
2021-06-24 10:16:37 +00:00
2021-06-17 14:08:30 +00:00
@ extends ( 'layouts.app' )
@ section ( 'htmlheader_title' )
Setup
@ endsection
@ section ( 'content' )
2024-12-06 00:16:38 +00:00
< form class = " needs-validation " method = " post " autocomplete = " off " novalidate >
2024-04-22 04:27:48 +00:00
@ csrf
2021-06-24 10:16:37 +00:00
2024-04-22 04:27:48 +00:00
< div class = " row " >
< div class = " col-12 " >
< h2 > Site Setup </ h2 >
2021-06-24 10:16:37 +00:00
2024-04-22 04:27:48 +00:00
< div class = " greyframe titledbox shadow0xb0 " >
< h2 class = " cap " >@ if ( $o -> exists ) Update @ else Initial @ endif Setup </ h2 >
2021-06-24 10:16:37 +00:00
< div class = " row " >
2021-07-18 12:10:21 +00:00
<!-- System -->
2021-06-24 10:16:37 +00:00
< div class = " col-4 " >
2024-12-05 21:33:24 +00:00
@ php
$helper = ( ! $o -> system_id )
? sprintf ( 'Add a <a href="%s">NEW System"</a>' , url ( 'system/addedit' ))
: sprintf ( '<a href="%s">Edit</a> System' , url ( 'system/addedit' ,[ $o -> system_id ]));
@ endphp
2024-12-06 03:44:19 +00:00
< x - form . select name = " system_id " icon = " bi-tag-fill " label = " System " feedback = " A system is required " placeholder = " Select System " : helper = " $helper " : value = " $o->system_id " : options = " System::select(['id','name'])->active()->cursor()->map(fn( $item )=>['id'=> $item->id ,'value'=> $item->name ]) " required />
2021-06-24 10:16:37 +00:00
</ div >
2021-07-18 12:10:21 +00:00
<!-- System Addresses -->
2021-06-24 10:16:37 +00:00
< div class = " col-4 ms-auto " >
@ if ( $o -> exists )
< table class = " table monotable " >
< thead >
< tr >< th colspan = " 2 " > System Addresses </ th ></ tr >
</ thead >
< tbody >
2023-12-18 04:13:16 +00:00
@ foreach ( $o -> system -> akas -> sortBy ( 'zone.domain.name' ) -> groupBy ( 'zone_id' ) as $addresses )
2021-06-24 10:16:37 +00:00
< tr >
2023-12-18 04:13:16 +00:00
< th > {{ $addresses -> first () -> zone -> domain -> name }} </ th >
< th class = " text-end " > { !! $addresses -> pluck ( 'ftn' ) -> join ( '<br>' ) !! } </ th >
2021-06-24 10:16:37 +00:00
</ tr >
@ endforeach
</ tbody >
</ table >
@ endif
</ div >
</ div >
< div class = " row " >
2021-07-18 12:10:21 +00:00
<!-- Site Permissions -->
2021-06-24 10:16:37 +00:00
< div class = " col-6 " >
< h3 > Site Permissions </ h3 >
2021-07-18 12:10:21 +00:00
2021-06-24 10:16:37 +00:00
< div class = " form-check form-switch " >
2023-07-08 08:00:23 +00:00
< input class = " form-check-input " type = " checkbox " id = " hideaka " name = " options[hideaka] " value = " { { Setup::O_HIDEAKA }} " @ if ( old ( 'options.hideaka' , $o -> optionGet ( Setup :: O_HIDEAKA , 'options_options' ))) checked @ endif >
2021-08-14 06:14:22 +00:00
< label class = " form-check-label " for = " hideaka " > Hide AKA to different Domains </ label >
2021-06-24 10:16:37 +00:00
</ div >
</ div >
2021-07-18 12:10:21 +00:00
<!-- ZeroTier -->
2021-06-24 10:16:37 +00:00
< div class = " col-6 " >
< h3 > ZeroTier API </ h3 >
<!-- @ todo
* Host / Port / Key
-->
</ div >
</ div >
< div class = " row " >
< div class = " col-12 " >
< h4 > Protocol Configuration </ h4 >
</ div >
< div class = " row " >
2021-07-18 12:10:21 +00:00
<!-- Binkp Settings -->
2021-06-24 10:16:37 +00:00
< div class = " col-6 " >
2023-07-02 13:40:08 +00:00
< div class = " row " >
< div class = " col-12 " >
< h3 > BINKP Settings </ h3 >
< div class = " form-group row pt-0 " >
< div class = " col-9 " >
< label class = " col-form-label pt-2 " for = " binkp_bind " > Listing Interface </ label >
</ div >
< div class = " col-3 " >
< input class = " form-control text-end @error('binkp_bind')is-invalid @enderror " type = " text " id = " binkp_bind " name = " binkp_bind " value = " { { old('binkp_bind', $o->binkp_bind ) }} " >
</ div >
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " form-group row pt-0 " >
< div class = " col-9 " >
< label class = " col-form-label pt-2 " for = " binkp_port " > Listing Port </ label >
</ div >
< div class = " col-3 " >
< input class = " form-control text-end @error('binkp_port')is-invalid @enderror " type = " text " id = " binkp_port " name = " binkp_port " value = " { { old('binkp_port', $o->binkp_port ) }} " >
</ div >
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_active " name = " binkp_active " value = " 1 " @ if ( old ( 'binkp_active' , $o -> binkp_active )) checked @ endif >
< label class = " form-check-label " for = " binkp_active " > Listen for BINKP connections </ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_chat " name = " binkp[cht] " value = " { { Binkp::F_CHAT }} " @ if ( old ( 'binkp.cht' , $o -> optionGet ( Binkp :: F_CHAT , 'binkp_options' ))) checked @ endif disabled >
< label class = " form-check-label " for = " binkp_chat " > Chat Mode < sup > not implemented </ sup ></ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_comp " name = " binkp[comp] " value = " { { Binkp::F_COMP }} " @ if ( old ( 'binkp.comp' , $o -> optionGet ( Binkp :: F_COMP , 'binkp_options' ))) checked @ endif >
2023-07-19 06:24:35 +00:00
< label class = " form-check-label " for = " binkp_comp " > Compression Enabled </ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_md " name = " binkp[md] " value = " { { Binkp::F_MD }} " @ if ( old ( 'binkp.md' , $o -> optionGet ( Binkp :: F_MD , 'binkp_options' ))) checked @ endif >
< label class = " form-check-label " for = " binkp_md " > CRAM - MD5 Mode < sup >*</ sup ></ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
<!-- @ todo Force turning off this toggle , if md5 is not selected -->
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_mdforce " name = " binkp[mdforce] " value = " { { Binkp::F_MDFORCE }} " @ if ( old ( 'binkp.mdforce' , $o -> optionGet ( Binkp :: F_MDFORCE , 'binkp_options' ))) checked @ endif >
< label class = " form-check-label " for = " binkp_mdforce " > No Plaintext Passwords </ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_crypt " name = " binkp[cr] " value = " { { Binkp::F_CRYPT }} " @ if ( old ( 'binkp.cr' , $o -> optionGet ( Binkp :: F_CRYPT , 'binkp_options' ))) checked @ endif >
< label class = " form-check-label " for = " binkp_crypt " > Crypt mode < sup >*</ sup ></ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_mb " name = " binkp[mb] " value = " { { Binkp::F_MULTIBATCH }} " @ if ( old ( 'binkp.mb' , $o -> optionGet ( Binkp :: F_MULTIBATCH , 'binkp_options' ))) checked @ endif >
< label class = " form-check-label " for = " binkp_mb " > Multi - Batch mode < sup >*</ sup ></ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_mpwd " name = " binkp[mpwd] " value = " { { Binkp::F_MULTIPASS }} " @ if ( old ( 'binkp.mpwd' , $o -> optionGet ( Binkp :: F_MULTIPASS , 'binkp_options' ))) checked @ endif disabled >
< label class = " form-check-label " for = " binkp_mpwd " > Multi - Password Mode < sup > not implemented </ sup ></ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_nd " name = " binkp[nd] " value = " { { Binkp::F_NODUPE }} " @ if ( old ( 'binkp.nd' , $o -> optionGet ( Binkp :: F_NODUPE , 'binkp_options' ))) checked @ endif >
< label class = " form-check-label " for = " binkp_nd " > No Dupes Mode </ label >
2023-07-02 13:40:08 +00:00
</ div >
2021-06-24 10:16:37 +00:00
2023-07-02 13:40:08 +00:00
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " binkp_nda " name = " binkp[nda] " value = " { { Binkp::F_NODUPEA }} " @ if ( old ( 'binkp.nda' , $o -> optionGet ( Binkp :: F_NODUPEA , 'binkp_options' ))) checked @ endif >
< label class = " form-check-label " for = " binkp_nda " > No Dupes Mode - Asymmetric </ label >
2023-07-02 13:40:08 +00:00
</ div >
< div class = " mt-1 form-check form-switch " >
2023-07-05 12:42:59 +00:00
< 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 >
2023-07-02 13:40:08 +00:00
</ div >
< p class = " pt-3 " >< sup >*</ sup > Recommended Defaults </ p >
</ div >
</ div >
2021-06-24 10:16:37 +00:00
</ div >
2021-07-18 12:10:21 +00:00
<!-- EMSI Settings -->
2021-06-24 10:16:37 +00:00
< div class = " col-6 " >
2023-06-12 13:41:25 +00:00
< div class = " row " >
< div class = " col-12 " >
< h3 > EMSI Settings </ h3 >
2023-07-02 13:40:08 +00:00
< div class = " form-group row pt-0 " >
< div class = " col-9 " >
< label class = " col-form-label pt-2 " for = " emsi_bind " > Listing Interface </ label >
</ div >
< div class = " col-3 " >
< input class = " form-control text-end @error('emsi_bind')is-invalid @enderror " type = " text " id = " emsi_bind " name = " emsi_bind " value = " { { old('emsi_bind', $o->emsi_bind ) }} " >
</ div >
</ div >
< div class = " form-group row pt-0 " >
< div class = " col-9 " >
< label class = " col-form-label pt-2 " for = " emsi_port " > Listing Port </ label >
</ div >
< div class = " col-3 " >
< input class = " form-control text-end @error('emsi_port')is-invalid @enderror " type = " text " id = " emsi_port " name = " emsi_port " value = " { { old('emsi_port', $o->emsi_port ) }} " >
</ div >
</ div >
2023-06-12 13:41:25 +00:00
< div class = " form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " startemsi " name = " emsi_active " value = " 1 " @ if ( old ( 'emsi_active' , $o -> emsi_active )) checked @ endif >
2023-06-12 13:41:25 +00:00
< label class = " form-check-label " for = " startemsi " > Listen for EMSI connections </ label >
</ div >
2023-07-05 23:20:33 +00:00
< div class = " mt-1 form-check form-switch " >
< input class = " form-check-input " type = " checkbox " id = " emsi_nrq " name = " emsi[nrq] " value = " { { EMSI::F_IGNORE_NRQ }} " @ if ( old ( 'emsi.nrq' , $o -> optionGet ( EMSI :: F_IGNORE_NRQ , 'emsi_options' ))) checked @ endif >
< label class = " form-check-label " for = " emsi_nrq " > Ignore NRQ </ label >
</ div >
< div class = " mt-1 form-check form-switch " >
< input class = " form-check-input " type = " checkbox " id = " emsi_doprevent " name = " emsi[doprevent] " value = " { { EMSI::F_DO_PREVENT }} " @ if ( old ( 'emsi.doprevent' , $o -> optionGet ( EMSI :: F_DO_PREVENT , 'emsi_options' ))) checked @ endif >
< label class = " form-check-label " for = " emsi_doprevent " > Send an EMSI_INQ on connect </ label >
</ div >
2023-06-12 13:41:25 +00:00
</ div >
</ div >
2021-06-24 10:16:37 +00:00
2023-06-12 13:41:25 +00:00
< div class = " row pt-5 " >
< div class = " col-12 " >
< h3 > DNS Settings </ h3 >
2023-07-02 13:40:08 +00:00
< div class = " form-group row pt-0 " >
< div class = " col-9 " >
< label class = " col-form-label pt-2 " for = " dns_bind " > Listing Interface </ label >
</ div >
< div class = " col-3 " >
< input class = " form-control text-end @error('dns_bind')is-invalid @enderror " type = " text " id = " dns_bind " name = " dns_bind " value = " { { old('dns_bind', $o->dns_bind ) }} " >
</ div >
</ div >
< div class = " form-group row pt-0 " >
< div class = " col-9 " >
< label class = " col-form-label pt-2 " for = " dns_port " > Listing Port </ label >
</ div >
< div class = " col-3 " >
< input class = " form-control text-end @error('dns_port')is-invalid @enderror " type = " text " id = " dns_port " name = " dns_port " value = " { { old('dns_port', $o->dns_port ) }} " >
</ div >
</ div >
2023-06-12 13:41:25 +00:00
< div class = " form-check form-switch " >
2023-07-05 12:42:59 +00:00
< input class = " form-check-input " type = " checkbox " id = " startdns " name = " dns_active " value = " 1 " @ if ( old ( 'dns_active' , $o -> dns_active )) checked @ endif >
2023-06-12 13:41:25 +00:00
< label class = " form-check-label " for = " startdns " > Listen for DNS connections </ label >
</ div >
</ div >
2021-06-24 10:16:37 +00:00
</ div >
</ div >
</ div >
</ div >
< div class = " row " >
2022-12-02 13:22:56 +00:00
< div class = " col-6 " >
< h3 > Echomail Settings </ h3 >
< div class = " form-group row pt-0 " >
< div class = " col-2 " >
2023-07-05 12:42:59 +00:00
< 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) }} " >
2022-12-02 13:22:56 +00:00
</ div >
< div class = " col-10 " >
< label class = " col-form-label pt-2 " for = " msgs_pkt " > Max Messages per Packet </ label >
</ div >
</ div >
</ div >
</ div >
< div class = " row pt-5 " >
2021-07-24 04:12:10 +00:00
< div class = " col-2 " >
2024-04-25 05:27:45 +00:00
< a href = " { { back()->getTargetUrl() }} " class = " btn btn-danger " > Cancel </ a >
2021-07-24 04:12:10 +00:00
</ div >
< span class = " col-6 mt-auto mx-auto text-center align-bottom " >
@ if ( $errors -> count ())
< span class = " btn btn-sm btn-danger " role = " alert " >
2023-07-02 13:40:08 +00:00
< h3 class = " text-white " > There were errors with the submission .</ h3 >
< ul >
@ foreach ( $errors -> all () as $message )
< li > {{ $message }} </ li >
@ endforeach
</ ul >
2021-07-24 04:12:10 +00:00
</ span >
@ endif
</ span >
@ can ( 'admin' , $o )
< div class = " col-2 " >
< button type = " submit " name = " submit " class = " btn btn-success float-end " >@ if ( $o -> exists ) Save @ else Add @ endif </ button >
</ div >
@ endcan
2021-06-24 10:16:37 +00:00
</ div >
2024-04-22 04:27:48 +00:00
</ div >
2021-06-24 10:16:37 +00:00
</ div >
</ div >
2024-04-22 04:27:48 +00:00
</ form >
2021-06-17 14:08:30 +00:00
@ endsection
2021-06-24 10:16:37 +00:00
@ section ( 'page-css' )
2023-07-02 13:40:08 +00:00
< style >
#content h3 {
margin - bottom : 5 px ;
}
</ style >
2021-11-13 06:00:08 +00:00
@ append