2021-02-06 09:18:27 +01:00
|
|
|
<?php ob_start() ?>
|
|
|
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
|
|
|
<input type="submit" class="btn btn-outline btn-primary" name="SaveOpenVPNSettings" value="Save settings" />
|
|
|
|
<?php if ($openvpnstatus[0] == 0) {
|
|
|
|
echo '<input type="submit" class="btn btn-success" name="StartOpenVPN" value="Start OpenVPN" />' , PHP_EOL;
|
|
|
|
} else {
|
|
|
|
echo '<input type="submit" class="btn btn-warning" name="StopOpenVPN" value="Stop OpenVPN" />' , PHP_EOL;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php $buttons = ob_get_clean(); ob_end_clean() ?>
|
|
|
|
|
2019-11-12 17:03:26 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card">
|
2019-11-15 09:45:54 +01:00
|
|
|
<div class="card-header">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2020-02-29 18:07:24 +01:00
|
|
|
<i class="fas fa-key fa-fw mr-2"></i><?php echo _("OpenVPN"); ?>
|
2019-11-15 09:45:54 +01:00
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<button class="btn btn-light btn-icon-split btn-sm service-status float-right">
|
|
|
|
<span class="icon text-gray-600"><i class="fas fa-circle service-status-<?php echo $serviceStatus ?>"></i></span>
|
|
|
|
<span class="text service-status">openvpn <?php echo _($serviceStatus) ?></span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div><!-- /.row -->
|
|
|
|
</div><!-- /.card-header -->
|
2019-11-12 17:03:26 +01:00
|
|
|
<div class="card-body">
|
2019-11-15 09:45:54 +01:00
|
|
|
<?php $status->showMessages(); ?>
|
2020-12-15 14:48:51 +01:00
|
|
|
<form role="form" action="openvpn_conf" enctype="multipart/form-data" method="POST">
|
2019-11-15 09:45:54 +01:00
|
|
|
<?php echo CSRFTokenFieldTag() ?>
|
2019-11-12 17:03:26 +01:00
|
|
|
<!-- Nav tabs -->
|
|
|
|
<ul class="nav nav-tabs">
|
2019-11-14 13:30:24 +01:00
|
|
|
<li class="nav-item"><a class="nav-link active" id="clienttab" href="#openvpnclient" data-toggle="tab"><?php echo _("Client settings"); ?></a></li>
|
2021-02-07 12:52:58 +01:00
|
|
|
<li class="nav-item"><a class="nav-link" id="configstab" href="#openvpnconfigs" data-toggle="tab"><?php echo _("Configurations"); ?></a></li>
|
2021-02-06 09:18:27 +01:00
|
|
|
<li class="nav-item"><a class="nav-link" id="loggingtab" href="#openvpnlogging" data-toggle="tab"><?php echo _("Logging"); ?></a></li>
|
2019-11-12 17:03:26 +01:00
|
|
|
</ul>
|
2021-02-06 09:18:27 +01:00
|
|
|
|
2019-11-12 17:03:26 +01:00
|
|
|
<!-- Tab panes -->
|
|
|
|
<div class="tab-content">
|
2021-02-06 09:18:27 +01:00
|
|
|
<?php echo renderTemplate("openvpn/general", $__template_data) ?>
|
|
|
|
<?php echo renderTemplate("openvpn/configs", $__template_data) ?>
|
|
|
|
<?php echo renderTemplate("openvpn/logging", $__template_data) ?>
|
|
|
|
</div><!-- /.tab-content -->
|
|
|
|
|
|
|
|
<?php echo $buttons ?>
|
2021-04-06 13:48:27 +02:00
|
|
|
</form>
|
2019-11-15 09:45:54 +01:00
|
|
|
<div class="tab-pane active" id="openvpnclient">
|
|
|
|
<h4 class="mt-3"><?php echo _("Client settings"); ?></h4>
|
2020-12-07 12:37:57 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2021-04-09 16:03:25 +02:00
|
|
|
<div class="row mb-2">
|
2020-12-07 12:37:57 +01:00
|
|
|
<div class="col-lg-12 mt-2 mb-2">
|
2021-04-09 16:03:25 +02:00
|
|
|
<div class="row ml-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("IPv4 Address"); ?></div>
|
|
|
|
<div class="info-value col-xs-3"><?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 ml-2"></i></a></div>
|
|
|
|
</div>
|
2020-12-07 12:37:57 +01:00
|
|
|
</div>
|
2019-11-17 13:01:07 +01:00
|
|
|
</div>
|
2021-04-09 16:03:25 +02:00
|
|
|
<div class="row">
|
2020-12-07 12:37:57 +01:00
|
|
|
<div class="form-group col-lg-12">
|
|
|
|
<label for="code"><?php echo _("Username"); ?></label>
|
|
|
|
<input type="text" class="form-control" name="authUser" value="<?php echo htmlspecialchars($authUser, ENT_QUOTES); ?>" />
|
|
|
|
</div>
|
2019-11-15 09:45:54 +01:00
|
|
|
</div>
|
2020-12-07 12:37:57 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-lg-12">
|
|
|
|
<label for="code"><?php echo _("Password"); ?></label>
|
|
|
|
<input type="password" class="form-control" name="authPassword" value="<?php echo htmlspecialchars($authPassword, ENT_QUOTES); ?>" />
|
|
|
|
</div>
|
2019-11-15 09:45:54 +01:00
|
|
|
</div>
|
2020-12-07 12:37:57 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-lg-12">
|
|
|
|
<div class="custom-file">
|
|
|
|
<input type="file" class="custom-file-input" name="customFile" id="customFile">
|
|
|
|
<label class="custom-file-label" for="customFile"><?php echo _("Select OpenVPN configuration file (.ovpn)"); ?></label>
|
|
|
|
</div>
|
2019-11-15 09:45:54 +01:00
|
|
|
</div>
|
2019-11-12 17:03:26 +01:00
|
|
|
</div>
|
2020-12-07 12:37:57 +01:00
|
|
|
</div><!-- col-->
|
|
|
|
<div class="col-sm">
|
2021-02-08 08:32:40 +01:00
|
|
|
<a href="https://go.nordvpn.net/aff_c?offer_id=15&aff_id=36402&url_id=902"><img src="app/img/no-trace-200x200.png" class="float-left mb-3 mt-3"></a>
|
2020-12-07 12:37:57 +01:00
|
|
|
</div>
|
|
|
|
</div><!-- main row -->
|
2019-11-15 09:45:54 +01:00
|
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="openvpnlogoutput">
|
|
|
|
<h4 class="mt-3"><?php echo _("Client log"); ?></h4>
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-md-8">
|
|
|
|
<?php
|
2020-03-24 19:48:35 +01:00
|
|
|
echo '<textarea class="logoutput"></textarea>';
|
2019-11-15 09:45:54 +01:00
|
|
|
?>
|
|
|
|
</div>
|
2019-11-12 17:03:26 +01:00
|
|
|
</div>
|
2019-11-15 09:45:54 +01:00
|
|
|
</div>
|
|
|
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
|
|
|
<input type="submit" class="btn btn-outline btn-primary" name="SaveOpenVPNSettings" value="Save settings" />
|
|
|
|
<?php if ($openvpnstatus[0] == 0) {
|
2020-12-07 12:37:57 +01:00
|
|
|
echo '<input type="submit" class="btn btn-success" name="StartOpenVPN" value="Start OpenVPN" />' , PHP_EOL;
|
|
|
|
} else {
|
|
|
|
echo '<input type="submit" class="btn btn-warning" name="StopOpenVPN" value="Stop OpenVPN" />' , PHP_EOL;
|
|
|
|
}
|
2019-11-15 09:45:54 +01:00
|
|
|
?>
|
|
|
|
<?php endif ?>
|
|
|
|
</form>
|
2019-11-12 17:03:26 +01:00
|
|
|
</div>
|
|
|
|
</div><!-- /.card-body -->
|
2021-02-06 09:18:27 +01:00
|
|
|
<div class="card-footer"><?php echo _("Information provided by openvpn"); ?></div>
|
|
|
|
</div><!-- /.card -->
|
|
|
|
</div><!-- /.col-lg-12 -->
|
2019-11-12 17:03:26 +01:00
|
|
|
</div><!-- /.row -->
|
|
|
|
|
2021-02-07 12:52:58 +01:00
|
|
|
<!-- modal confirm-delete-->
|
|
|
|
<div class="modal fade" id="ovpn-confirm-delete" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<div class="modal-title" id="ModalLabel"><i class="far fa-trash-alt mr-2"></i><?php echo _("Delete OpenVPN client"); ?></div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="col-md-12 mb-3 mt-1"><?php echo _("Delete client configuration? This cannot be undone."); ?></div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal"><?php echo _("Cancel"); ?></button>
|
|
|
|
<button type="button" class="btn btn-outline-danger btn-delete"><?php echo _("Delete"); ?></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- modal confirm-enable -->
|
|
|
|
<div class="modal fade" id="ovpn-confirm-activate" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<div class="modal-title" id="ModalLabel"><i class="far fa-check-circle mr-2"></i><?php echo _("Activate OpenVPN client"); ?></div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="col-md-12 mb-3 mt-1"><?php echo _("Activate client configuration? This will restart the openvpn-client service."); ?></div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal"><?php echo _("Cancel"); ?></button>
|
|
|
|
<button type="button" class="btn btn-outline-success btn-activate"><?php echo _("Activate"); ?></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|