2020-04-22 09:02:07 +00:00
<!-- wireguard settings tab -->
< div class = " tab-pane active " id = " wgsettings " >
< div class = " row " >
2021-07-14 06:18:07 +00:00
< div class = " col-lg-8 " >
2020-04-22 09:02:07 +00:00
< h4 class = " mt-3 " >< ? php echo _ ( " Tunnel settings " ); ?> </h4>
2021-07-07 22:25:23 +00:00
< div class = " col-lg-12 mt-2 " >
< div class = " row mt-3 mb-2 " >
2024-10-30 17:26:59 +00:00
< div class = " info-item col-3 " >< ? php echo _ ( " IPv4 Address " ); ?> </div>
< div class = " info-value col-4 " >< ? php echo htmlspecialchars ( $public_ip , ENT_QUOTES ); ?> <a class="text-gray-500" href="https://ipapi.co/<?php echo($public_ip); ?>" target="_blank" rel="noopener noreferrer"><i class="fas fa-external-link-alt ms-2"></i></a></div>
2021-07-07 22:25:23 +00:00
</ div >
</ div >
2021-07-06 21:18:43 +00:00
< h5 >< ? php echo _ ( " Configuration Method " ); ?> </h5>
< div class = " col-sm-12 mt-2 mb-2 form-check " >
2024-10-24 07:06:13 +00:00
< input class = " form-check-input " id = " wg-upload " name = " wgCnfOpt " value = " upload " data - bs - toggle = " " data - parent = " #serversettings " data - bs - target = " #wgUpload " type = " radio " checked >
2021-07-07 07:12:30 +00:00
< label class = " form-check-label " >< ? php echo _ ( " Upload file " ); ?> </label>
2021-02-24 18:06:18 +00:00
</ div >
2021-07-06 21:18:43 +00:00
< div class = " col-sm-12 mt-2 mb-2 form-check " >
2024-10-24 07:06:13 +00:00
< input class = " form-check-input " id = " wg-manual " name = " wgCnfOpt " value = " manual " data - bs - toggle = " " data - parent = " #serversettings " data - bs - target = " #wgManual " type = " radio " >
2021-07-06 22:11:16 +00:00
< label class = " form-check-label " >< ? php echo _ ( " Create manually " ); ?> </label>
2020-04-22 09:02:07 +00:00
</ div >
2024-10-24 07:06:13 +00:00
< div class = " col-sm-12 ms-2 " >
2021-07-06 21:18:43 +00:00
< div class = " panel-group " id = " serversettings " >
2021-07-06 22:11:16 +00:00
< div class = " panel panel-default panel-collapse " id = " PanelUpload " >
< div class = " panel-heading " >
< h5 class = " panel-title " >< ? php echo _ ( " Upload a WireGuard config " ); ?> </h5>
< p id = " wg-description " >
2021-07-07 07:12:30 +00:00
< small >< ? php echo _ ( " This option uploads and installs an existing WireGuard <code>.conf</code> file on this device. " ) ?> </small>
2021-07-06 22:11:16 +00:00
</ p >
</ div >
< div class = " panel-body " >
2021-07-07 07:12:30 +00:00
2024-10-24 07:06:13 +00:00
< div class = " mb-3 " >
< div class = " form-check form-switch " >
2021-07-07 21:58:50 +00:00
< ? php $checked = $optRules == 1 ? 'checked="checked"' : '' ?>
2024-10-24 07:06:13 +00:00
< input class = " form-check-input " id = " chxwgrules " name = " wgRules " type = " checkbox " value = " 1 " < ? php echo $checked ?> />
< label class = " form-check-label " for = " chxwgrules " >< ? php echo _ ( " Apply iptables rules for AP interface " ); ?> </label>
< i class = " fas fa-question-circle text-muted " data - bs - toggle = " tooltip " data - bs - placement = " auto " title = " <?php echo _( " Recommended if you wish to forward network traffic from the wg0 interface to clients connected on the AP interface . " ); ?> " ></ i >
2021-07-07 07:12:30 +00:00
< p id = " wg-description " >
< small >< ? php printf ( _ ( " This option adds <strong>iptables</strong> <code>Postup</code> and <code>PostDown</code> rules for the configured AP interface (%s). " ), $_SESSION [ 'ap_interface' ]) ?> </small>
</ p >
</ div >
</ div >
2024-10-24 07:06:13 +00:00
< div class = " mb-3 " >
2021-07-06 22:11:16 +00:00
< h5 class = " panel-title " >< ? php echo _ ( " Configuration File " ); ?> </h4>
< div class = " custom-file " >
2024-10-24 07:06:13 +00:00
< input type = " file " class = " form-control " name = " wgFile " id = " wgFile " >
< label class = " form-label " for = " wgFile " >< ? php echo _ ( " Select WireGuard configuration file (.conf) " ); ?> </label>
2021-07-06 22:11:16 +00:00
</ div >
</ div >
2021-07-07 07:12:30 +00:00
< div class = " row mb-2 " ></ div >
2021-07-06 22:11:16 +00:00
</ div ><!-- /. panel - body -->
</ div ><!-- /. panel -->
2021-07-06 21:18:43 +00:00
< div class = " panel panel-default panel-collapse " id = " PanelManual " >
< div class = " panel-heading " >
< h5 class = " panel-title " >< ? php echo _ ( " Create a local WireGuard config " ); ?> </h5>
2021-07-08 10:22:17 +00:00
< div class = " input-group " >
2024-10-24 07:06:13 +00:00
< div class = " form-check form-switch " >
< input class = " form-check-input " id = " server_enabled " type = " checkbox " name = " wgSrvEnable " value = " 1 " < ? php echo $wg_senabled ? ' checked="checked"' : " " ?> aria-describedby="server-description">
< label class = " form-check-label " for = " server_enabled " >< ? php echo _ ( " Enable server " ) ?> </label>
2021-07-08 10:22:17 +00:00
</ div >
< p id = " wg-description " >
< small >
< ? php echo _ ( " Enable this option to secure network traffic by creating an encrypted tunnel between RaspAP and configured peers. " ) ?>
< ? php echo _ ( " This setting generates a new WireGuard <code>.conf</code> file on this device. " ) ?>
</ small >
</ p >
</ div >
2021-07-06 21:18:43 +00:00
</ div >
2021-07-08 10:22:17 +00:00
2021-07-06 21:18:43 +00:00
< div class = " panel-body " >
< label for = " code " >< ? php echo _ ( " Local public key " ); ?> </label>
< div class = " input-group col-md-12 mb-3 " >
< input type = " text " class = " form-control " name = " wg-server " id = " wg-srvpubkey " value = " <?php echo htmlspecialchars( $wg_srvpubkey , ENT_QUOTES); ?> " />
< div class = " input-group-append " >
2024-10-24 07:06:13 +00:00
< button class = " btn btn-outline-secondary rounded-end wg-keygen " type = " button " >< i class = " fas fa-magic " ></ i ></ button >
< span id = " wg-server-pubkey-status " class = " input-group-addon check-hidden ms-2 mt-1 " >< i class = " fas fa-check " ></ i ></ span >
2021-07-06 21:18:43 +00:00
</ div >
</ div >
</ div >
2020-04-22 09:02:07 +00:00
2024-10-24 07:06:13 +00:00
< div class = " mb-3 col-xs-3 col-sm-3 " >
2021-07-06 21:18:43 +00:00
< label for = " code " >< ? php echo _ ( " Local Port " ); ?> </label>
< input type = " text " class = " form-control " name = " wg_srvport " value = " <?php echo htmlspecialchars( $wg_srvport , ENT_QUOTES); ?> " />
</ div >
2024-10-24 07:06:13 +00:00
< div class = " mb-3 col-md-6 " >
2021-07-06 21:18:43 +00:00
< label for = " code " >< ? php echo _ ( " IP Address " ); ?> </label>
< input type = " text " class = " form-control " name = " wg_srvipaddress " value = " <?php echo htmlspecialchars( $wg_srvipaddress , ENT_QUOTES); ?> " />
</ div >
2024-10-24 07:06:13 +00:00
< div class = " mb-3 col-md-6 " >
2021-07-06 21:18:43 +00:00
< label for = " code " >< ? php echo _ ( " DNS " ); ?> </label>
< input type = " text " class = " form-control " name = " wg_srvdns " value = " <?php echo htmlspecialchars( $wg_srvdns , ENT_QUOTES); ?> " />
</ div >
2021-07-08 10:22:17 +00:00
< div class = " row mb-3 " ></ div >
2021-07-06 21:18:43 +00:00
</ div ><!-- /. panel - body -->
</ div ><!-- /. panel -->
</ div ><!-- /. panel - group -->
</ div ><!-- /. col -->
2021-07-06 22:11:16 +00:00
</ div ><!-- /. row -->
2021-07-06 21:18:43 +00:00
2020-04-22 09:02:07 +00:00
</ div ><!-- /. tab - pane | settings tab -->