1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Compare commits

..

No commits in common. "master" and "2.9.3" have entirely different histories.

69 changed files with 1370 additions and 4186 deletions

1
.gitignore vendored
View File

@ -4,4 +4,3 @@ yarn-error.log
*.swp
includes/config.php
rootCA.pem
vendor

View File

@ -25,7 +25,6 @@ The following features are currently available exclusively to sponsors. A tangib
✅ [Network diagnostics](https://docs.raspap.com/net-devices/#diagnostics)
✅ [WireGuard VPN kill switch](https://docs.raspap.com/wireguard/#kill-switch)
✅ [Dynamic DNS](https://docs.raspap.com/dynamicdns/)
✅ [Multiple WireGuard configs](https://docs.raspap.com/wireguard/#multiple-configs)
Look for the list above to grow as we add more exclusive features. Be sure to visit this page from time to time to learn about what's new, check the [Insiders docs page](https://docs.raspap.com/insiders/) and follow [@RaspAP on Twitter](https://twitter.com/rasp_ap) to stay updated.

View File

@ -1,5 +1,5 @@
![](https://i.imgur.com/xeKD93p.png)
[![Release 2.9.6](https://img.shields.io/badge/release-v2.9.6-green)](https://github.com/raspap/raspap-webgui/releases) [![Awesome](https://awesome.re/badge.svg)](https://github.com/thibmaek/awesome-raspberry-pi) [![Join Insiders](https://img.shields.io/static/v1?label=Join%20Insiders&message=%E2%9D%A4&logo=GitHub&color=ff69b4)](https://github.com/sponsors/RaspAP) [![Build Status](https://app.travis-ci.com/RaspAP/raspap-webgui.svg?branch=master)](https://app.travis-ci.com/RaspAP/raspap-webgui) [![Crowdin](https://badges.crowdin.net/raspap/localized.svg)](https://crowdin.com/project/raspap) [![Twitter URL](https://img.shields.io/twitter/url?label=%40RaspAP&logoColor=%23d8224c&url=https%3A%2F%2Ftwitter.com%2Frasp_ap)](https://twitter.com/rasp_ap) [![Subreddit subscribers](https://img.shields.io/reddit/subreddit-subscribers/RaspAP?style=social)](https://www.reddit.com/r/RaspAP/) [![Join the chat at https://app.gitter.im/#/room/#RaspAP:gitter.im](https://img.shields.io/badge/chat-on%20gitter-brightgreen)](https://app.gitter.im/#/room/#RaspAP:gitter.im)
[![Release 2.9.3](https://img.shields.io/badge/release-v2.9.3-green)](https://github.com/raspap/raspap-webgui/releases) [![Awesome](https://awesome.re/badge.svg)](https://github.com/thibmaek/awesome-raspberry-pi) [![Join Insiders](https://img.shields.io/static/v1?label=Join%20Insiders&message=%E2%9D%A4&logo=GitHub&color=ff69b4)](https://github.com/sponsors/RaspAP) [![Build Status](https://app.travis-ci.com/RaspAP/raspap-webgui.svg?branch=master)](https://app.travis-ci.com/RaspAP/raspap-webgui) [![Crowdin](https://badges.crowdin.net/raspap/localized.svg)](https://crowdin.com/project/raspap) [![Twitter URL](https://img.shields.io/twitter/url?label=%40RaspAP&logoColor=%23d8224c&url=https%3A%2F%2Ftwitter.com%2Frasp_ap)](https://twitter.com/rasp_ap) [![Subreddit subscribers](https://img.shields.io/reddit/subreddit-subscribers/RaspAP?style=social)](https://www.reddit.com/r/RaspAP/) [![Join the chat at https://app.gitter.im/#/room/#RaspAP:gitter.im](https://img.shields.io/badge/chat-on%20gitter-brightgreen)](https://app.gitter.im/#/room/#RaspAP:gitter.im)
RaspAP is feature-rich wireless router software that _just works_ on many popular [Debian-based devices](#supported-operating-systems), including the Raspberry Pi. Our popular [Quick installer](#quick-installer) creates a known-good default configuration for all current Raspberry Pis with onboard wireless. A fully responsive, mobile-ready interface gives you control over the relevant services and networking options. Advanced DHCP settings, WireGuard and OpenVPN support, [SSL certificates](https://docs.raspap.com/ssl-quick/), security audits, [captive portal integration](https://docs.raspap.com/captive/), themes and [multilingual options](https://docs.raspap.com/translations/) are included.

View File

@ -4,50 +4,21 @@ require '../../includes/csrf.php';
require_once '../../includes/config.php';
if (isset($_POST['blocklist_id'])) {
$blocklist_id = escapeshellcmd($_POST['blocklist_id']);
$blocklist_id = $_POST['blocklist_id'];
$notracking_url = "https://raw.githubusercontent.com/notracking/hosts-blocklists/master/";
switch ($blocklist_id) {
case "StevenBlack/hosts \(default\)":
$list_url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts";
$dest_file = "hostnames.txt";
case "notracking-hostnames":
$file = "hostnames.txt";
break;
case "badmojr/1Hosts \(Mini\)":
$list_url = "https://badmojr.github.io/1Hosts/mini/hosts.txt";
$dest_file = "hostnames.txt";
break;
case "badmojr/1Hosts \(Lite\)":
$list_url = "https://badmojr.github.io/1Hosts/Lite/hosts.txt";
$dest_file = "hostnames.txt";
break;
case "badmojr/1Hosts \(Pro\)":
$list_url = "https://badmojr.github.io/1Hosts/Pro/hosts.txt";
$dest_file = "hostnames.txt";
break;
case "badmojr/1Hosts \(Xtra\)":
$list_url = "https://badmojr.github.io/1Hosts/Xtra/hosts.txt";
$dest_file = "hostnames.txt";
break;
case "oisd/big \(default\)":
$list_url = "https://big.oisd.nl/dnsmasq";
$dest_file = "domains.txt";
break;
case "oisd/small":
$list_url = "https://small.oisd.nl/dnsmasq";
$dest_file = "domains.txt";
break;
case "oisd/nsfw":
$list_url = "https://nsfw.oisd.nl/dnsmasq";
$dest_file = "domains.txt";
case "notracking-domains":
$file = "domains.txt";
break;
}
$blocklist = $list_url . $dest_file;
$dest = substr($dest_file, 0, strrpos($dest_file, "."));
$blocklist = $notracking_url . $file;
exec("sudo /etc/raspap/adblock/update_blocklist.sh $list_url $dest_file " .RASPI_ADBLOCK_LISTPATH, $return);
$jsonData = ['return'=>$return,'list'=>$dest];
echo json_encode($jsonData);
} else {
$jsonData = ['return'=>2,'output'=>['Error getting data']];
exec("sudo /etc/raspap/adblock/update_blocklist.sh $blocklist $file " .RASPI_ADBLOCK_LISTPATH, $return);
$jsonData = ['return'=>$return];
echo json_encode($jsonData);
}

View File

@ -3,6 +3,12 @@
require '../../includes/csrf.php';
require_once '../../includes/config.php';
require_once RASPI_CONFIG.'/raspap.php';
header('X-Frame-Options: DENY');
header("Content-Security-Policy: default-src 'none'; connect-src 'self'");
require_once '../../includes/authenticate.php';
$interface = filter_input(INPUT_GET, 'inet', FILTER_SANITIZE_SPECIAL_CHARS);
if (empty($interface)) {

View File

@ -9,7 +9,6 @@ if (isset($_POST['interface'])) {
define( 'NL80211_BAND_24GHZ', 0x1 );
define( 'NL80211_BAND_5GHZ', 0x2 );
$iface = escapeshellcmd($_POST['interface']);
$flags = 0;
// get physical device for selected interface
exec("iw dev | awk '/$iface/ {print line}{line = $0}'", $return);

View File

@ -3,7 +3,7 @@
require '../../includes/csrf.php';
require_once '../../includes/config.php';
$entity = escapeshellcmd($_POST['entity']);
$entity = $_POST['entity'];
if (isset($entity)) {

View File

@ -1,21 +0,0 @@
<?php
require '../../includes/csrf.php';
$action = escapeshellcmd($_POST['a']);
if (isset($action)) {
switch($action) {
case "reboot":
$response = shell_exec("sudo /sbin/reboot");
break;
case "shutdown":
$response = shell_exec("sudo /sbin/shutdown -h now");
break;
default:
$response = 'Unknown action: '.$action;
}
echo json_encode($response);
}

View File

@ -228,8 +228,3 @@ button > i.fas {
pointer-events: none;
}
.close {
font-weight: 400;
font-size: 1.3rem;
}

View File

@ -1,627 +0,0 @@
<?php header("Content-Type: text/css; charset=utf-8"); ?>
<?php
require_once '../../includes/functions.php';
$color = getColorOpt();
?>
/*
Theme Name: Material Dark
Author: @marek-guran
Author URI: https://github.com/marek-guran
Description: Inspired by Google's Material You Design
License: GNU General Public License v3.0
*/
<?php
// Base color
$baseColor = $color;
// Function to darken a color by a percentage
function darkenColor($color, $percent)
{
$percent /= 100;
$r = hexdec(substr($color, 1, 2));
$g = hexdec(substr($color, 3, 2));
$b = hexdec(substr($color, 5, 2));
$r = round($r * (1 - $percent));
$g = round($g * (1 - $percent));
$b = round($b * (1 - $percent));
return sprintf("#%02x%02x%02x", $r, $g, $b);
}
// Function to lighten a color by a percentage
function lightenColor($color, $percent)
{
$percent /= 100;
$r = hexdec(substr($color, 1, 2));
$g = hexdec(substr($color, 3, 2));
$b = hexdec(substr($color, 5, 2));
$r = round($r + (255 - $r) * $percent);
$g = round($g + (255 - $g) * $percent);
$b = round($b + (255 - $b) * $percent);
return sprintf("#%02x%02x%02x", $r, $g, $b);
}
$textColor = lightenColor($baseColor, 95);
// Create other color variables
$cardsColor = darkenColor($baseColor, 60);
$secondaryColor = lightenColor($baseColor, 30);
$primaryColor = $baseColor;
$backgroundColor = darkenColor($baseColor, 90);
?>
@import url('all.css');
body {
background-color: <?php echo $backgroundColor; ?>;
}
html * {
font-family: Helvetica,Arial,sans-serif;
color: <?php echo $textColor; ?>;
}
.nav-item.active .nav-link {
position: relative;
background-color: <?php echo $secondaryColor; ?>;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
border-top-right-radius: 18px;
border-bottom-right-radius: 18px;
}
h2 {
font-size: 2rem !important;
}
h4 {
font-size: 1.3rem;
}
h5.card-title {
font-size: 1.2rem;
}
.page-header {
border-left: .01rem solid <?php echo $secondaryColor; ?>;
border-bottom: .01rem solid <?php echo $secondaryColor; ?>;
}
.sidebar-light .nav-item.active .nav-link i {
color: <?php echo $textColor; ?>;
}
.sidebar .nav-item.active .nav-link {
font-weight: 400;
}
.sidebar .nav-item .nav-link span:hover {
color: <?php echo $textColor; ?>!important;
}
#wrapper #content-wrapper #content {
background-color: <?php echo $backgroundColor; ?>;
}
.topbar {
background-color: <?php echo $backgroundColor; ?>;
}
.col {
color: <?php echo $textColor; ?>;
}
.card-header .col i.fa-tachometer-alt,
.card-header .col i.fa-dot-circle,
.card-header .col i.fa-wifi,
.card-header .col i.fa-exchange-alt,
.card-header .col i.fa-hand-paper,
.card-header .col i.fa-network-wired,
.card-header .col i.fa-key,
.card-header .ra-wireguard,
.card-header .ra-wireguard:before,
.card-header .col i.fa-user-lock,
.card-header .col i.fa-chart-bar,
.card-header .col i.fa-cube,
.card-header .col i.fa-info-circle,
.card-header .col i.fa-globe,
.card-header .col i.fa-shield-alt {
color: <?php echo $textColor; ?>;
}
i.fa-bars {
color: <?php echo $primaryColor; ?>;
}
.nav-tabs {
border-bottom: 1px solid <?php echo $secondaryColor; ?>;
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-link {
font-size: 1.0rem;
border-top-left-radius: 18px;
border-top-right-radius: 18px;
}
.nav-tabs .nav-link:hover {
border-color: transparent;
}
.navbar-default .navbar-brand:hover {
color: #d2d2d2;
}
.navbar-default .navbar-toggle {
border-color: transparent;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #d2d2d2;
}
.navbar-default .navbar-toggle:focus,
.navbar-default .navbar-toggle:hover {
background-color: <?php echo $backgroundColor; ?>;
}
#content, .navbar, .sidebar, .footer, .sticky-footer {
background-attachment: scroll;
background-repeat: repeat;
background-size: auto;
background-position: 0 0;
background-origin: padding-box;
background-clip: border-box;
}
.sticky-footer {
background-position: 30px 0;
}
.sidebar {
background-position: 0 20px;
}
.nav-tabs .nav-link.active {
color: <?php echo $textColor; ?>;
background-color: <?php echo $secondaryColor; ?>;
border-color: transparent;
}
a:focus, a:hover {
color: #d2d2d2;
}
.card>.card-header, .modal-content, .modal-header {
border-color: transparent;
background-color: <?php echo $primaryColor; ?>;
color: <?php echo $textColor; ?>;
border-radius: 18px;
font-size: 1.0rem;
font-weight: 400;
}
.modal-body {
background-color: <?php echo $backgroundColor; ?>;
}
.card-header {
border-bottom-left-radius: 0px!important;
border-bottom-right-radius: 0px!important;
position: relative;
margin-bottom: -18px;
}
.card>.card-header .fa {
color: <?php echo $backgroundColor; ?>;
}
.card-header [class^="fa"] {
color: <?php echo $textColor; ?>;
font-size: 1.0rem;
}
.card, .card-body {
border-color: transparent;
border-radius: 18px;
background-color: <?php echo $cardsColor; ?>;
box-shadow: 0px -5px 5px rgba(0, 0, 0, 0.1),
0px 4px 6px rgba(0, 0, 0, 0.1);
}
.card-body {
padding-top: 36px; /* 18px to move down + 18px space at the top */
padding-bottom: 36px; /* 18px space at the bottom */
}
.unstyled {
background-color: <?php echo $cardsColor; ?>;
color: <?php echo $textColor; ?>;
}
hr {
border-top: .01rem solid <?php echo $secondaryColor; ?>;
}
.sidebar-brand-text {
color: <?php echo $secondaryColor; ?>;
}
.ra-raspap:before {
color: #ac1b3d !important;
}
.sidebar-light #sidebarToggle {
background-color: <?php echo $primaryColor; ?>;
border: 1px solid <?php echo $secondaryColor; ?>; !important
}
.sidebar-light #sidebarToggle::after {
color: <?php echo $textColor; ?>;
}
.sidebar-light .nav-item .nav-link:hover i {
color: <?php echo $textColor; ?>;
}
.sidebar-light #sidebarToggle:hover {
background-color: <?php echo $secondaryColor; ?>;
}
.sidebar.toggled .nav-item .nav-link span {
display: none;
}
.sidebar.toggled .nav-item .nav-link {
text-align: center;
padding: .6rem 1rem;
width: 6.5rem;
}
.card-footer, .modal-footer {
background-color: <?php echo $primaryColor; ?>;
color: <?php echo $textColor; ?>;
border-top: 0px;
border-bottom-right-radius: 18px!important;
border-bottom-left-radius: 18px!important;
position: relative;
margin-top: -18px;
}
.modal-footer {
border-radius: 18px;
}
.card>.card-header::before, .navbar-default::before {
content: " ";
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 2;
background-size: 100% 2px, 3px 100%;
pointer-events: none;
}
.sidebar-light, .sticky-footer {
background-color: <?php echo $backgroundColor; ?>;
}
.sidebar-light .nav-item .nav-link i {
color: rgba(230, 230, 230, .3);
}
.sidebar .nav-item .nav-link {
padding: 0.6rem;
padding-left: 1.2rem;
}
.sidebar-light hr.sidebar-divider {
border-top: 1px solid <?php echo $secondaryColor; ?>;
padding-top: 0.5rem;
}
.sidebar .nav-item .nav-link span {
font-size: 1.0rem;
}
.topbar .topbar-divider {
border-right: 1px solid <?php echo $secondaryColor; ?>;
}
.label-warning {
background-color: #d2d2d2;
}
span.label.label-warning {
color: <?php echo $backgroundColor; ?>;
}
.table>tbody>tr>td,
.table>tbody>tr>th,
.table>tfoot>tr>td,
.table>tfoot>tr>th,
.table>thead>tr>td,
.table>thead>tr>th {
background-color: <?php echo $primaryColor; ?>;
border-top: .01rem solid <?php echo $backgroundColor; ?>;
}
.table{
border-radius: 18px;
overflow: hidden;
}
.table>thead>tr>th {
vertical-align: bottom;
border-bottom: 0 solid <?php echo $secondaryColor; ?>;
}
[class*="btn"], [class*="btn"]:focus, [class*="btn"]:disabled {
background-color: <?php echo $secondaryColor; ?>;
border-color: transparent;
border-radius: 18px;
color: <?php echo $textColor; ?>;
}
[class*="btn"]:hover {
border-radius: 18px;
color: <?php echo $textColor; ?>;
background-color: <?php echo $backgroundColor; ?>;
border-color: transparent;
}
[class*="btn"]:hover .disabled {
background-color:red;
}
[class*="alert"] {
border-radius: 18px;
color: <?php echo $textColor; ?>;
background-color: <?php echo $backgroundColor; ?>;
border: 1px solid #404040;
}
.close {
font-size: 1.2em;
font-weight: 400;
text-shadow: none;
color: <?php echo $textColor; ?>;
}
.form-control,
.form-control:focus,
.custom-select {
color: <?php echo $textColor; ?>;
background-color: <?php echo $backgroundColor; ?>;
border: 1px solid <?php echo $secondaryColor; ?>;
border-radius: 18px;
}
.form-control:disabled,
.form-control[readonly] {
background-color: <?php echo $backgroundColor; ?>;
opacity: 0.5;
}
.form-control::-webkit-input-placeholder { color: #d2d2d2; }
.form-control:-moz-placeholder { color: #d2d2d2; }
.form-control::-moz-placeholder { color: #d2d2d2; }
.form-control:-ms-input-placeholder { color: #d2d2d2; }
.form-control::-ms-input-placeholder { color: #d2d2d2; }
.form-control option {
font-size: 1em;
}
input[type="text"]{
color: <?php echo $textColor; ?>; !important
}
.progress {
background-color: <?php echo $backgroundColor; ?>;
border-radius: 18px;
}
.progress-bar {
color: <?php echo $backgroundColor; ?>;
}
#progressBar {
background-color: <?php echo $secondaryColor; ?>!important;
}
.progress-bar.bg-success {
background-color: <?php echo $primaryColor; ?>!important;
color: <?php echo $textColor; ?>!important;
}
.progress .progress-bar {
padding-left: 5px;
}
.progress-bar.progress-bar-info.progress-bar-striped.active {
background-color: <?php echo $secondaryColor; ?>;
}
.figure-img {
filter: opacity(0.7);
}
.ra-wireguard:before {
color: #404040 !important;
}
.ra-wireguard:hover:before {
color: #d1d3e2 !important;
}
.sidebar .nav-item.active .nav-link span.ra-wireguard:before {
color: #d2d2d2 !important;
}
.custom-control-input:checked ~ .custom-control-label::before {
background-color: <?php echo $secondaryColor; ?>;
}
.custom-control-input:checked ~ .custom-control-label::before {
background-color: <?php echo $primaryColor; ?>;
border-color: <?php echo $primaryColor; ?>;
}
.wg-keygen {
background-color: <?php echo $primaryColor; ?>;
border: 1px solid yellow <?php echo $secondaryColor; ?>;
border-top-right-radius: 18px !important;
border-bottom-right-radius: 18px !important;
}
.btn.btn-outline-secondary.js-add-dhcp-upstream-server {
background-color: <?php echo $primaryColor; ?>;
border: 1px solid <?php echo $secondaryColor; ?>;
border-top-right-radius: 18px !important;
border-bottom-right-radius: 18px !important;
}
.btn.btn-outline-success.js-add-dhcp-static-lease {
border: 1px solid <?php echo $secondaryColor; ?>;
}
.btn.btn-outline-success.js-add-dhcp-static-lease:hover {
background-color: <?php echo $primaryColor; ?>;
}
.text-muted {
font-size: 0.8rem;
}
.fas.fa-circle {
font-size: 0.7rem;
}
pre {
background-color: <?php echo $backgroundColor; ?>;
border: <?php echo $backgroundColor; ?>;
}
button.btn.btn-light.js-toggle-password {
border: 1px solid <?php echo $secondaryColor; ?>;
}
.btn-primary {
border-color: transparent;
background-color: <?php echo $primaryColor; ?>;
}
.btn-primary:hover {
background-color: <?php echo $secondaryColor; ?>;
border-color: transparent;
}
.btn.service-status {
background-color: <?php echo $backgroundColor; ?>;
}
input.btn.btn-success {
background-color: <?php echo $secondaryColor; ?>;
}
input.btn.btn-success:hover {
background-color: <?php echo $backgroundColor; ?>;
border-color: transparent;
}
.signal-icon .signal-bar {
background: <?php echo $secondaryColor; ?>;
}
.figure-img {
border-radius: 18px;
}
.logoutput {
border-radius: 18px!important;
background-color: <?php echo $backgroundColor; ?>;
border: 1px solid <?php echo $primaryColor; ?>!important;
}
.btn-sm {
border-top-right-radius: 18px!important;
border-bottom-right-radius: 18px!important;
}
.signal-icon .signal-bar {
background: <?php echo $secondaryColor; ?>;
}
input.btn.btn-warning {
background-color: <?php echo $secondaryColor; ?>;
}
input.btn.btn-warning:hover {
background-color: <?php echo $backgroundColor; ?>;!important
}
button.btn.btn-danger {
background-color: <?php echo $secondaryColor; ?>;
}
button.btn.btn-danger:hover {
background-color: <?php echo $backgroundColor; ?>;!important
}
.btn-group label.active {
background-color: <?php echo $primaryColor; ?>!important;
border-color:transparent!important;
color: <?php echo $textColor; ?>;!important
}
.btn-group {
background-color: <?php echo $cardsColor; ?>;!important
}
.btn-group:hover {
background-color: <?php echo $cardsColor; ?>;!important
}
.btn.btn-outline-secondary#gen_wpa_passphrase {
background-color: <?php echo $primaryColor; ?>;
border: 1px solid <?php echo $secondaryColor; ?>;
border-top-right-radius: 18px !important;
border-bottom-right-radius: 18px !important;
}
a.scroll-to-top.rounded {
display: inline;
background-color: <?php echo $secondaryColor; ?>;
border-radius: 18px!important;
}
a.scroll-to-top.rounded i.fas.fa-angle-up {
color: <?php echo $textColor; ?>;
}
.btn.btn-sm.btn-outline-secondary.rounded-right {
border: 1px solid <?php echo $secondaryColor; ?>;
background-color: <?php echo $primaryColor; ?>;
}
.info-item.col-xs-3 {
color: <?php echo $textColor; ?>;
}
.text-muted {
color: <?php echo $textColor; ?>!important;
}
.grid-stack-item-content {
width: 100%;
height: 100%;
padding: 5px;
box-sizing: border-box;
}

View File

@ -1,633 +0,0 @@
<?php header("Content-Type: text/css; charset=utf-8"); ?>
<?php
require_once '../../includes/functions.php';
$color = getColorOpt();
?>
/*
Theme Name: Material Light
Author: @marek-guran
Author URI: https://github.com/marek-guran
Description: Inspired by Google's Material You Design
License: GNU General Public License v3.0
*/
<?php
// Base color
$baseColor = $color;
// Function to darken a color by a percentage
function darkenColor($color, $percent)
{
$percent /= 100;
$r = hexdec(substr($color, 1, 2));
$g = hexdec(substr($color, 3, 2));
$b = hexdec(substr($color, 5, 2));
$r = round($r * (1 - $percent));
$g = round($g * (1 - $percent));
$b = round($b * (1 - $percent));
return sprintf("#%02x%02x%02x", $r, $g, $b);
}
// Function to lighten a color by a percentage
function lightenColor($color, $percent)
{
$percent /= 100;
$r = hexdec(substr($color, 1, 2));
$g = hexdec(substr($color, 3, 2));
$b = hexdec(substr($color, 5, 2));
$r = round($r + (255 - $r) * $percent);
$g = round($g + (255 - $g) * $percent);
$b = round($b + (255 - $b) * $percent);
return sprintf("#%02x%02x%02x", $r, $g, $b);
}
$textColor = lightenColor($baseColor, 95);
// Create other color variables
$cardsColor = lightenColor($baseColor, 50);
$secondaryColor = lightenColor($baseColor, 30);
$primaryColor = $baseColor;
$backgroundColor = lightenColor($baseColor, 60);
?>
@import url('all.css');
body {
background-color: <?php echo $backgroundColor; ?>;
}
html * {
font-family: Helvetica,Arial,sans-serif;
color: <?php echo $textColor; ?>;
}
.nav-item.active .nav-link {
position: relative;
background-color: <?php echo $secondaryColor; ?>;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
border-top-right-radius: 18px;
border-bottom-right-radius: 18px;
}
h2 {
font-size: 2rem !important;
}
h4 {
font-size: 1.3rem;
}
h5.card-title {
font-size: 1.2rem;
}
.page-header {
border-left: .01rem solid <?php echo $secondaryColor; ?>;
border-bottom: .01rem solid <?php echo $secondaryColor; ?>;
}
.sidebar-light .nav-item.active .nav-link i {
color: <?php echo $textColor; ?>;
}
.sidebar .nav-item.active .nav-link {
font-weight: 400;
color: <?php echo $primaryColor; ?>;
}
#wrapper #content-wrapper #content {
background-color: <?php echo $backgroundColor; ?>;
}
.topbar {
background-color: <?php echo $backgroundColor; ?>;
}
.col {
color: <?php echo $textColor; ?>;
}
.card-header .col i.fa-tachometer-alt,
.card-header .col i.fa-dot-circle,
.card-header .col i.fa-wifi,
.card-header .col i.fa-exchange-alt,
.card-header .col i.fa-hand-paper,
.card-header .col i.fa-network-wired,
.card-header .col i.fa-key,
.card-header .ra-wireguard,
.card-header .ra-wireguard:before,
.card-header .col i.fa-user-lock,
.card-header .col i.fa-chart-bar,
.card-header .col i.fa-cube,
.card-header .col i.fa-info-circle,
.card-header .col i.fa-globe,
.card-header .col i.fa-shield-alt {
color: <?php echo $textColor; ?>;
}
i.fa-bars {
color: <?php echo $primaryColor; ?>;
}
.nav-tabs {
border-bottom: 1px solid <?php echo $secondaryColor; ?>;
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-link {
font-size: 1.0rem;
border-top-left-radius: 18px;
border-top-right-radius: 18px;
}
.nav-tabs .nav-link:hover {
border-color: transparent;
}
.navbar-default .navbar-brand:hover {
color: #d2d2d2;
}
.navbar-default .navbar-toggle {
border-color: transparent;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #d2d2d2;
}
.navbar-default .navbar-toggle:focus,
.navbar-default .navbar-toggle:hover {
background-color: <?php echo $backgroundColor; ?>;
}
#content, .navbar, .sidebar, .footer, .sticky-footer {
background-attachment: scroll;
background-repeat: repeat;
background-size: auto;
background-position: 0 0;
background-origin: padding-box;
background-clip: border-box;
}
.sticky-footer {
background-position: 30px 0;
}
.sidebar {
background-position: 0 20px;
}
.nav-tabs .nav-link.active {
color: <?php echo $textColor; ?>;
background-color: <?php echo $secondaryColor; ?>;
border-color: transparent;
}
a:focus, a:hover {
color: #d2d2d2;
}
.card>.card-header, .modal-content, .modal-header {
border-color: transparent;
background-color: <?php echo $primaryColor; ?>;
color: <?php echo $textColor; ?>;
border-radius: 18px;
font-size: 1.0rem;
font-weight: 400;
}
.modal-body {
background-color: <?php echo $backgroundColor; ?>;
}
.card-header {
border-bottom-left-radius: 0px!important;
border-bottom-right-radius: 0px!important;
position: relative;
margin-bottom: -18px;
}
.card>.card-header .fa {
color: <?php echo $backgroundColor; ?>;
}
.card-header [class^="fa"] {
color: <?php echo $textColor; ?>;
font-size: 1.0rem;
}
.card, .card-body {
border-color: transparent;
border-radius: 18px;
background-color: <?php echo $cardsColor; ?>;
box-shadow: 0px -5px 5px rgba(0, 0, 0, 0.1),
0px 4px 6px rgba(0, 0, 0, 0.1);
}
.card-body {
padding-top: 36px; /* 18px to move down + 18px space at the top */
padding-bottom: 36px; /* 18px space at the bottom */
}
.unstyled {
background-color: <?php echo $cardsColor; ?>;
color: <?php echo $textColor; ?>;
}
hr {
border-top: .01rem solid <?php echo $secondaryColor; ?>;
}
.sidebar-brand-text {
color: <?php echo $primaryColor; ?>;
}
.ra-raspap:before {
color: #ac1b3d !important;
}
.sidebar-light #sidebarToggle {
background-color: <?php echo $primaryColor; ?>;
border: 1px solid <?php echo $secondaryColor; ?>; !important
}
.sidebar-light #sidebarToggle::after {
color: <?php echo $textColor; ?>;
}
.sidebar-light .nav-item .nav-link:hover i {
color: <?php echo $primaryColor; ?>;
}
.sidebar-light #sidebarToggle:hover {
background-color: <?php echo $secondaryColor; ?>;
}
.sidebar.toggled .nav-item .nav-link span {
display: none;
}
.sidebar.toggled .nav-item .nav-link {
text-align: center;
padding: .6rem 1rem;
width: 6.5rem;
}
.card-footer, .modal-footer {
background-color: <?php echo $primaryColor; ?>;
color: <?php echo $textColor; ?>;
border-top: 0px;
border-bottom-right-radius: 18px!important;
border-bottom-left-radius: 18px!important;
position: relative;
margin-top: -18px;
}
.modal-footer {
border-radius: 18px;
}
.card>.card-header::before, .navbar-default::before {
content: " ";
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 2;
background-size: 100% 2px, 3px 100%;
pointer-events: none;
}
.sidebar-light, .sticky-footer {
background-color: <?php echo $backgroundColor; ?>;
}
.sidebar-light .nav-item .nav-link i {
color: <?php echo $textColor; ?>;;
}
.sidebar .nav-item .nav-link {
padding: 0.6rem;
padding-left: 1.2rem;
}
.sidebar-light hr.sidebar-divider {
border-top: 1px solid <?php echo $secondaryColor; ?>;
padding-top: 0.5rem;
}
.sidebar .nav-item .nav-link span {
font-size: 1.0rem;
}
.sidebar .nav-item .nav-link span:hover {
color: <?php echo $primaryColor; ?>!important;
}
.topbar .topbar-divider {
border-right: 1px solid <?php echo $secondaryColor; ?>;
}
.label-warning {
background-color: #d2d2d2;
}
span.label.label-warning {
color: <?php echo $backgroundColor; ?>;
}
.table>tbody>tr>td,
.table>tbody>tr>th,
.table>tfoot>tr>td,
.table>tfoot>tr>th,
.table>thead>tr>td,
.table>thead>tr>th {
background-color: <?php echo $primaryColor; ?>;
border-top: .01rem solid <?php echo $backgroundColor; ?>;
}
.table{
border-radius: 18px;
overflow: hidden;
}
.table>thead>tr>th {
vertical-align: bottom;
border-bottom: 0 solid <?php echo $secondaryColor; ?>;
}
[class*="btn"], [class*="btn"]:focus, [class*="btn"]:disabled {
background-color: <?php echo $secondaryColor; ?>;
border-color: transparent;
border-radius: 18px;
color: <?php echo $textColor; ?>;
}
[class*="btn"]:hover {
border-radius: 18px;
color: <?php echo $textColor; ?>;
background-color: <?php echo $backgroundColor; ?>;
border-color: transparent;
}
[class*="btn"]:hover .disabled {
background-color:red;
}
[class*="alert"] {
border-radius: 18px;
color: <?php echo $textColor; ?>;
background-color: <?php echo $backgroundColor; ?>;
border: 1px solid #404040;
}
.close {
font-size: 1.2em;
font-weight: 400;
text-shadow: none;
color: <?php echo $textColor; ?>;
}
.form-control,
.form-control:focus,
.custom-select {
color: <?php echo $textColor; ?>;
background-color: <?php echo $backgroundColor; ?>;
border: 1px solid <?php echo $secondaryColor; ?>;
border-radius: 18px;
}
.form-control:disabled,
.form-control[readonly] {
background-color: <?php echo $backgroundColor; ?>;
opacity: 0.5;
}
.form-control::-webkit-input-placeholder { color: #d2d2d2; }
.form-control:-moz-placeholder { color: #d2d2d2; }
.form-control::-moz-placeholder { color: #d2d2d2; }
.form-control:-ms-input-placeholder { color: #d2d2d2; }
.form-control::-ms-input-placeholder { color: #d2d2d2; }
.form-control option {
font-size: 1em;
}
.form-control::placeholder {
color: <?php echo $textColor; ?>;
}
input[type="text"]{
color: <?php echo $textColor; ?>; !important
}
.progress {
background-color: <?php echo $backgroundColor; ?>;
border-radius: 18px;
}
.progress-bar {
color: <?php echo $backgroundColor; ?>;
}
#progressBar {
background-color: <?php echo $secondaryColor; ?>!important;
}
.progress-bar.bg-success {
background-color: <?php echo $primaryColor; ?>!important;
color: <?php echo $textColor; ?>!important;
}
.progress .progress-bar {
padding-left: 5px;
}
.progress-bar.progress-bar-info.progress-bar-striped.active {
background-color: <?php echo $secondaryColor; ?>;
}
.figure-img {
filter: opacity(0.7);
}
.ra-wireguard:before {
color: <?php echo $textColor; ?>!important;
}
.ra-wireguard:hover:before {
color: <?php echo $primaryColor; ?>!important;
}
.sidebar .nav-item.active .nav-link span.ra-wireguard:before {
color: <?php echo $textColor; ?>!important;
}
.custom-control-input:checked ~ .custom-control-label::before {
background-color: <?php echo $secondaryColor; ?>;
}
.custom-control-input:checked ~ .custom-control-label::before {
background-color: <?php echo $primaryColor; ?>;
border-color: <?php echo $primaryColor; ?>;
}
.wg-keygen {
background-color: <?php echo $primaryColor; ?>;
border: 1px solid yellow <?php echo $secondaryColor; ?>;
border-top-right-radius: 18px !important;
border-bottom-right-radius: 18px !important;
}
.btn.btn-outline-secondary.js-add-dhcp-upstream-server {
background-color: <?php echo $primaryColor; ?>;
border: 1px solid <?php echo $secondaryColor; ?>;
border-top-right-radius: 18px !important;
border-bottom-right-radius: 18px !important;
}
.btn.btn-outline-success.js-add-dhcp-static-lease {
border: 1px solid <?php echo $secondaryColor; ?>;
}
.btn.btn-outline-success.js-add-dhcp-static-lease:hover {
background-color: <?php echo $primaryColor; ?>;
}
.text-muted {
font-size: 0.8rem;
}
.fas.fa-circle {
font-size: 0.7rem;
}
pre {
background-color: <?php echo $backgroundColor; ?>;
border: <?php echo $backgroundColor; ?>;
}
button.btn.btn-light.js-toggle-password {
border: 1px solid <?php echo $secondaryColor; ?>;
}
.btn-primary {
border-color: transparent;
background-color: <?php echo $primaryColor; ?>;
}
.btn-primary:hover {
background-color: <?php echo $secondaryColor; ?>;
border-color: transparent;
}
.btn.service-status {
background-color: <?php echo $secondaryColor; ?>;
}
input.btn.btn-success {
background-color: <?php echo $secondaryColor; ?>;
}
input.btn.btn-success:hover {
background-color: <?php echo $backgroundColor; ?>;
border-color: transparent;
}
.signal-icon .signal-bar {
background: <?php echo $secondaryColor; ?>;
}
.figure-img {
border-radius: 18px;
}
.logoutput {
border-radius: 18px!important;
background-color: <?php echo $backgroundColor; ?>;
border: 1px solid <?php echo $primaryColor; ?>!important;
}
.btn-sm {
border-top-right-radius: 18px!important;
border-bottom-right-radius: 18px!important;
}
.signal-icon .signal-bar {
background: <?php echo $secondaryColor; ?>;
}
input.btn.btn-warning {
background-color: <?php echo $secondaryColor; ?>;
}
input.btn.btn-warning:hover {
background-color: <?php echo $backgroundColor; ?>;!important
}
button.btn.btn-danger {
background-color: <?php echo $secondaryColor; ?>;
}
button.btn.btn-danger:hover {
background-color: <?php echo $backgroundColor; ?>;!important
}
.btn-group label.active {
background-color: <?php echo $primaryColor; ?>!important;
border-color:transparent!important;
color: <?php echo $textColor; ?>;!important
}
.btn-group {
background-color: <?php echo $cardsColor; ?>;!important
}
.btn-group:hover {
background-color: <?php echo $cardsColor; ?>;!important
}
.btn.btn-outline-secondary#gen_wpa_passphrase {
background-color: <?php echo $primaryColor; ?>;
border: 1px solid <?php echo $secondaryColor; ?>;
border-top-right-radius: 18px !important;
border-bottom-right-radius: 18px !important;
}
a.scroll-to-top.rounded {
display: inline;
background-color: <?php echo $secondaryColor; ?>;
border-radius: 18px!important;
}
a.scroll-to-top.rounded i.fas.fa-angle-up {
color: <?php echo $textColor; ?>;
}
.btn.btn-sm.btn-outline-secondary.rounded-right {
border: 1px solid <?php echo $secondaryColor; ?>;
background-color: <?php echo $primaryColor; ?>;
}
.info-item.col-xs-3 {
color: <?php echo $textColor; ?>;
}
.text-muted {
color: <?php echo $textColor; ?>!important;
}
.grid-stack-item-content {
width: 100%;
height: 100%;
padding: 5px;
box-sizing: border-box;
}

View File

@ -18,8 +18,7 @@ function createNetmaskAddr(bitCount) {
}
function loadSummary(strInterface) {
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/networking/get_ip_summary.php',{'interface': strInterface, 'csrf_token': csrfToken},function(data){
$.post('ajax/networking/get_ip_summary.php',{interface:strInterface},function(data){
jsonData = JSON.parse(data);
if(jsonData['return'] == 0) {
$('#'+strInterface+'-summary').html(jsonData['output'].join('<br />'));
@ -123,24 +122,21 @@ $(document).on("click", "#gen_wpa_passphrase", function(e) {
});
$(document).on("click", "#js-clearhostapd-log", function(e) {
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/hostapd.log', 'csrf_token': csrfToken},function(data){
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/hostapd.log'},function(data){
jsonData = JSON.parse(data);
$("#hostapd-log").val("");
});
});
$(document).on("click", "#js-cleardnsmasq-log", function(e) {
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/logging/clearlog.php?',{'logfile':'/var/log/dnsmasq.log', 'csrf_token': csrfToken},function(data){
$.post('ajax/logging/clearlog.php?',{'logfile':'/var/log/dnsmasq.log'},function(data){
jsonData = JSON.parse(data);
$("#dnsmasq-log").val("");
});
});
$(document).on("click", "#js-clearopenvpn-log", function(e) {
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/openvpn.log', 'csrf_token': csrfToken},function(data){
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/openvpn.log'},function(data){
jsonData = JSON.parse(data);
$("#openvpn-log").val("");
});
@ -290,8 +286,7 @@ $('#configureClientModal').on('shown.bs.modal', function (e) {
$('#ovpn-confirm-delete').on('click', '.btn-delete', function (e) {
var cfg_id = $(this).data('recordId');
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/openvpn/del_ovpncfg.php',{'cfg_id':cfg_id, 'csrf_token': csrfToken},function(data){
$.post('ajax/openvpn/del_ovpncfg.php',{'cfg_id':cfg_id},function(data){
jsonData = JSON.parse(data);
$("#ovpn-confirm-delete").modal('hide');
var row = $(document.getElementById("openvpn-client-row-" + cfg_id));
@ -308,8 +303,7 @@ $('#ovpn-confirm-delete').on('show.bs.modal', function (e) {
$('#ovpn-confirm-activate').on('click', '.btn-activate', function (e) {
var cfg_id = $(this).data('record-id');
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/openvpn/activate_ovpncfg.php',{'cfg_id':cfg_id, 'csrf_token': csrfToken},function(data){
$.post('ajax/openvpn/activate_ovpncfg.php',{'cfg_id':cfg_id},function(data){
jsonData = JSON.parse(data);
$("#ovpn-confirm-activate").modal('hide');
setTimeout(function(){
@ -354,15 +348,6 @@ $('#js-system-reset-confirm').on('click', function (e) {
});
});
$('#js-sys-reboot, #js-sys-shutdown').on('click', function (e) {
e.preventDefault();
var csrfToken = $('meta[name=csrf_token]').attr('content');
var action = $(this).data('action');
$.post('ajax/system/sys_actions.php?',{'a': action, 'csrf_token': csrfToken},function(data){
var response = JSON.parse(data);
});
});
$(document).ready(function(){
$("#PanelManual").hide();
});
@ -434,12 +419,11 @@ function loadChannelSelect(selected) {
function setHardwareModeTooltip() {
var iface = $('#cbxinterface').val();
var hwmodeText = '';
var csrfToken = $('meta[name=csrf_token]').attr('content');
// Explanatory text if 802.11ac is disabled
if ($('#cbxhwmode').find('option[value="ac"]').prop('disabled') == true ) {
var hwmodeText = $('#hwmode').attr('data-tooltip');
}
$.post('ajax/networking/get_frequencies.php?',{'interface': iface, 'csrf_token': csrfToken},function(data){
$.post('ajax/networking/get_frequencies.php?',{'interface': iface},function(data){
var responseText = JSON.parse(data);
$('#tiphwmode').attr('data-original-title', responseText + '\n' + hwmodeText );
});
@ -450,18 +434,16 @@ function setHardwareModeTooltip() {
* Interface elements are updated to indicate current progress, status.
*/
function updateBlocklist() {
var opt = $('#cbxblocklist option:selected');
var blocklist_id = opt.val();
var csrfToken = $('meta[name=csrf_token]').attr('content');
var blocklist_id = $('#cbxblocklist').val();
if (blocklist_id == '') { return; }
$('#cbxblocklist-status').find('i').removeClass('fas fa-check').addClass('fas fa-cog fa-spin');
$('#cbxblocklist-status').removeClass('check-hidden').addClass('check-progress');
$.post('ajax/adblock/update_blocklist.php',{ 'blocklist_id':blocklist_id, 'csrf_token': csrfToken},function(data){
$.post('ajax/adblock/update_blocklist.php',{ 'blocklist_id':blocklist_id },function(data){
var jsonData = JSON.parse(data);
if (jsonData['return'] == '0') {
$('#cbxblocklist-status').find('i').removeClass('fas fa-cog fa-spin').addClass('fas fa-check');
$('#cbxblocklist-status').removeClass('check-progress').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700);
$('#blocklist-'+jsonData['list']).text("Just now");
$('#'+blocklist_id).text("Just now");
}
})
}
@ -475,8 +457,7 @@ $('.wg-keygen').click(function(){
var entity_pub = $(this).parent('div').prev('input[type="text"]');
var entity_priv = $(this).parent('div').next('input[type="hidden"]');
var updated = entity_pub.attr('name')+"-pubkey-status";
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/networking/get_wgkey.php',{'entity':entity_pub.attr('name'), 'csrf_token': csrfToken},function(data){
$.post('ajax/networking/get_wgkey.php',{'entity':entity_pub.attr('name') },function(data){
var jsonData = JSON.parse(data);
entity_pub.val(jsonData.pubkey);
$('#' + updated).removeClass('check-hidden').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700);
@ -555,27 +536,12 @@ function set_theme(theme) {
}
$(function() {
var currentTheme = getCookie('theme');
// Check if the current theme is a dark theme
var isDarkTheme = currentTheme === 'lightsout.css' || currentTheme === 'material-dark.php';
$('#night-mode').prop('checked', isDarkTheme);
$('#night-mode').change(function() {
var state = $(this).is(':checked');
var currentTheme = getCookie('theme');
if (state == true) {
if (currentTheme == 'custom.php') {
if (state == true && getCookie('theme') != 'lightsout.css') {
set_theme('lightsout.css');
} else if (currentTheme == 'material-light.php') {
set_theme('material-dark.php');
}
} else {
if (currentTheme == 'lightsout.css') {
set_theme('custom.php');
} else if (currentTheme == 'material-dark.php') {
set_theme('material-light.php');
}
}
});
});
@ -598,8 +564,6 @@ var themes = {
"default": "custom.php",
"hackernews" : "hackernews.css",
"lightsout" : "lightsout.css",
"material-light" : "material-light.php",
"material-dark" : "material-dark.php",
}
// Toggles the sidebar navigation.

View File

@ -3,15 +3,13 @@
// Support for dark theme
theme = getCookie('theme');
if (theme == 'lightsout.css') {
var bgColor1 = '#141414';
var bgColor2 = '#141414';
var borderColor = 'rgba(37, 153, 63, 1)';
var labelColor = 'rgba(37, 153, 63, 1)';
} else if (theme == 'material-light.php') {
var borderColor = '#f2f2fb';
var labelColor = '#f2f2fb';
} else if (theme == 'material-dark.php') {
var borderColor = '#f2f2fb';
var labelColor = '#f2f2fb';
} else {
var bgColor1 = '#d4edda';
var bgColor2 = '#eaecf4';
var borderColor = 'rgba(147, 210, 162, 1)';
var labelColor = 'rgba(130, 130, 130, 1)';
}
@ -19,7 +17,7 @@ if (theme == 'lightsout.css') {
let data1 = {
datasets: [{
data: [linkQ, 100-linkQ],
backgroundColor: 'transparent',
backgroundColor: [bgColor1, bgColor2],
borderColor: borderColor,
}],
};

61
src/RaspAP/System/Sysinfo.php → app/lib/system.php Executable file → Normal file
View File

@ -1,7 +1,7 @@
<?php
/**
* System info class
* Sytem info class
*
* @description System info class for RaspAP
* @author Bill Zimmerman <billzimmerman@gmail.com>
@ -49,7 +49,7 @@ class Sysinfo
public function usedMemory()
{
$used = shell_exec("free -m | awk 'NR==2{ total=$2 ; used=$3 } END { print used/total*100}'");
return floor(intval($used));
return floor($used);
}
public function processorCount()
@ -92,62 +92,5 @@ class Sysinfo
$kernel = shell_exec("uname -r");
return $kernel;
}
/*
* Returns RPi Model and PCB Revision from Pi Revision Code (cpuinfo)
* @see http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/
*/
public function rpiRevision()
{
$revisions = array(
'0002' => 'Model B Revision 1.0',
'0003' => 'Model B Revision 1.0 + ECN0001',
'0004' => 'Model B Revision 2.0 (256 MB)',
'0005' => 'Model B Revision 2.0 (256 MB)',
'0006' => 'Model B Revision 2.0 (256 MB)',
'0007' => 'Model A',
'0008' => 'Model A',
'0009' => 'Model A',
'000d' => 'Model B Revision 2.0 (512 MB)',
'000e' => 'Model B Revision 2.0 (512 MB)',
'000f' => 'Model B Revision 2.0 (512 MB)',
'0010' => 'Model B+',
'0013' => 'Model B+',
'0011' => 'Compute Module',
'0012' => 'Model A+',
'a01041' => 'a01041',
'a21041' => 'a21041',
'900092' => 'PiZero 1.2',
'900093' => 'PiZero 1.3',
'9000c1' => 'PiZero W',
'a02082' => 'Pi 3 Model B',
'a22082' => 'Pi 3 Model B',
'a32082' => 'Pi 3 Model B',
'a52082' => 'Pi 3 Model B',
'a020d3' => 'Pi 3 Model B+',
'a220a0' => 'Compute Module 3',
'a020a0' => 'Compute Module 3',
'a02100' => 'Compute Module 3+',
'a03111' => 'Model 4B Revision 1.1 (1 GB)',
'b03111' => 'Model 4B Revision 1.1 (2 GB)',
'c03111' => 'Model 4B Revision 1.1 (4 GB)'
);
$cpuinfo_array = '';
exec('cat /proc/cpuinfo', $cpuinfo_array);
$info = preg_grep("/^Revision/", $cpuinfo_array);
$tmp = explode(':', array_pop($info));
$rev = trim(array_pop($tmp));
if (array_key_exists($rev, $revisions)) {
return $revisions[$rev];
} else {
exec('cat /proc/device-tree/model', $model);
if (isset($model[0])) {
return $model[0];
} else {
return 'Unknown Device';
}
}
}
}

View File

@ -3,6 +3,8 @@
/**
* Simple PHP upload class
*
* Adapted from aivis/PHP-file-upload-class
*
* @description File upload class for RaspAP
* @author Bill Zimmerman <billzimmerman@gmail.com>
* @author Aivis Silins
@ -12,7 +14,7 @@
namespace RaspAP\Uploader;
class FileUpload
class Upload
{
/**
@ -108,7 +110,7 @@ class FileUpload
*/
public static function factory($destination, $root = false)
{
return new FileUpload($destination, $root);
return new Upload($destination, $root);
}
/**

View File

@ -1,17 +1,6 @@
{
"StevenBlack/hosts": [
"StevenBlack/hosts (default)"
],
"badmojr/hosts": [
"badmojr/1Hosts (Mini)",
"badmojr/1Hosts (Lite)",
"badmojr/1Hosts (Pro)",
"badmojr/1Hosts (Xtra)"
],
"OISD/domains": [
"oisd/big (default)",
"oisd/small",
"oisd/nsfw"
"notracking/hosts-blocklist": [
"notracking-hostnames",
"notracking-domains"
]
}

View File

@ -1,5 +1,6 @@
<?php
require_once 'includes/status_messages.php';
require_once 'config.php';
/**
@ -8,7 +9,7 @@ require_once 'config.php';
*/
function DisplayAdBlockConfig()
{
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
$enabled = false;
$custom_enabled = false;
@ -74,17 +75,14 @@ function DisplayAdBlockConfig()
$dnsmasq_state = ($dnsmasq[0] > 0);
$serviceStatus = $dnsmasq_state && $enabled ? "up" : "down";
if (file_exists(RASPI_ADBLOCK_LISTPATH .'custom.txt')) {
$adblock_custom_content = file_get_contents(RASPI_ADBLOCK_LISTPATH .'custom.txt');
} else {
$adblock_custom_content = '';
}
$adblock_log = '';
exec('sudo chmod o+r '.RASPI_DHCPCD_LOG);
$handle = fopen(RASPI_DHCPCD_LOG, "r");
if ($handle) {
while (($line = fgets($handle)) !== false) {
if (preg_match('/(is 0.0.0.0)|(using only locally-known addresses)/', $line)) {
if (preg_match('/(0.0.0.0)/', $line)) {
$adblock_log .= $line;
}
}

View File

@ -1,12 +1,10 @@
<?php
function DisplayAuthConfig($username)
{
$status = new \RaspAP\Messages\StatusMessage;
$auth = new \RaspAP\Auth\HTTPAuth;
$config = $auth->getAuthConfig();
$password = $config['admin_pass'];
require_once 'includes/status_messages.php';
function DisplayAuthConfig($username, $password)
{
$status = new StatusMessages();
if (isset($_POST['UpdateAdminPassword'])) {
if (password_verify($_POST['oldpass'], $password)) {
$new_username=trim($_POST['username']);
@ -35,10 +33,5 @@ function DisplayAuthConfig($username)
}
}
echo renderTemplate(
"admin", compact(
"status",
"username"
)
);
echo renderTemplate("admin", compact("status", "username"));
}

View File

@ -1,16 +1,22 @@
<?php
$user = $_SERVER['PHP_AUTH_USER'] ?? "";
$pass = $_SERVER['PHP_AUTH_PW'] ?? "";
require_once RASPI_CONFIG.'/raspap.php';
$config = getConfig();
if (RASPI_AUTH_ENABLED) {
$user = $_SERVER['PHP_AUTH_USER'] ?? '';
$pass = $_SERVER['PHP_AUTH_PW'] ?? '';
$auth = new \RaspAP\Auth\HTTPAuth;
if (!$auth->isLogged()) {
if ($auth->login($user, $pass)) {
$config = $auth->getAuthConfig();
$validated = ($user == $config['admin_user']) && password_verify($pass, $config['admin_pass']);
if (!$validated) {
header('WWW-Authenticate: Basic realm="RaspAP"');
if (function_exists('http_response_code')) {
// http_response_code will respond with proper HTTP version back.
http_response_code(401);
} else {
$auth->authenticate();
header('HTTP/1.0 401 Unauthorized');
}
exit('Not authorized'.PHP_EOL);
}
} else {
$validated = true;
}

View File

@ -1,41 +0,0 @@
<?php
/**
* PSR-4 compliant class autoloader
*
* @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
* @link https://www.php.net/manual/en/function.spl-autoload-register.php
* @param string $class fully-qualified class name
* @return void
*/
spl_autoload_register(function ($class) {
// project-specific namespace prefix
$prefix = '';
// base directory for the namespace prefix
$base_dir = 'src/';
// normalize the base directory with a trailing separator
$base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/';
// does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
// no, move to the next registered autoloader
return;
}
// get the relative class name
$relative_class = substr($class, $len);
// replace the namespace prefix with the base directory, replace namespace
// separators with directory separators in the relative class name, append
// with .php
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
// if the file exists, require it
if (file_exists($file)) {
require $file;
}
});

View File

@ -1,5 +1,6 @@
<?php
require_once 'includes/status_messages.php';
require_once 'includes/wifi_functions.php';
/**
@ -8,7 +9,7 @@ require_once 'includes/wifi_functions.php';
*/
function DisplayWPAConfig()
{
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
$networks = [];
getWifiInterface();
@ -77,15 +78,6 @@ function DisplayWPAConfig()
}
}
}
} elseif (strlen($network['passphrase']) == 0 && strlen($network['passkey']) == 64) {
$line = "\tpsk=" . $network['passkey'];
fwrite($wpa_file, "network={".PHP_EOL);
fwrite($wpa_file, "\tssid=\"".$ssid."\"".PHP_EOL);
fwrite($wpa_file, $line.PHP_EOL);
if (array_key_exists('priority', $network)) {
fwrite($wpa_file, "\tpriority=".$network['priority'].PHP_EOL);
}
fwrite($wpa_file, "}".PHP_EOL);
} else {
$status->addMessage('WPA passphrase must be between 8 and 63 characters', 'danger');
$ok = false;

View File

@ -10,7 +10,7 @@ require_once 'includes/functions.php';
function DisplayDashboard(&$extraFooterScripts)
{
getWifiInterface();
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
// Need this check interface name for proper shell execution.
if (!preg_match('/^([a-zA-Z0-9]+)$/', $_SESSION['wifi_client_interface'])) {
$status->addMessage(_('Interface name invalid.'), 'danger');

View File

@ -6,7 +6,7 @@ if (!defined('RASPI_CONFIG')) {
$defaults = [
'RASPI_BRAND_TEXT' => 'RaspAP',
'RASPI_VERSION' => '2.9.6',
'RASPI_VERSION' => '2.9.3',
'RASPI_CONFIG_NETWORK' => RASPI_CONFIG.'/networking/defaults.json',
'RASPI_ADMIN_DETAILS' => RASPI_CONFIG.'/raspap.auth',
'RASPI_WIFI_AP_INTERFACE' => 'wlan0',

View File

@ -1,5 +1,6 @@
<?php
require_once 'includes/status_messages.php';
require_once 'config.php';
/**
@ -7,7 +8,7 @@ require_once 'config.php';
*/
function DisplayDHCPConfig()
{
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
if (!RASPI_MONITOR_ENABLED) {
if (isset($_POST['savedhcpdsettings'])) {
saveDHCPConfig($status);

368
includes/firewall.php Executable file
View File

@ -0,0 +1,368 @@
<?php
require_once 'includes/status_messages.php';
require_once 'includes/functions.php';
define('RASPAP_IPTABLES_SCRIPT', "/tmp/iptables_raspap.sh");
define('RASPAP_IP6TABLES_SCRIPT', "/tmp/ip6tables_raspap.sh");
/**
*
* @param array $rule
* @param array $conf
* @return array $don
*/
function getDependson(&$rule, &$conf)
{
if (isset($rule["dependson"][0]) ) {
$don = &$rule["dependson"];
if (!empty($don[0]) && isset($conf[$don[0]["var"]]) ) {
if (!isset($don[0]["type"]) ) { $don[0]["type"]="bool";
}
return $don;
}
}
return false;
}
/**
*
* @param array $sect
* @param array $conf
* @return boolean $active
*/
function isRuleEnabled(&$sect, &$conf)
{
$fw_on = isset($conf["firewall-enable"]) && $conf["firewall-enable"];
$active = isset($sect["fw-state"]) && $sect["fw-state"]==1;
$active = $fw_on ? $active : !$active;
$active = $active || !isset($sect["fw-state"]);
if (($don = getDependson($sect, $conf)) !== false
&& $don[0]["type"] == "bool" && !$conf[$don[0]["var"]]
) { $active = false;
}
return $active;
}
/**
*
* @param array $sect
* @param array $conf
* @return string $str
*/
function createRuleStr(&$sect, &$conf)
{
if (!is_array($sect["rules"]) ) { return "";
}
$rules = $sect["rules"];
$depon = getDependson($sect, $conf);
$rs = array();
foreach ( $rules as $rule ) {
if (preg_match('/\$[a-z0-9]*\$/i', $rule) ) {
$r = array($rule);
foreach ( $depon as $dep ) {
$rr = array();
$repl=$val="";
switch ( $dep["type"] ) {
case "list":
if (isset($dep["var"]) && !empty($conf[$dep["var"]]) ) { $val = explode(' ', $conf[$dep["var"]]);
}
if (!empty($val) && isset($dep["replace"]) ) { $repl=$dep["replace"];
}
break;
case "string":
if (isset($dep["var"]) ) { $val=$conf[$dep["var"]];
}
if (!empty($val) && isset($dep["replace"]) ) { $repl=$dep["replace"];
}
break;
default:
break;
}
if (!empty($repl) && !empty($val) ) {
if (is_array($val) ) {
foreach ( $val as $v ) { $rr = array_merge($rr, str_replace($repl, $v, $r));
}
}
else { $rr = array_merge($rr, str_replace($repl, $val, $r));
}
}
$r = !empty($rr) ? $rr : $r;
}
$rs = array_merge($rs, $rr);
} else {
$rs[] = $rule;
}
}
$str="";
foreach ( $rs as $r ) {
if (!preg_match('/\$[a-z0-9]*\$/i', $r) ) { $str .= '$IPT '.$r."\n";
}
}
return $str;
}
/**
*
* @param array $rule
* @return boolean
*/
function isIPv4(&$rule)
{
return !isset($rule["ip-version"]) || strstr($rule["ip-version"], "4") !== false;
}
/**
*
* @param array $rule
* @return boolean
*/
function isIPv6(&$rule)
{
return !isset($rule["ip-version"]) || strstr($rule["ip-version"], "6") !== false;
}
/**
*
* @return boolean
*/
function configureFirewall()
{
$json = file_get_contents(RASPI_IPTABLES_CONF);
$ipt = json_decode($json, true);
$conf = ReadFirewallConf();
$txt = "#!/bin/bash\n";
file_put_contents(RASPAP_IPTABLES_SCRIPT, $txt);
file_put_contents(RASPAP_IP6TABLES_SCRIPT, $txt);
file_put_contents(RASPAP_IPTABLES_SCRIPT, 'IPT="iptables"'."\n", FILE_APPEND);
file_put_contents(RASPAP_IP6TABLES_SCRIPT, 'IPT="ip6tables"'."\n", FILE_APPEND);
$txt = "\$IPT -F\n";
$txt .= "\$IPT -X\n";
$txt .= "\$IPT -t nat -F\n";
file_put_contents(RASPAP_IPTABLES_SCRIPT, $txt, FILE_APPEND);
file_put_contents(RASPAP_IP6TABLES_SCRIPT, $txt, FILE_APPEND);
if (empty($conf) || empty($ipt) ) { return false;
}
$count=0;
foreach ( $ipt["order"] as $idx ) {
if (isset($ipt[$idx]) ) {
foreach ( $ipt[$idx] as $i => $sect ) {
if (isRuleEnabled($sect, $conf) ) {
$str_rules= createRuleStr($sect, $conf);
if (!empty($str_rules) ) {
if (isIPv4($sect) ) { file_put_contents(RASPAP_IPTABLES_SCRIPT, $str_rules, FILE_APPEND);
}
if (isIPv6($sect) ) { file_put_contents(RASPAP_IP6TABLES_SCRIPT, $str_rules, FILE_APPEND);
}
++$count;
}
}
}
}
}
if ($count > 0 ) {
exec("chmod +x ".RASPAP_IPTABLES_SCRIPT);
exec("sudo ".RASPAP_IPTABLES_SCRIPT);
exec("sudo iptables-save | sudo tee /etc/iptables/rules.v4");
unlink(RASPAP_IPTABLES_SCRIPT);
exec("chmod +x ".RASPAP_IP6TABLES_SCRIPT);
exec("sudo ".RASPAP_IP6TABLES_SCRIPT);
exec("sudo ip6tables-save | sudo tee /etc/iptables/rules.v6");
unlink(RASPAP_IP6TABLES_SCRIPT);
}
return ($count > 0);
}
/**
*
* @param array $conf
* @return string $ret
*/
function WriteFirewallConf($conf)
{
$ret = false;
if (is_array($conf) ) { write_php_ini($conf, RASPI_FIREWALL_CONF);
}
return $ret;
}
/**
*
* @return array $conf
*/
function ReadFirewallConf()
{
$conf = array();
if (file_exists(RASPI_FIREWALL_CONF) ) {
$conf = parse_ini_file(RASPI_FIREWALL_CONF);
}
if ( !isset($conf["firewall-enable"]) ) {
$conf["firewall-enable"] = false;
$conf["ssh-enable"] = false;
$conf["http-enable"] = false;
$conf["excl-devices"] = "";
$conf["excluded-ips"] = "";
$conf["ap-device"] = "";
$conf["client-device"] = "";
$conf["restricted-ips"] = "";
}
exec('ifconfig | grep -E -i "^tun[0-9]"', $ret);
$conf["openvpn-enable"] = !empty($ret);
unset($ret);
exec('ifconfig | grep -E -i "^wg[0-9]"', $ret);
$conf["wireguard-enable"] = !empty($ret);
return $conf;
}
/**
*
* @return string $ips
*/
function getVPN_IPs()
{
$ips = "";
// get openvpn and wireguard server IPs
if (RASPI_OPENVPN_ENABLED && ($fconf = glob(RASPI_OPENVPN_CLIENT_PATH ."/*.conf")) !== false && !empty($fconf) ) {
foreach ( $fconf as $f ) {
unset($result);
exec('cat '.$f.' | sed -rn "s/^remote\s*([a-z0-9\.\-\_:]*)\s*([0-9]*)\s*$/\1 \2/ip" ', $result);
if (!empty($result) ) {
$result = explode(" ", $result[0]);
$ip = (isset($result[0])) ? $result[0] : "";
$port = (isset($result[1])) ? $result[1] : "";
if (!empty($ip) ) {
$ip = gethostbyname($ip);
if (filter_var($ip, FILTER_VALIDATE_IP) && strpos($ips, $ip) === false ) { $ips .= " $ip";
}
}
}
}
}
// get wireguard server IPs
if (RASPI_WIREGUARD_ENABLED && ($fconf = glob(RASPI_WIREGUARD_PATH ."/*.conf")) !== false && !empty($fconf) ) {
foreach ( $fconf as $f ) {
unset($result);
exec('sudo /bin/cat '.$f.' | sed -rn "s/^endpoint\s*=\s*\[?([a-z0-9\.\-\_:]*)\]?:([0-9]*)\s*$/\1 \2/ip" ', $result);
if (!empty($result) ) {
$result = explode(" ", $result[0]);
$ip = (isset($result[0])) ? $result[0] : "";
$port = (isset($result[1])) ? $result[1] : "";
if (!empty($ip) ) {
$ip = gethostbyname($ip);
if (filter_var($ip, FILTER_VALIDATE_IP) && strpos($ips, $ip) === false ) { $ips .= " $ip";
}
}
}
}
}
return trim($ips);
}
/**
*
* @return array $fw_conf
*/
function getFirewallConfiguration()
{
$fw_conf = ReadFirewallConf();
$json = file_get_contents(RASPI_IPTABLES_CONF);
getWifiInterface();
$ap_device = $_SESSION['ap_interface'];
$clients = getClients();
$str_clients = "";
foreach( $clients["device"] as $dev ) {
if (!$dev["isAP"] ) {
if (!empty($str_clients) ) { $str_clients .= ", ";
}
$str_clients .= $dev["name"];
}
}
$fw_conf["ap-device"] = $ap_device;
$fw_conf["client-list"] = $str_clients;
$id=findCurrentClientIndex($clients);
if ($id >= 0 ) { $fw_conf["client-device"] = $clients["device"][$id]["name"];
}
return $fw_conf;
}
/**
*
*/
function updateFirewall()
{
$fw_conf = getFirewallConfiguration();
if ( isset($fw_conf["firewall-enable"]) ) {
WriteFirewallConf($fw_conf);
configureFirewall();
}
return;
}
/**
*
*/
function DisplayFirewallConfig()
{
$status = new StatusMessages();
$fw_conf = getFirewallConfiguration();
$ap_device = $fw_conf["ap-device"];
$str_clients = $fw_conf["client-list"];
if (!empty($_POST)) {
$fw_conf["ssh-enable"] = isset($_POST['ssh-enable']);
$fw_conf["http-enable"] = isset($_POST['http-enable']);
$fw_conf["firewall-enable"] = isset($_POST['firewall-enable']) || isset($_POST['apply-firewall']);
if (isset($_POST['firewall-enable']) ) { $status->addMessage(_('Firewall is now enabled'), 'success');
}
if (isset($_POST['apply-firewall']) ) { $status->addMessage(_('Firewall settings changed'), 'success');
}
if (isset($_POST['firewall-disable']) ) { $status->addMessage(_('Firewall is now disabled'), 'warning');
}
if (isset($_POST['save-firewall']) ) { $status->addMessage(_('Firewall settings saved. Firewall is still disabled.'), 'success');
}
if (isset($_POST['excl-devices']) ) {
$excl = filter_var($_POST['excl-devices'], FILTER_SANITIZE_STRING);
$excl = str_replace(',', ' ', $excl);
$excl = trim(preg_replace('/\s+/', ' ', $excl));
if ($fw_conf["excl-devices"] != $excl ) {
$status->addMessage(_('Exclude devices '. $excl), 'success');
$fw_conf["excl-devices"] = $excl;
}
}
if (isset($_POST['excluded-ips']) ) {
$excl = filter_var($_POST['excluded-ips'], FILTER_SANITIZE_STRING);
$excl = str_replace(',', ' ', $excl);
$excl = trim(preg_replace('/\s+/', ' ', $excl));
if (!empty($excl) ) {
$excl = explode(' ', $excl);
$str_excl = "";
foreach ( $excl as $ip ) {
if (filter_var($ip, FILTER_VALIDATE_IP) ) { $str_excl .= "$ip ";
} else { $status->addMessage(_('Exclude IP address '. $ip . ' failed - not a valid IP address'), 'warning');
}
}
}
$str_excl = trim($str_excl);
if ($fw_conf["excluded-ips"] != $str_excl ) {
$status->addMessage(_('Exclude IP address(es) '. $str_excl), 'success');
$fw_conf["excluded-ips"] = $str_excl;
}
}
WriteFirewallConf($fw_conf);
configureFirewall();
}
$vpn_ips = getVPN_IPs();
echo renderTemplate(
"firewall", compact(
"status",
"ap_device",
"str_clients",
"fw_conf",
"vpn_ips"
)
);
}

View File

@ -58,7 +58,7 @@ function cidr2mask($cidr)
$ipLong = ip2long($ip);
$netmaskLong = bindec(str_pad(str_repeat('1', $prefixLength), 32, '0'));
$netmask = long2ip(intval($netmaskLong));
$netmask = long2ip($netmaskLong);
return $netmask;
}
@ -318,24 +318,24 @@ function CSRFMetaTag()
*/
function CSRFValidate()
{
if(isset($_POST['csrf_token'])) {
$post_token = $_POST['csrf_token'];
$header_token = $_SERVER['HTTP_X_CSRF_TOKEN'];
if (empty($post_token) && empty($header_token)) {
return false;
}
$request_token = $post_token;
if (empty($post_token)) {
$request_token = $header_token;
}
if (hash_equals($_SESSION['csrf_token'], $request_token)) {
return true;
} else {
error_log('CSRF violation');
return false;
}
}
}
/**
@ -430,9 +430,8 @@ function ParseConfig($arrConfig)
continue;
}
if (strpos($line, "=") !== false) {
list($option, $value) = array_map("trim", explode("=", $line, 2));
}
if (empty($config[$option])) {
$config[$option] = $value ?: true;
} else {
@ -664,18 +663,10 @@ function formatDateAgo($datetime, $full = false)
return $string ? implode(', ', $string) . ' ago' : 'just now';
}
function initializeApp()
{
$_SESSION["theme_url"] = getThemeOpt();
$_SESSION["toggleState"] = getSidebarState();
$_SESSION["bridgedEnabled"] = getBridgedState();
}
function getThemeOpt()
{
if (!isset($_COOKIE['theme'])) {
$theme = "custom.php";
setcookie('theme', $theme);
} else {
$theme = $_COOKIE['theme'];
}
@ -688,16 +679,13 @@ function getColorOpt()
$color = "#2b8080";
} else {
$color = $_COOKIE['color'];
setcookie('color', $color);
}
return $color;
}
function getSidebarState()
{
if(isset($_COOKIE['sidebarToggled'])) {
if ($_COOKIE['sidebarToggled'] == 'true' ) {
return "toggled";
}
return"toggled";
}
}
@ -746,7 +734,7 @@ function validate_host($host)
// @return boolean
function getNightmode()
{
if (isset($_COOKIE['theme']) && $_COOKIE['theme'] == 'lightsout.css') {
if ($_COOKIE['theme'] == 'lightsout.css') {
return true;
} else {
return false;
@ -819,15 +807,3 @@ function getTooltip($msg, $id, $visible = true, $data_html = false)
echo '<i class="fas fa-question-circle text-muted ' .$opt1.'" id="' .$id. '" data-toggle="tooltip" ' .$opt2. ' data-placement="auto" title="' . _($msg). '"></i>';
}
// Load non default JS/ECMAScript in footer
function loadFooterScripts($extraFooterScripts)
{
foreach ($extraFooterScripts as $script) {
echo '<script type="text/javascript" src="' , $script['src'] , '"';
if ($script['defer']) {
echo ' defer="defer"';
}
echo '></script>' , PHP_EOL;
}
}

View File

@ -1,17 +1,22 @@
<?php
require_once 'status_messages.php';
require_once 'app/lib/system.php';
require_once 'includes/wifi_functions.php';
require_once 'includes/config.php';
getWifiInterface();
$system = new \RaspAP\System\Sysinfo;
$os = $system->operatingSystem();
/**
* Initialize hostapd values, display interface
*
*/
function DisplayHostAPDConfig()
{
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
$system = new \RaspAP\System\Sysinfo;
$operatingSystem = $system->operatingSystem();
$arrConfig = array();
@ -35,25 +40,22 @@ function DisplayHostAPDConfig()
exec($cmd, $txpower);
$txpower = intval($txpower[0]);
if (isset($_POST['interface'])) {
$interface = escapeshellarg($_POST['interface']);
}
if (!RASPI_MONITOR_ENABLED) {
if (isset($_POST['SaveHostAPDSettings'])) {
SaveHostAPDConfig($arrSecurity, $arrEncType, $arr80211Standard, $interfaces, $status);
}
}
$arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
$arrHostapdConf = parse_ini_file('/etc/raspap/hostapd.ini');
if (!RASPI_MONITOR_ENABLED) {
if (isset($_POST['StartHotspot']) || isset($_POST['RestartHotspot'])) {
$status->addMessage('Attempting to start hotspot', 'info');
if ($arrHostapdConf['BridgedEnable'] == 1) {
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface br0 --seconds 3', $return);
exec('sudo /etc/raspap/hostapd/servicestart.sh --interface br0 --seconds 3', $return);
} elseif ($arrHostapdConf['WifiAPEnable'] == 1) {
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface uap0 --seconds 3', $return);
exec('sudo /etc/raspap/hostapd/servicestart.sh --interface uap0 --seconds 3', $return);
} else {
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --seconds 3', $return);
exec('sudo /etc/raspap/hostapd/servicestart.sh --seconds 3', $return);
}
foreach ($return as $line) {
$status->addMessage($line, 'info');
@ -67,12 +69,10 @@ function DisplayHostAPDConfig()
}
}
exec('cat '. RASPI_HOSTAPD_CONFIG, $hostapdconfig);
if (isset($interface)) {
exec('iwgetid '. $interface. ' -r', $wifiNetworkID);
exec('iwgetid '. escapeshellarg($_POST['interface']). ' -r', $wifiNetworkID);
if (!empty($wifiNetworkID[0])) {
$managedModeEnabled = true;
}
}
$hostapdstatus = $system->hostapdStatus();
$serviceStatus = $hostapdstatus[0] == 0 ? "down" : "up";
@ -98,19 +98,17 @@ function DisplayHostAPDConfig()
$arrConfig['country_code'] = $country_code[0];
}
// set txpower with iw if value is non-default ('auto')
if (isset($_POST['txpower'])) {
if ($_POST['txpower'] != 'auto') {
if (isset($_POST['txpower']) && ($_POST['txpower'] != 'auto')) {
$txpower = intval($_POST['txpower']);
$sdBm = $txpower * 100;
exec('sudo /sbin/iw dev '.$interface.' set txpower fixed '.$sdBm, $return);
exec('sudo /sbin/iw dev '.escapeshellarg($_POST['interface']).' set txpower fixed '.$sdBm, $return);
$status->addMessage('Setting transmit power to '.$_POST['txpower'].' dBm.', 'success');
$txpower = $_POST['txpower'];
} elseif ($_POST['txpower'] == 'auto') {
exec('sudo /sbin/iw dev '.$interface.' set txpower auto', $return);
exec('sudo /sbin/iw dev '.escapeshellarg($_POST['interface']).' set txpower auto', $return);
$status->addMessage('Setting transmit power to '.$_POST['txpower'].'.', 'success');
$txpower = $_POST['txpower'];
}
}
$countries_5Ghz_max48ch = RASPI_5GHZ_ISO_ALPHA2;
$selectedHwMode = $arrConfig['hw_mode'];
@ -134,8 +132,6 @@ function DisplayHostAPDConfig()
if ($selectedHwMode === $hwModeDisabled) {
unset($selectedHwMode);
}
} else {
$hwModeDisabled = null;
}
echo renderTemplate(
@ -172,16 +168,13 @@ function DisplayHostAPDConfig()
*/
function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status)
{
// It should not be possible to send bad data for these fields.
// If wpa fields are absent, return false and log securely.
// It should not be possible to send bad data for these fields so clearly
// someone is up to something if they fail. Fail silently.
if (!(array_key_exists($_POST['wpa'], $wpa_array)
&& array_key_exists($_POST['wpa_pairwise'], $enc_types)
&& array_key_exists($_POST['hw_mode'], $modes))
) {
$err = "Attempting to set hostapd config with wpa='".escapeshellarg($_POST['wpa']);
$err .= "', wpa_pairwise='".$escapeshellarg(_POST['wpa_pairwise']);
$err .= "and hw_mode='".$escapeshellarg(_POST['hw_mode'])."'";
error_log($err);
error_log("Attempting to set hostapd config with wpa='".$_POST['wpa']."', wpa_pairwise='".$_POST['wpa_pairwise']."' and hw_mode='".$_POST['hw_mode']."'"); // FIXME: log injection
return false;
}
// Validate input

View File

@ -75,9 +75,6 @@ if (empty($_SESSION['locale']) && strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2)
case "pl":
$locale = "pl_PL.UTF-8";
break;
case "sk":
$locale = "sk_SK.UTF-8";
break;
default:
$locale = "en_GB.UTF-8";
break;
@ -120,10 +117,10 @@ function getLocales()
'pt_BR.UTF-8' => 'Português',
'ru_RU.UTF-8' => 'Русский',
'ro_RO.UTF-8' => 'Română',
'sk_SK.UTF-8' => 'Slovenčina',
'sv_SE.UTF-8' => 'Svenska',
'tr_TR.UTF-8' => 'Türkçe',
'vi_VN.UTF-8' => 'Tiếng Việt (Vietnamese)'
);
return $arrLocales;
}

View File

@ -1,23 +0,0 @@
<nav class="navbar navbar-expand navbar-light topbar mb-1 static-top">
<!-- Sidebar Toggle (Topbar) -->
<button id="sidebarToggleTopbar" class="btn btn-link d-md-none rounded-circle mr-3">
<i class="fa fa-bars"></i>
</button>
<!-- Topbar Navbar -->
<p class="text-left brand-title mt-3 ml-2"></p>
<ul class="navbar-nav ml-auto">
<!-- Nav Item - Night mode -->
<div class="custom-control custom-switch mt-4">
<input type="checkbox" class="custom-control-input" id="night-mode" <?php echo getNightmode() ? 'checked' : null ; ?> >
<label class="custom-control-label" for="night-mode"><i class="far fa-moon mr-1 text-muted"></i></label>
</div>
<div class="topbar-divider d-none d-sm-block"></div>
<!-- Nav Item - User -->
<li class="nav-item dropdown no-arrow">
<a class="nav-link" href="auth_conf">
<span class="mr-2 d-none d-lg-inline small"><?php echo htmlspecialchars($_SESSION['user_id'], ENT_QUOTES); ?></span>
<i class="fas fa-user-circle fa-3x"></i>
</a>
</li>
</ul>
</nav>

View File

@ -1,5 +1,6 @@
<?php
require_once 'includes/status_messages.php';
require_once 'includes/internetRoute.php';
/**
@ -8,7 +9,8 @@ require_once 'includes/internetRoute.php';
*/
function DisplayNetworkingConfig()
{
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
exec("ls /sys/class/net | grep -v lo", $interfaces);
$routeInfo = getRouteInfo(true);

View File

@ -1,7 +1,9 @@
<?php
require_once 'includes/status_messages.php';
require_once 'includes/config.php';
require_once 'includes/wifi_functions.php';
require_once 'app/lib/uploader.php';
getWifiInterface();
@ -10,7 +12,7 @@ getWifiInterface();
*/
function DisplayOpenVPNConfig()
{
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
if (!RASPI_MONITOR_ENABLED) {
if (isset($_POST['SaveOpenVPNSettings'])) {
if (isset($_POST['authUser'])) {
@ -62,7 +64,7 @@ function DisplayOpenVPNConfig()
ftruncate($f, 0);
fclose($f);
}
} elseif (isset($_POST['log-openvpn']) || file_exists('/tmp/openvpn.log')) {
} elseif (isset($_POST['log-openvpn']) || filesize('/tmp/openvpn.log') >0) {
$logEnable = 1;
exec("sudo /etc/raspap/openvpn/openvpnlog.sh", $logOutput);
$logOutput = file_get_contents('/tmp/openvpn.log');
@ -107,7 +109,7 @@ function SaveOpenVPNConfig($status, $file, $authUser, $authPassword)
throw new RuntimeException('Invalid parameters');
}
$upload = \RaspAP\Uploader\FileUpload::factory('ovpn',$tmp_destdir);
$upload = \RaspAP\Uploader\Upload::factory('ovpn',$tmp_destdir);
$upload->set_max_file_size(64*KB);
$upload->set_allowed_mime_types(array('ovpn' => 'text/plain'));
$upload->file($file);

View File

@ -1,52 +0,0 @@
<?php
$extraFooterScripts = array();
$page = $_SERVER['PATH_INFO'];
// handle page actions
switch ($page) {
case "/wlan0_info":
DisplayDashboard($extraFooterScripts);
break;
case "/dhcpd_conf":
DisplayDHCPConfig();
break;
case "/wpa_conf":
DisplayWPAConfig();
break;
case "/network_conf":
DisplayNetworkingConfig();
break;
case "/hostapd_conf":
DisplayHostAPDConfig();
break;
case "/adblock_conf":
DisplayAdBlockConfig();
break;
case "/openvpn_conf":
DisplayOpenVPNConfig();
break;
case "/wg_conf":
DisplayWireGuardConfig();
break;
case "/torproxy_conf":
DisplayTorProxyConfig();
break;
case "/auth_conf":
DisplayAuthConfig($_SESSION['user_id']);
break;
case "/save_hostapd_conf":
SaveTORAndVPNConfig();
break;
case "/data_use":
DisplayDataUsage($extraFooterScripts);
break;
case "/system_info":
DisplaySystem($extraFooterScripts);
break;
case "/about":
DisplayAbout();
break;
default:
DisplayDashboard($extraFooterScripts);
}
?>

View File

@ -1,93 +0,0 @@
<ul class="navbar-nav sidebar sidebar-light d-none d-md-block accordion <?php echo (isset($_SESSION["toggleState"])) ? $_SESSION["toggleState"] : null ; ?>" id="accordionSidebar">
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="wlan0_info">
<div class="sidebar-brand-text ml-1"><?php echo RASPI_BRAND_TEXT; ?></div>
</a>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<div class="row">
<div class="col-xs ml-3 sidebar-brand-icon">
<img src="app/img/raspAP-logo.php" class="navbar-logo" width="64" height="64">
</div>
<div class="col-xs ml-2">
<div class="ml-1">Status</div>
<div class="info-item-xs"><span class="icon">
<i class="fas fa-circle <?php echo ($hostapd_led); ?>"></i></span> <?php echo _("Hotspot").' '. _($hostapd_status); ?>
</div>
<div class="info-item-xs"><span class="icon">
<i class="fas fa-circle <?php echo ($memused_led); ?>"></i></span> <?php echo _("Memory Use").': '. htmlspecialchars(strval($memused), ENT_QUOTES); ?>%
</div>
<div class="info-item-xs"><span class="icon">
<i class="fas fa-circle <?php echo ($cputemp_led); ?>"></i></span> <?php echo _("CPU Temp").': '. htmlspecialchars($cputemp, ENT_QUOTES); ?>°C
</div>
</div>
</div>
<li class="nav-item">
<a class="nav-link" href="wlan0_info"><i class="fas fa-tachometer-alt fa-fw mr-2"></i><span class="nav-label"><?php echo _("Dashboard"); ?></span></a>
</li>
<?php if (RASPI_HOTSPOT_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="hostapd_conf"><i class="far fa-dot-circle fa-fw mr-2"></i><span class="nav-label"><?php echo _("Hotspot"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_DHCP_ENABLED && !$_SESSION["bridgedEnabled"]) : ?>
<li class="nav-item">
<a class="nav-link" href="dhcpd_conf"><i class="fas fa-exchange-alt fa-fw mr-2"></i><span class="nav-label"><?php echo _("DHCP Server"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_ADBLOCK_ENABLED && !$_SESSION["bridgedEnabled"]) : ?>
<li class="nav-item">
<a class="nav-link" href="adblock_conf"><i class="far fa-hand-paper fa-fw mr-2"></i><span class="nav-label"><?php echo _("Ad Blocking"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_NETWORK_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="network_conf"><i class="fas fa-network-wired fa-fw mr-2"></i><span class="nav-label"><?php echo _("Networking"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_WIFICLIENT_ENABLED && !$_SESSION["bridgedEnabled"]) : ?>
<li class="nav-item">
<a class="nav-link" href="wpa_conf"><i class="fas fa-wifi fa-fw mr-2"></i><span class="nav-label"><?php echo _("WiFi client"); ?></span></a>
</li>
<?php endif; ?>
<?php if (RASPI_OPENVPN_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="openvpn_conf"><i class="fas fa-key fa-fw mr-2"></i><span class="nav-label"><?php echo _("OpenVPN"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_WIREGUARD_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="wg_conf"><span class="ra-wireguard mr-2"></span><span class="nav-label"><?php echo _("WireGuard"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_TORPROXY_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="torproxy_conf"><i class="fas fa-eye-slash fa-fw mr-2"></i><span class="nav-label"><?php echo _("TOR proxy"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_CONFAUTH_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="auth_conf"><i class="fas fa-user-lock fa-fw mr-2"></i><span class="nav-label"><?php echo _("Authentication"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_VNSTAT_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="data_use"><i class="fas fa-chart-bar fa-fw mr-2"></i><span class="nav-label"><?php echo _("Data usage"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_SYSTEM_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="system_info"><i class="fas fa-cube fa-fw mr-2"></i><span class="nav-label"><?php echo _("System"); ?></a>
</li>
<?php endif; ?>
<li class="nav-item">
<a class="nav-link" href="about"><i class="fas fa-info-circle fa-fw mr-2"></i><span class="nav-label"><?php echo _("About RaspAP"); ?></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider d-none d-md-block">
<!-- Sidebar Toggler (Sidebar) -->
<div class="text-center d-none d-md-block">
<button class="rounded-circle border-0" id="sidebarToggle"></button>
</div>
</ul>

View File

@ -1,16 +1,5 @@
<?php
/**
* Status message class
*
* @description Status message class for RaspAP
* @author Bill Zimmerman <billzimmerman@gmail.com>
* @license https://github.com/raspap/raspap-webgui/blob/master/LICENSE
*/
namespace RaspAP\Messages;
class StatusMessage
class StatusMessages
{
public $messages = array();

View File

@ -1,5 +1,7 @@
<?php
require_once 'app/lib/system.php';
$system = new \RaspAP\System\Sysinfo;
$hostname = $system->hostname();

View File

@ -1,14 +1,74 @@
<?php
require_once 'includes/status_messages.php';
require_once 'includes/functions.php';
require_once 'config.php';
require_once 'app/lib/system.php';
/**
* Find the version of the Raspberry Pi
* Currently only used for the system information page but may useful elsewhere
*/
function RPiVersion()
{
// Lookup table from http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/
$revisions = array(
'0002' => 'Model B Revision 1.0',
'0003' => 'Model B Revision 1.0 + ECN0001',
'0004' => 'Model B Revision 2.0 (256 MB)',
'0005' => 'Model B Revision 2.0 (256 MB)',
'0006' => 'Model B Revision 2.0 (256 MB)',
'0007' => 'Model A',
'0008' => 'Model A',
'0009' => 'Model A',
'000d' => 'Model B Revision 2.0 (512 MB)',
'000e' => 'Model B Revision 2.0 (512 MB)',
'000f' => 'Model B Revision 2.0 (512 MB)',
'0010' => 'Model B+',
'0013' => 'Model B+',
'0011' => 'Compute Module',
'0012' => 'Model A+',
'a01041' => 'a01041',
'a21041' => 'a21041',
'900092' => 'PiZero 1.2',
'900093' => 'PiZero 1.3',
'9000c1' => 'PiZero W',
'a02082' => 'Pi 3 Model B',
'a22082' => 'Pi 3 Model B',
'a32082' => 'Pi 3 Model B',
'a52082' => 'Pi 3 Model B',
'a020d3' => 'Pi 3 Model B+',
'a220a0' => 'Compute Module 3',
'a020a0' => 'Compute Module 3',
'a02100' => 'Compute Module 3+',
'a03111' => 'Model 4B Revision 1.1 (1 GB)',
'b03111' => 'Model 4B Revision 1.1 (2 GB)',
'c03111' => 'Model 4B Revision 1.1 (4 GB)'
);
$cpuinfo_array = '';
exec('cat /proc/cpuinfo', $cpuinfo_array);
$rev = trim(array_pop(explode(':', array_pop(preg_grep("/^Revision/", $cpuinfo_array)))));
if (array_key_exists($rev, $revisions)) {
return $revisions[$rev];
} else {
exec('cat /proc/device-tree/model', $model);
if (isset($model[0])) {
return $model[0];
} else {
return 'Unknown Device';
}
}
}
/**
*
*/
function DisplaySystem(&$extraFooterScripts)
{
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
if (isset($_POST['SaveLanguage'])) {
if (isset($_POST['locale'])) {
@ -47,6 +107,15 @@ function DisplaySystem(&$extraFooterScripts)
}
}
}
if (isset($_POST['system_reboot'])) {
$status->addMessage("System Rebooting Now!", "warning", false);
$result = shell_exec("sudo /sbin/reboot");
}
if (isset($_POST['system_shutdown'])) {
$status->addMessage("System Shutting Down Now!", "warning", false);
$result = shell_exec("sudo /sbin/shutdown -h now");
}
}
if (isset($_POST['RestartLighttpd'])) {
@ -56,16 +125,12 @@ function DisplaySystem(&$extraFooterScripts)
exec('cat '. RASPI_LIGHTTPD_CONFIG, $return);
$conf = ParseConfig($return);
$serverPort = $conf['server.port'];
if (isset($conf['server.bind'])) {
$serverBind = str_replace('"', '',$conf['server.bind']);
} else {
$serverBind = '';
}
// define locales
$arrLocales = getLocales();
// fetch system status variables
#fetch system status variables.
$system = new \RaspAP\System\Sysinfo;
$hostname = $system->hostname();
@ -74,7 +139,6 @@ function DisplaySystem(&$extraFooterScripts)
$os = $system->operatingSystem();
$kernel = $system->kernelVersion();
$systime = $system->systime();
$revision = $system->rpiRevision();
// mem used
$memused = $system->usedMemory();
@ -126,18 +190,13 @@ function DisplaySystem(&$extraFooterScripts)
// theme options
$themes = [
"default" => "RaspAP (default)",
"hackernews" => "HackerNews",
"material-light" => "Material"
"hackernews" => "HackerNews"
];
$themeFiles = [
"default" => "custom.php",
"hackernews" => "hackernews.css",
"material-light" => "material-light.php"
"hackernews" => "hackernews.css"
];
$selectedTheme = array_search($_COOKIE['theme'], $themeFiles);
if (strpos($_COOKIE['theme'],'material') !== false) {
$selectedTheme = 'material-light';
}
$extraFooterScripts[] = array('src'=>'dist/huebee/huebee.pkgd.min.js', 'defer'=>false);
$extraFooterScripts[] = array('src'=>'app/js/huebee.js', 'defer'=>false);
@ -150,7 +209,6 @@ function DisplaySystem(&$extraFooterScripts)
"hostname",
"uptime",
"systime",
"revision",
"cores",
"os",
"kernel",

View File

@ -1,5 +1,7 @@
<?php
require_once 'includes/status_messages.php';
/**
* Manage Tor Proxy configuration
*/

View File

@ -27,9 +27,9 @@ function knownWifiStations(&$networks)
$network['ssid'] = $ssid;
break;
case 'psk':
$network['passkey'] = trim($lineArr[1]);
$network['protocol'] = 'WPA';
if (array_key_exists('passphrase', $network)) {
break;
}
case '#psk':
$network['protocol'] = 'WPA';
case 'wep_key0': // Untested
@ -77,7 +77,6 @@ function nearbyWifiStations(&$networks, $cached = true)
if ( isset($lastnet['index']) ) $index = $lastnet['index'] + 1;
}
if (is_array($scan_results)) {
array_shift($scan_results);
foreach ($scan_results as $network) {
$arrNetwork = preg_split("/[\t]+/", $network); // split result into array
@ -119,7 +118,6 @@ function nearbyWifiStations(&$networks, $cached = true)
}
}
}
}
}
function connectedWifiStations(&$networks)

View File

@ -1,5 +1,6 @@
<?php
require_once 'includes/status_messages.php';
require_once 'config.php';
/**
@ -7,7 +8,7 @@ require_once 'config.php';
*/
function DisplayWireGuardConfig()
{
$status = new \RaspAP\Messages\StatusMessage;
$status = new StatusMessages();
if (!RASPI_MONITOR_ENABLED) {
$optRules = $_POST['wgRules'];
$optConf = $_POST['wgCnfOpt'];
@ -111,7 +112,7 @@ function SaveWireGuardUpload($status, $file, $optRules)
throw new RuntimeException('Invalid parameters');
}
$upload = \RaspAP\Uploader\FileUpload::factory('wg',$tmp_destdir);
$upload = \RaspAP\Uploader\Upload::factory('wg',$tmp_destdir);
$upload->set_max_file_size(64*KB);
$upload->set_allowed_mime_types(array('text/plain'));
$upload->file($file);

213
index.php
View File

@ -8,13 +8,13 @@
* Recommended distribution is Raspberry Pi OS (64-bit) Lite. Specific instructions to install the supported software are
* in the README and original post by @SirLagz. For a quick run through, the packages required for the WebGUI are:
* lighttpd (version 1.4.59 installed via apt)
* php-cgi (version 7.4.33 installed via apt)
* along with their supporting packages, php7.4 will also need to be enabled.
* php-cgi (version 7.4.28 installed via apt)
* along with their supporting packages, php7.3 will also need to be enabled.
*
* @author Lawrence Yau <sirlagz@gmail.com>
* @author Bill Zimmerman <billzimmerman@gmail.com>
* @license GNU General Public License, version 3 (GPL-3.0)
* @version 2.9.6
* @version 2.9.3
* @link https://github.com/RaspAP/raspap-webgui/
* @link https://raspap.com/
* @see http://sirlagz.net/2013/02/08/raspap-webgui/
@ -27,8 +27,8 @@ require 'includes/csrf.php';
ensureCSRFSessionToken();
require_once 'includes/config.php';
require_once 'includes/autoload.php';
require_once 'includes/defaults.php';
require_once RASPI_CONFIG.'/raspap.php';
require_once 'includes/locale.php';
require_once 'includes/functions.php';
require_once 'includes/dashboard.php';
@ -47,9 +47,15 @@ require_once 'includes/openvpn.php';
require_once 'includes/wireguard.php';
require_once 'includes/torproxy.php';
initializeApp();
?>
<!DOCTYPE html>
$config = getConfig();
$output = $return = 0;
$page = $_SERVER['PATH_INFO'];
$theme_url = getThemeOpt();
$toggleState = getSidebarState();
$bridgedEnabled = getBridgedState();
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
@ -80,7 +86,8 @@ initializeApp();
<link href="dist/raspap/css/style.css" rel="stylesheet" type="text/css">
<!-- Custom CSS -->
<link href="<?php echo $_SESSION["theme_url"]; ?>" title="main" rel="stylesheet">
<link href="<?php echo $theme_url; ?>" title="main" rel="stylesheet">
<link rel="shortcut icon" type="image/png" href="app/icons/favicon.png?ver=2.0">
<link rel="apple-touch-icon" sizes="180x180" href="app/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="app/icons/favicon-32x32.png">
@ -102,18 +109,191 @@ initializeApp();
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Sidebar -->
<?php require_once 'includes/sidebar.php'; ?>
<ul class="navbar-nav sidebar sidebar-light d-none d-md-block accordion <?php echo (isset($toggleState)) ? $toggleState : null ; ?>" id="accordionSidebar">
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="wlan0_info">
<div class="sidebar-brand-text ml-1"><?php echo RASPI_BRAND_TEXT; ?></div>
</a>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<div class="row">
<div class="col-xs ml-3 sidebar-brand-icon">
<img src="app/img/raspAP-logo.php" class="navbar-logo" width="64" height="64">
</div>
<div class="col-xs ml-2">
<div class="ml-1">Status</div>
<div class="info-item-xs"><span class="icon">
<i class="fas fa-circle <?php echo ($hostapd_led); ?>"></i></span> <?php echo _("Hotspot").' '. _($hostapd_status); ?>
</div>
<div class="info-item-xs"><span class="icon">
<i class="fas fa-circle <?php echo ($memused_led); ?>"></i></span> <?php echo _("Memory Use").': '. htmlspecialchars($memused, ENT_QUOTES); ?>%
</div>
<div class="info-item-xs"><span class="icon">
<i class="fas fa-circle <?php echo ($cputemp_led); ?>"></i></span> <?php echo _("CPU Temp").': '. htmlspecialchars($cputemp, ENT_QUOTES); ?>°C
</div>
</div>
</div>
<li class="nav-item">
<a class="nav-link" href="wlan0_info"><i class="fas fa-tachometer-alt fa-fw mr-2"></i><span class="nav-label"><?php echo _("Dashboard"); ?></span></a>
</li>
<?php if (RASPI_HOTSPOT_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="hostapd_conf"><i class="far fa-dot-circle fa-fw mr-2"></i><span class="nav-label"><?php echo _("Hotspot"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_DHCP_ENABLED && !$bridgedEnabled) : ?>
<li class="nav-item">
<a class="nav-link" href="dhcpd_conf"><i class="fas fa-exchange-alt fa-fw mr-2"></i><span class="nav-label"><?php echo _("DHCP Server"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_ADBLOCK_ENABLED && !$bridgedEnabled) : ?>
<li class="nav-item">
<a class="nav-link" href="adblock_conf"><i class="far fa-hand-paper fa-fw mr-2"></i><span class="nav-label"><?php echo _("Ad Blocking"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_NETWORK_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="network_conf"><i class="fas fa-network-wired fa-fw mr-2"></i><span class="nav-label"><?php echo _("Networking"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_WIFICLIENT_ENABLED && !$bridgedEnabled) : ?>
<li class="nav-item">
<a class="nav-link" href="wpa_conf"><i class="fas fa-wifi fa-fw mr-2"></i><span class="nav-label"><?php echo _("WiFi client"); ?></span></a>
</li>
<?php endif; ?>
<?php if (RASPI_OPENVPN_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="openvpn_conf"><i class="fas fa-key fa-fw mr-2"></i><span class="nav-label"><?php echo _("OpenVPN"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_WIREGUARD_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="wg_conf"><span class="ra-wireguard mr-2"></span><span class="nav-label"><?php echo _("WireGuard"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_TORPROXY_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="torproxy_conf"><i class="fas fa-eye-slash fa-fw mr-2"></i><span class="nav-label"><?php echo _("TOR proxy"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_CONFAUTH_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="auth_conf"><i class="fas fa-user-lock fa-fw mr-2"></i><span class="nav-label"><?php echo _("Authentication"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_VNSTAT_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="data_use"><i class="fas fa-chart-bar fa-fw mr-2"></i><span class="nav-label"><?php echo _("Data usage"); ?></a>
</li>
<?php endif; ?>
<?php if (RASPI_SYSTEM_ENABLED) : ?>
<li class="nav-item">
<a class="nav-link" href="system_info"><i class="fas fa-cube fa-fw mr-2"></i><span class="nav-label"><?php echo _("System"); ?></a>
</li>
<?php endif; ?>
<li class="nav-item">
<a class="nav-link" href="about"><i class="fas fa-info-circle fa-fw mr-2"></i><span class="nav-label"><?php echo _("About RaspAP"); ?></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider d-none d-md-block">
<!-- Sidebar Toggler (Sidebar) -->
<div class="text-center d-none d-md-block">
<button class="rounded-circle border-0" id="sidebarToggle"></button>
</div>
</ul>
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<?php require_once 'includes/navbar.php'; ?>
<nav class="navbar navbar-expand navbar-light topbar mb-1 static-top">
<!-- Sidebar Toggle (Topbar) -->
<button id="sidebarToggleTopbar" class="btn btn-link d-md-none rounded-circle mr-3">
<i class="fa fa-bars"></i>
</button>
<!-- Topbar Navbar -->
<p class="text-left brand-title mt-3 ml-2"></p>
<ul class="navbar-nav ml-auto">
<!-- Nav Item - Insiders -->
<div class="insiders mt-4">
<a href="https://docs.raspap.com/insiders" target="blank"><i class="fas fa-heart mr-3" style="color: #e63946"></i></a>
</div>
<!-- Nav Item - Night mode -->
<div class="custom-control custom-switch mt-4">
<input type="checkbox" class="custom-control-input" id="night-mode" <?php echo getNightmode() ? 'checked' : null ; ?> >
<label class="custom-control-label" for="night-mode"><i class="far fa-moon mr-1 text-muted"></i></label>
</div>
<div class="topbar-divider d-none d-sm-block"></div>
<!-- Nav Item - User -->
<li class="nav-item dropdown no-arrow">
<a class="nav-link" href="auth_conf">
<span class="mr-2 d-none d-lg-inline small"><?php echo htmlspecialchars($config['admin_user'], ENT_QUOTES); ?></span>
<i class="fas fa-user-circle fa-3x"></i>
</a>
</li>
</ul>
</nav>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<?php require_once 'includes/page_actions.php'; ?>
<?php
$extraFooterScripts = array();
// handle page actions
switch ($page) {
case "/wlan0_info":
DisplayDashboard($extraFooterScripts);
break;
case "/dhcpd_conf":
DisplayDHCPConfig();
break;
case "/wpa_conf":
DisplayWPAConfig();
break;
case "/network_conf":
DisplayNetworkingConfig();
break;
case "/hostapd_conf":
DisplayHostAPDConfig();
break;
case "/adblock_conf":
DisplayAdBlockConfig();
break;
case "/openvpn_conf":
DisplayOpenVPNConfig();
break;
case "/wg_conf":
DisplayWireGuardConfig();
break;
case "/torproxy_conf":
DisplayTorProxyConfig();
break;
case "/torproxy_conf":
DisplayTorProxyConfig();
break;
case "/auth_conf":
DisplayAuthConfig($config['admin_user'], $config['admin_pass']);
break;
case "/save_hostapd_conf":
SaveTORAndVPNConfig();
break;
case "/data_use":
DisplayDataUsage($extraFooterScripts);
break;
case "/system_info":
DisplaySystem($extraFooterScripts);
break;
case "/about":
DisplayAbout();
break;
default:
DisplayDashboard($extraFooterScripts);
}
?>
</div><!-- /.container-fluid -->
</div><!-- End of Main Content -->
<!-- Footer -->
@ -150,6 +330,15 @@ initializeApp();
<!-- Custom RaspAP JS -->
<script src="app/js/custom.js"></script>
<?php loadFooterScripts($extraFooterScripts); ?>
<?php
// Load non default JS/ECMAScript in footer.
foreach ($extraFooterScripts as $script) {
echo '<script type="text/javascript" src="' , $script['src'] , '"';
if ($script['defer']) {
echo ' defer="defer"';
}
echo '></script>' , PHP_EOL;
}
?>
</body>
</html>

View File

@ -27,8 +27,7 @@ readonly raspap_sysctl="/etc/sysctl.d/90_raspap.conf"
readonly raspap_network="$raspap_dir/networking/"
readonly raspap_router="/etc/lighttpd/conf-available/50-raspap-router.conf"
readonly rulesv4="/etc/iptables/rules.v4"
readonly blocklist_hosts="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
readonly blocklist_domains="https://big.oisd.nl/dnsmasq"
readonly notracking_url="https://raw.githubusercontent.com/notracking/hosts-blocklists/master/"
webroot_dir="/var/www/html"
if [ "$insiders" == 1 ]; then
@ -53,6 +52,7 @@ function _install_raspap() {
_create_hostapd_scripts
_create_lighttpd_scripts
_install_lighttpd_configs
_move_config_file
_default_configuration
_configure_networking
_prompt_install_adblock
@ -227,6 +227,8 @@ function _install_dependencies() {
fi
if [ ${OS,,} = "debian" ] || [ ${OS,,} = "ubuntu" ]; then
dhcpcd_package="dhcpcd5"
fi
if [ ${OS,,} = "ubuntu" ]; then
iw_package="iw"
fi
@ -339,7 +341,7 @@ function _install_lighttpd_configs() {
# Prompt to install ad blocking
function _prompt_install_adblock() {
_install_log "Configure ad blocking"
_install_log "Configure ad blocking (Beta)"
echo -n "Install ad blocking and enable list management? [Y/n]: "
if [ "$assume_yes" == 0 ]; then
read answer < /dev/tty
@ -355,7 +357,7 @@ function _prompt_install_adblock() {
fi
}
# Download adblock lists and enable option
# Download notracking adblock lists and enable option
function _install_adblock() {
_install_log "Creating ad blocking base configuration (Beta)"
if [ ! -d "$raspap_dir/adblock" ]; then
@ -364,12 +366,12 @@ function _install_adblock() {
fi
if [ ! -f /tmp/hostnames.txt ]; then
echo "Fetching latest hostnames list"
wget ${blocklist_hosts} -q --show-progress --progress=bar:force -O /tmp/hostnames.txt 2>&1 \
wget ${notracking_url}hostnames.txt -q --show-progress --progress=bar:force -O /tmp/hostnames.txt 2>&1 \
|| _install_status 1 "Unable to download notracking hostnames"
fi
if [ ! -f /tmp/domains.txt ]; then
echo "Fetching latest domains list"
wget ${blocklist_domains} -q --show-progress --progress=bar:force -O /tmp/domains.txt 2>&1 \
wget ${notracking_url}domains.txt -q --show-progress --progress=bar:force -O /tmp/domains.txt 2>&1 \
|| _install_status 1 "Unable to download notracking domains"
fi
echo "Adding blocklists to $raspap_dir/adblock"
@ -488,10 +490,6 @@ function _download_latest_files() {
fi
_install_log "Cloning latest files from github"
if [ "$repo" == "RaspAP/raspap-insiders" ]; then
_install_status 3
echo "Insiders please read this: https://docs.raspap.com/insiders/#authentication"
fi
git clone --branch $branch --depth 1 -c advice.detachedHead=false $git_source_url /tmp/raspap-webgui || _install_status 1 "Unable to download files from github"
sudo mv /tmp/raspap-webgui $webroot_dir || _install_status 1 "Unable to move raspap-webgui to web root"
@ -561,6 +559,18 @@ function _check_for_old_configs() {
_install_status 0
}
# Move configuration file to the correct location
function _move_config_file() {
if [ ! -d "$raspap_dir" ]; then
_install_status 1 "'$raspap_dir' directory doesn't exist"
fi
# Copy config file and make writable by www-data group
_install_log "Moving configuration file to $raspap_dir"
sudo cp "$webroot_dir"/raspap.php "$raspap_dir" || _install_status 1 "Unable to move files to '$raspap_dir'"
sudo chown -c $raspap_user:"$raspap_user" "$raspap_dir"/raspap.php || _install_status 1 "Unable change owner and/or group"
}
# Set up default configuration
function _default_configuration() {
if [ "$upgrade" == 0 ]; then
@ -737,17 +747,11 @@ function _optimize_php() {
function _install_complete() {
_install_log "Installation completed"
if [ "$repo" == "RaspAP/raspap-insiders" ]; then
echo -e "${ANSI_RASPBERRY}"
echo "Thank you for supporting this project as an Insider!"
echo -e "${ANSI_RESET}"
else
echo "Join RaspAP Insiders for early access to exclusive features!"
echo -e "${ANSI_RASPBERRY}"
echo "> https://docs.raspap.com/insiders/"
echo "> https://github.com/sponsors/RaspAP/"
echo -e "${ANSI_RESET}"
fi
if [ "$assume_yes" == 0 ]; then
# Prompt to reboot if wired ethernet (eth0) is connected.
# With default_configuration this will create an active AP on restart.

View File

@ -234,8 +234,6 @@ function _install_status() {
2)
echo -e "[$ANSI_YELLOW \U26A0 warning $ANSI_RESET] $2"
;;
3)
echo -e "[$ANSI_RASPBERRY ! important $ANSI_RESET] $2"
esac
}

View File

@ -15,7 +15,7 @@ update_url=$1
file=$2
destination=$3
wget -q --no-use-server-timestamps ${update_url} -O ${destination}${file} &> /dev/null
wget -q ${update_url} -O ${destination}${file} &> /dev/null
echo "$?"

Binary file not shown.

View File

@ -904,7 +904,7 @@ msgstr "Einstellungen"
msgid "Currently available OpenVPN client configurations are displayed below."
msgstr "Derzeit verfügbare OpenVPN-Client-Konfigurationen werden unten angezeigt."
msgid "Activating a configuration will restart the <code>openvpn-client</code> service."
msgid "Activating a configuraton will restart the <code>openvpn-client</code> service."
msgstr "Die Aktivierung einer Konfiguration startet den Dienst <code>openvpn-client</code> neu."
msgid "Delete OpenVPN client"

Binary file not shown.

View File

@ -752,18 +752,6 @@ msgstr "Reboot"
msgid "Shutdown"
msgstr "Shutdown"
msgid "System reboot"
msgstr "System reboot"
msgid "System shutdown"
msgstr "System shutdown"
msgid "Reboot now? The system will be temporarily unavailable."
msgstr "Reboot now? The system will be temporarily unavailable."
msgid "Shutdown now? The system will be unavailable."
msgstr "Shutdown now? The system will be unavailable."
msgid "System Rebooting Now!"
msgstr "System Rebooting Now!"
@ -925,8 +913,8 @@ msgstr "Configurations"
msgid "Currently available OpenVPN client configurations are displayed below."
msgstr "Currently available OpenVPN client configurations are displayed below."
msgid "Activating a configuration will restart the <code>openvpn-client</code> service."
msgstr "Activating a configuration will restart the <code>openvpn-client</code> service."
msgid "Activating a configuraton will restart the <code>openvpn-client</code> service."
msgstr "Activating a configuraton will restart the <code>openvpn-client</code> service."
msgid "Delete OpenVPN client"
msgstr "Delete OpenVPN client"

Binary file not shown.

View File

@ -844,7 +844,7 @@ msgstr "Configuraciones"
msgid "Currently available OpenVPN client configurations are displayed below."
msgstr "Las configuraciones de cliente OpenVPN actualmente disponibles se muestran a continuación."
msgid "Activating a configuration will restart the <code>openvpn-client</code> service."
msgid "Activating a configuraton will restart the <code>openvpn-client</code> service."
msgstr "Al activar una configuración, se reiniciará el servicio <code>openvpn-client</code>."
msgid "Delete OpenVPN client"

Binary file not shown.

View File

@ -877,7 +877,7 @@ msgstr "Configuration"
msgid "Currently available OpenVPN client configurations are displayed below."
msgstr "Les configurations des fichiers OpenVPN actuellement disponibles sont affichées ci-dessous."
msgid "Activating a configuration will restart the <code>openvpn-client</code> service."
msgid "Activating a configuraton will restart the <code>openvpn-client</code> service."
msgstr "L'activation d'une configuration redémarrera le service <code>openvpn-client</code>."
msgid "Delete OpenVPN client"

Binary file not shown.

View File

@ -844,7 +844,7 @@ msgstr "Configurazioni"
msgid "Currently available OpenVPN client configurations are displayed below."
msgstr "Le configurazioni client OpenVPN attualmente disponibili sono visualizzate di seguito."
msgid "Activating a configuration will restart the <code>openvpn-client</code> service."
msgid "Activating a configuraton will restart the <code>openvpn-client</code> service."
msgstr "Attivando la configurazione si riavvierà il servizio <code>openvpn-client</code>."
msgid "Delete OpenVPN client"

Binary file not shown.

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: raspap\n"
"Report-Msgid-Bugs-To: Bill Zimmerman <billzimmerman@gmail.com>\n"
"POT-Creation-Date: 2017-10-19 08:56+0000\n"
"PO-Revision-Date: 2023-09-17 15:33\n"
"PO-Revision-Date: 2022-01-05 11:43\n"
"Last-Translator: Bill Zimmerman <billzimmerman@gmail.com>\n"
"Language-Team: Korean\n"
"Language: ko_KR\n"
@ -147,31 +147,31 @@ msgid "Not configured"
msgstr "환결설정 안됨"
msgid "Connected"
msgstr "연결됨"
msgstr ""
msgid "Known"
msgstr ""
msgid "Nearby"
msgstr "근처"
msgstr ""
msgid "<strong>Note:</strong> WEP access points appear as 'Open'. RaspAP does not currently support connecting to WEP"
msgstr "<strong>주의:</strong> WEP 접근점은 'Open'으로 표시됩니다. RaspAP은 현재 WEP 연결을 지원하지 않습니다"
msgid "No Wifi stations found"
msgstr "Wifi 스테이션을 찾을 수 없습니다."
msgstr ""
msgid "Reinitializing wpa_supplicant"
msgstr "wpa_supplicant 재초기화"
msgstr ""
msgid "Click 'Rescan' to search for nearby Wifi stations."
msgstr "근처 Wifi 스테이션을 검색하려면 '재검색'을 클릭하세요."
msgstr ""
msgid "Click 'Reinitialize' to force reinitialize <code>wpa_supplicant</code>."
msgstr "<code>wpa_supplicant</code>를 강제로 다시 초기화하려면 '재 초기화'를 클릭하십시오."
msgstr ""
msgid "Reinitialize"
msgstr "재초기화"
msgstr ""
#: includes/dashboard.php
msgid "Interface Information"
@ -268,58 +268,58 @@ msgid "Connected Devices"
msgstr "연결된 디바이스 "
msgid "Client: Ethernet cable"
msgstr "클라이언트: 이더넷 케이블"
msgstr ""
msgid "Ethernet"
msgstr "이더넷"
msgstr ""
msgid "Client: Smartphone (USB tethering)"
msgstr "클라이언트: 스마트폰(USB 테더링)"
msgstr ""
msgid "Smartphone"
msgstr "스마트폰"
msgstr ""
msgid "WiFi"
msgstr "WiFi"
msgstr ""
msgid "Mobile Data Client"
msgstr "모바일 데이터 클라이언트"
msgstr ""
msgid "Mobile Data"
msgstr "모바일 데이터"
msgstr ""
msgid "No information available"
msgstr "사용 가능한 정보 없음"
msgstr ""
msgid "Interface name invalid"
msgstr "인터페이스 이름이 잘못되었습니다."
msgstr ""
msgid "Required exec function is disabled. Check if exec is not added to php <code>disable_functions</code>."
msgstr "필수 실행 기능이 비활성화되었습니다. exec가 php <code>disable_functions</code>에 추가되지 않았는지 확인하십시오."
msgstr ""
msgid "Waiting for the interface to start ..."
msgstr "인터페이스가 시작되기를 기다리는 중..."
msgstr ""
msgid "Stop the Interface"
msgstr "인터페이스 중지"
msgstr ""
msgid "Connection mode"
msgstr "연결 모드"
msgstr ""
msgid "Signal quality"
msgstr "신호 품질"
msgstr ""
msgid "WAN IP"
msgstr "WAN IP"
msgstr ""
msgid "Web-GUI"
msgstr "웹-GUI"
msgstr ""
msgid "Signal strength"
msgstr "신호 강도"
msgstr ""
msgid "No Client device or not yet configured"
msgstr "클라이언트 장치가 없거나 아직 구성되지 않았습니다."
msgstr ""
#: includes/dhcp.php
msgid "DHCP server settings"
@ -368,7 +368,7 @@ msgid "MAC Address"
msgstr "MAC 주소"
msgid "Optional comment"
msgstr "추가 코멘트"
msgstr ""
msgid "Host name"
msgstr "호스트명"
@ -419,58 +419,49 @@ msgid "Only ever query DNS servers configured below"
msgstr "아래에 구성된 DNS 서버 만 쿼리합니다."
msgid "Enable this option if you want RaspAP to <b>send DNS queries to the servers configured below exclusively</b>. By default RaspAP also uses its upstream DHCP server's name servers."
msgstr "RaspAP가 <b>아래에 구성된 서버에만 DNS 쿼리를 보내도록</b> 하려면 이 옵션을 활성화하십시오. 기본적으로 RaspAP는 업스트림 DHCP 서버의 이름 서버도 사용합니다."
msgstr ""
msgid "This option adds <code>no-resolv</code> to the dnsmasq configuration."
msgstr "이 옵션은 dnsmasq 구성에 <code>no-resolv</code>를 추가합니다."
msgstr ""
msgid "Add upstream DNS server"
msgstr "업스트림 DNS 서버 추가"
msgstr ""
msgid "Format"
msgstr "규격"
msgid "Choose a hosted server"
msgstr "호스팅 서버 선택"
msgstr ""
msgid "Enable these options to log <code>dhcpcd</code> and <code>dnsmasq</code> activity."
msgstr "<code>dhcpcd</code> 및 <code>dnsmasq</code> 활동을 기록하려면 이 옵션을 활성화하세요."
msgid "Enable these options to log DHCP server activity."
msgstr ""
msgid "Log DHCP requests"
msgstr "DHCP 요청 로그"
msgstr ""
msgid "Log DNS queries"
msgstr "DNS 쿼리 로그"
msgstr ""
msgid "Restrict access"
msgstr "액세스 제한"
msgstr ""
msgid "Limit network access to static clients"
msgstr "정적(static) 클라이언트에 대한 네트워크 액세스 제한"
msgstr ""
msgid "Enable this option if you want RaspAP to <b>ignore any clients</b> which are not specified in the static leases list."
msgstr "RaspAP가 정적 임대 목록에 지정되지 않은 <b>모든 클라이언트를 무시</b>하도록 하려면 이 옵션을 활성화하십시오."
msgstr ""
msgid "This option adds <code>dhcp-ignore</code> to the dnsmasq configuration."
msgstr "이 옵션은 dnsmasq 구성에 <code>dhcp-ignore</code>를 추가합니다."
msgstr ""
msgid "Clients with a particular hardware MAC address can always be allocated the same IP address."
msgstr "특정 하드웨어 MAC 주소를 가진 클라이언트는 항상 동일한 IP 주소를 할당받을 수 있습니다."
msgstr ""
msgid "This option adds <code>dhcp-host</code> entries to the dnsmasq configuration."
msgstr "이 옵션은 dnsmasq 구성에 <code>dhcp-host</code> 항목을 추가합니다."
msgstr ""
msgid "This toggles the <code>gateway</code>/<code>nogateway</code> option for this interface in the DHCPCD configuration."
msgstr "이렇게 하면 DHCPCD 구성에서 이 인터페이스에 대한 <code>gateway</code>/<code>nogateway</code> 옵션이 전환됩니다."
msgid "This toggles the <code>nohook wpa_supplicant</code> option for this interface in the DHCPCD configuration."
msgstr "러면 DHCPCD 구성에서 이 인터페이스에 대한 <code>nohook wpa_supplicant</code> 옵션이 전환됩니다."
msgid "Disable wpa_supplicant dhcp hook for this interface"
msgstr "이 인터페이스에 대해 wpa_supplicant dhcp 후크를 비활성화합니다."
msgid "If you manage wireless connections with wpa_supplicant itself, the hook may create unwanted connection events. This option disables the hook."
msgstr "wpa_supplicant 자체로 무선 연결을 관리하는 경우 후크가 원치 않는 연결 이벤트를 생성할 수 있습니다. 이 옵션은 후크를 비활성화합니다."
msgstr ""
#: includes/hostapd.php
msgid "Basic"
@ -494,8 +485,8 @@ msgstr "보안 유형 "
msgid "Encryption Type"
msgstr "암호화 유형"
msgid "Pre-shared key (PSK)"
msgstr "사전 공유 키(PSK)"
msgid "PSK"
msgstr "PSK (암호키)"
msgid "Advanced settings"
msgstr "고급 설정 "
@ -564,89 +555,41 @@ msgid "Maximum number of clients"
msgstr "클라이언트 최대 개수"
msgid "Configures the <code>max_num_sta</code> option of hostapd. The default and maximum is 2007. If empty or 0, the default applies."
msgstr "hostapd의 <code>max_num_sta</code> 옵션을 구성합니다. 기본값 및 최대값은 2007입니다. 비어 있거나 0이면 기본값이 적용됩니다."
msgstr ""
msgid "Beacon interval"
msgstr "비콘 간격"
msgstr ""
msgid "Disable <code>disassoc_low_ack</code>"
msgstr "<code>비활성화</code>"
msgstr ""
msgid "Do not disassociate stations based on excessive transmission failures."
msgstr "과도한 transmission 고장으로 인해 스테이션을 분리하지 마십시오."
msgstr ""
msgid "Executing RaspAP service start"
msgstr "RaspAP 서비스 시작 실행"
msgstr ""
msgid "Close"
msgstr "닫기"
msgid "Enable this option to log <code>hostapd</code> activity."
msgstr "<code>hostapd</code> 활동을 기록하려면 이 옵션을 활성화합니다."
msgstr ""
msgid "Transmit power (dBm)"
msgstr "송신 전력 (dBm)"
msgstr ""
msgid "Sets the <code>txpower</code> option for the AP interface and the configured country."
msgstr "AP 인터페이스 및 구성된 국가에 대한 <code>txpower</code> 옵션을 설정합니다."
msgstr ""
msgid "dBm is a unit of level used to indicate that a power ratio is expressed in decibels (dB) with reference to one milliwatt (mW). 30 dBm is equal to 1000 mW, while 0 dBm equals 1.25 mW."
msgstr "dBm은 1밀리와트(mW) 를 기준으로 전력비를 데시벨(dB) 로 표시하는 데 사용되는 레벨 단위입니다. 30dBm은 1000mW이고 0dBm은 1.25mW입니다."
msgid "WPA and WPA2"
msgstr "WPA 및 WPA2"
msgid "WPA2 and WPA3-Personal (transitional mode)"
msgstr "WPA2 및 WPA3-퍼스널 (전환 모드)"
msgid "WPA3-Personal (required)"
msgstr "WPA3-퍼스널 (WPA3-Personal)"
msgid "Enabled (for supported clients)"
msgstr "사용(지원되는 클라이언트용)"
msgid "Required (for supported clients)"
msgstr "필수(지원되는 클라이언트용)"
msgid "802.11w extends strong cryptographic protection to a select set of robust management frames, including Deauthentication, Disassociation and certain categories of Action Management frames. Collectively, this is known as Management Frame Protection (MFP)."
msgstr "802.11w는 강력한 암호화 보호를 인증 해제, 연결 해제 및 특정 범주의 작업 관리 프레임을 포함하여 강력한 관리 프레임의 선택 세트로 확장합니다. 이를 통칭하여 MFP (관리 프레임 보호) 라고 합니다."
msgid "Scan this QR code directly or %s %sprint a sign%s for your users."
msgstr "이 QR 코드를 직접 스캔하거나 사용자를 위해 %s %s인쇄%s하세요."
msgid "Printable Wi-Fi sign"
msgstr "인쇄 가능한 Wi-Fi 서명"
msgid "To connect with your phone or tablet, scan the QR code above with your camera app."
msgstr "전화기 또는 태블릿에 연결하려면 카메라 앱으로 위의 QR 코드를 스캔하십시오."
msgid "For other devices, use the login credentials below."
msgstr "다른 장치의 경우 아래의 로그인 자격 증명을 사용합니다."
msgid "Network"
msgstr "네트워크"
msgid "The selected interface (%s) has support for the 2.4 GHz wireless band only."
msgstr "선택한 인터페이스 (%s) 는 2.4GHz 무선 대역만 지원합니다."
msgid "The selected interface (%s) has support for the 2.5 GHz wireless band only."
msgstr "선택한 인터페이스 (%s) 는 2.5GHz 무선 대역만 지원합니다."
msgid "The selected interface (%s) has support for both the 2.4 and 5 GHz wireless bands."
msgstr "선택한 인터페이스 (%s) 는 2.4GHz 및 5GHz 무선 대역을 모두 지원합니다."
msgid "The selected interface (%s) does not support wireless mode operation."
msgstr "선택한 인터페이스 (%s) 는 무선 모드 작업을 지원하지 않습니다."
msgid "The 802.11ac 5 GHz option is disabled until a compatible wireless regulatory domain is set."
msgstr "802.11ac 5GHz 옵션은 호환되는 무선 규제 도메인이 설정될 때까지 비활성화됩니다."
msgstr ""
#: includes/networking.php
msgid "Summary"
msgstr "요약 "
msgid "Internet connection"
msgstr "인터넷 연결"
msgstr ""
msgid "Current settings"
msgstr "현재 설정"
@ -676,7 +619,7 @@ msgid "Static IP Options"
msgstr "고정 IP 옵션"
msgid "Metric"
msgstr "측정항목(Metric)"
msgstr ""
msgid "Apply settings"
msgstr "설정 적용"
@ -684,95 +627,56 @@ msgstr "설정 적용"
msgid "Information provided by /sys/class/net"
msgstr "/sys/class/net이 제공한 정보 "
msgid "Devices"
msgstr "디바이스"
msgid "Network Devices"
msgstr ""
msgid "Diagnostics"
msgstr "진단"
msgid "Mobile Data Settings"
msgstr ""
msgid "Properties of network devices"
msgstr "네트워크 장치의 속성"
msgstr ""
msgid "Device"
msgstr "장치"
msgstr ""
msgid "MAC"
msgstr "맥(MAC)"
msgstr ""
msgid "USB vid/pid"
msgstr "USB vid/pid"
msgstr ""
msgid "Device type"
msgstr "장치 유형"
msgstr ""
msgid "Fixed name"
msgstr "고정 이름"
msgstr ""
msgid "Change"
msgstr "변경"
msgstr ""
msgid "Settings for Mobile Data Devices"
msgstr "모바일 데이터 장치 설정"
msgstr ""
msgid "PIN of SIM card"
msgstr "SIM 카드의 PIN"
msgstr ""
msgid "APN Settings (Modem device ppp0)"
msgstr "APN 설정(모뎀 장치 ppp0)"
msgstr ""
msgid "Access Point Name (APN)"
msgstr "액세스 포인트 이름(APN)"
msgstr ""
msgid "Password"
msgstr "비밀번호"
msgstr ""
msgid "Successfully Updated Network Configuration"
msgstr "네트워크 구성을 성공적으로 업데이트했습니다."
msgstr ""
msgid "Error saving network configuration to file"
msgstr "파일에 네트워크 구성을 저장하는 동안 오류가 발생했습니다."
msgstr ""
msgid "Unable to detect interface"
msgstr "인터페이스를 감지할 수 없습니다."
msgid "Routing table"
msgstr "라우팅 테이블"
msgid "raw output"
msgstr "원시(raw) 출력"
msgid "Speedtest"
msgstr "속도테스트"
msgid "Selecting a server"
msgstr "서버를 선택하세요"
msgid "Privacy"
msgstr "개인정보"
msgid "Server"
msgstr "서버"
msgid "ms"
msgstr "밀리초(ms)"
msgid "Mbps"
msgstr "Mbps"
msgid "Ping"
msgstr "지연 시간(Ping)"
msgid "Jitter"
msgstr "지터(Jitter)"
msgid "Upload"
msgstr "업로드"
msgid "Start"
msgstr "시작"
msgid "Abort"
msgstr "중단"
msgstr ""
#: includes/system.php
msgid "System Information"
@ -802,9 +706,6 @@ msgstr "Pi 리비전"
msgid "Uptime"
msgstr "가동시간"
msgid "System Time"
msgstr "시스템 시간"
msgid "Memory Used"
msgstr "사용된 메모리"
@ -829,42 +730,7 @@ msgstr "웹서버 포트"
msgid "Web server bind address"
msgstr "웹서버 바인드 주소"
msgid "OS"
msgstr "OS"
msgid "Kernel"
msgstr "커널"
msgid "System reset"
msgstr "시스템 리셋"
msgid "Reset RaspAP to its initial configuration? This action cannot be undone."
msgstr "RaspAP를 초기 구성으로 재설정하시겠습니까? 이 작업은 취소할 수 없습니다."
msgid "Reset complete. Restart the hotspot for the changes to take effect."
msgstr "재설정이 완료되었습니다. 변경 사항을 적용하려면 핫스팟을 다시 시작하세요."
msgid "System reset in progress..."
msgstr "시스템 재설정 진행 중..."
msgid "Reset"
msgstr "리셋"
msgid "Restore settings"
msgstr "설정 복원"
msgid "To reset RaspAP to its <a href=\"%s\">initial configuration</a>, click or tap the button below."
msgstr "RaspAP를 <a href=\"%s\">초기 구성</a>으로 재설정하려면 아래 버튼을 클릭하거나 탭하세요."
msgid "Custom files for optional components such as Ad Blocking, WireGuard or OpenVPN will remain on the system."
msgstr "광고 차단, WireGuard 또는 OpenVPN과 같은 선택적 구성 요소에 대한 사용자 정의 파일은 시스템에 유지됩니다."
msgid "Perform reset"
msgstr "초기화 수행"
msgid "Restores all access point (AP) service settings to their default values. This applies to hostapd, dhcpcd and dnsmasq."
msgstr "모든 액세스 포인트(AP) 서비스 설정을 기본값으로 복원합니다. 이는 Hostapd, dhcpcd 및 dnsmasq에 적용됩니다."
#: includes/themes.php
msgid "Theme settings"
msgstr "테마 설정"
@ -976,22 +842,22 @@ msgid "Configurations"
msgstr "환경설정"
msgid "Currently available OpenVPN client configurations are displayed below."
msgstr "현재 사용 가능한 OpenVPN 클라이언트 구성이 아래에 표시됩니다."
msgstr ""
msgid "Activating a configuration will restart the <code>openvpn-client</code> service."
msgstr "구성을 활성화하면 <code>openvpn-client</code> 서비스가 다시 시작됩니다."
msgid "Activating a configuraton will restart the <code>openvpn-client</code> service."
msgstr ""
msgid "Delete OpenVPN client"
msgstr "OpenVPN 클라이언트 삭제"
msgstr ""
msgid "Delete client configuration? This cannot be undone."
msgstr "클라이언트 구성을 삭제하시겠습니까? 이 취소 할 수 없습니다."
msgstr ""
msgid "Activate OpenVPN client"
msgstr "OpenVPN 클라이언트 활성화"
msgstr ""
msgid "Activate client configuration? This will restart the openvpn-client service."
msgstr "클라이언트 구성을 활성화하시겠습니까? 그러면 openvpn-client 서비스가 다시 시작됩니다."
msgstr ""
msgid "Activate"
msgstr "활성화"
@ -1000,13 +866,13 @@ msgid "Cancel"
msgstr "취소"
msgid "Enable this option to log <code>openvpn</code> activity."
msgstr "<code>openvpn</code> 활동을 기록하려면 이 옵션을 활성화합니다."
msgstr ""
msgid "Authentification Method"
msgstr "인증 방식"
msgstr ""
msgid "Username and password"
msgstr "사용자 이름 및 암호"
msgstr ""
msgid "Certificates"
msgstr "인증서"
@ -1018,16 +884,16 @@ msgid "Certificates in the configuration file"
msgstr "인증서의 구성파일"
msgid "RaspAP supports certificates by including them in the configuration file."
msgstr "RaspAP는 구성 파일에 인증서를 포함하여 인증서를 지원합니다."
msgstr ""
msgid "Signing certification authority (CA) certificate (e.g. <code>ca.crt</code>): enclosed in <code>&lt;ca> ... &lt;/ca></code> tags."
msgstr "서명 인증 기관(CA) 인증서(예: <code>ca.crt</code>): <code>&lt;ca> ... &lt;/ca></code> 태그로 묶입니다."
msgstr ""
msgid "Client certificate (public key) (e.g. <code>client.crt</code>): enclosed in <code>&lt;cert> ... &lt;/cert></code> tags."
msgstr "클라이언트 인증서(공개 키)(예: <code>client.crt</code>): <code>&lt;cert> ... &lt;/cert></code> 태그로 묶입니다."
msgstr ""
msgid "Private key of the client certificate (e.g. <code>client.key</code>): enclosed in <code>&lt;key> ... &lt;/key></code> tags."
msgstr "클라이언트 인증서의 개인 키(예: <code>client.key</code>): <code>&lt;key> ... &lt;/key></code> 태그로 묶입니다."
msgstr ""
msgid "Configuration File"
msgstr "설정 파일"
@ -1068,7 +934,7 @@ msgstr "TOR 중지 시도 중입니다 "
#: template/dashboard.php
msgid "Bridged AP mode is enabled. For Hostname and IP, see your router's admin page."
msgstr "브릿지(Bridged) AP 모드가 활성화되었습니다. 호스트 이름 및 IP는 라우터의 관리 페이지를 참조하십시오."
msgstr ""
#: common form controls
msgid "Save settings"
@ -1092,9 +958,6 @@ msgstr "작동"
msgid "down"
msgstr "다운"
msgid "Clear log"
msgstr "로그 삭제"
msgid "adblock"
msgstr "광고차단(adblock)"
@ -1114,19 +977,19 @@ msgid "Enable blocklists"
msgstr "차단리스트 활성화"
msgid "Enable this option if you want RaspAP to <b>block DNS requests for ads, tracking and other virtual garbage</b>. Blocklists are gathered from multiple, actively maintained sources and automatically updated, cleaned, optimized and moderated on a daily basis."
msgstr "RaspAP가 <b>광고, 추적 및 기타 가상 쓰레기(virtual garbage) 에 대한 DNS 요청을 차단</b>하도록 하려면 이 옵션을 활성화합니다. 차단 목록은 활발하게 유지 관리되는 여러 소스에서 수집되며 매일 자동으로 업데이트, 정리, 최적화 및 조정됩니다."
msgstr ""
msgid "This option adds <code>conf-file</code> and <code>addn-hosts</code> to the dnsmasq configuration."
msgstr "이 옵션은 dnsmasq 구성에 <code>conf-file</code> 및 <code>addn-hosts</code>를 추가합니다."
msgstr ""
msgid "Choose a blocklist provider"
msgstr "차단 목록 공급자를 선택하십시오"
msgstr ""
msgid "Hostnames blocklist last updated"
msgstr "마지막으로 업데이트된 호스트 이름 차단 목록"
msgstr ""
msgid "Domains blocklist last updated"
msgstr "마지막으로 업데이트된 도메인 차단 목록(blocklist)"
msgstr ""
msgid "Update now"
msgstr "지금 업데이트 시작"
@ -1135,70 +998,70 @@ msgid "Statistics"
msgstr "통계"
msgid "Information provided by adblock"
msgstr "애드블록에서 제공하는 정보"
msgstr ""
msgid "Enable custom blocklist"
msgstr "사용자 지정 차단 목록(blocklist) 활성화"
msgstr ""
msgid "Define custom hosts to be blocked by entering an IPv4 or IPv6 address followed by any whitespace (spaces or tabs) and the host name."
msgstr "IPv4 또는 IPv6 주소 뒤에 공백(공백 또는 탭) 과 호스트 이름을 입력하여 차단할 사용자 지정 호스트를 정의합니다."
msgstr ""
msgid "<b>IPv4 example:</b> 0.0.0.0 badhost.com"
msgstr "<b>IPv4 예:</b> 0.0.0.0 badhost.com"
msgstr ""
msgid "This option adds an <code>addn-hosts</code> directive to the dnsmasq configuration."
msgstr "이 옵션은 dnsmasq 구성에 <code>addn-hosts</code> 지시문을 추가합니다."
msgstr ""
msgid "Custom blocklist not defined"
msgstr "정의되지 않은 맞춤 차단 목록(blocklist)"
msgstr ""
msgid "Invalid custom IP address found on line "
msgstr "이 행에 잘못된 사용자 정의 IP 주소 발견 "
msgstr ""
msgid "Invalid custom host found on line "
msgstr "이 행에 잘못된 사용자 지정 호스트 주소 발견 "
msgstr ""
msgid "Tunnel settings"
msgstr "터널 설정"
msgstr ""
msgid "Configuration Method"
msgstr "구성 방법"
msgstr ""
msgid "Upload file"
msgstr "파일 업로드"
msgstr ""
msgid "Create manually"
msgstr "수동으로 만들기"
msgstr ""
msgid "Upload a WireGuard config"
msgstr "WireGuard 구성(config) 업로드"
msgstr ""
msgid "This option uploads and installs an existing WireGuard <code>.conf</code> file on this device."
msgstr "이 옵션은 이 장치에 기존 WireGuard <code>.conf</code> 파일을 업로드하고 설치합니다"
msgstr ""
msgid "Apply iptables rules for AP interface"
msgstr "AP 인터페이스에 iptables 규칙 적용"
msgstr ""
msgid "Recommended if you wish to forward network traffic from the wg0 interface to clients connected on the AP interface."
msgstr "wg0 인터페이스에서 AP 인터페이스에 연결된 클라이언트로 네트워크 트래픽을 전달하려는 경우에 권장됩니다."
msgstr ""
msgid "This option adds <strong>iptables</strong> <code>Postup</code> and <code>PostDown</code> rules for the configured AP interface (%s)."
msgstr "이 옵션은 구성된 AP 인터페이스(%s) 에 대한 <strong>iptables</strong> <code>Postup</code> 및 <code>PostDown</code> 규칙을 추가합니다."
msgstr ""
msgid "Select WireGuard configuration file (.conf)"
msgstr "WireGuard 구성 파일(.conf) 선택"
msgstr ""
msgid "Create a local WireGuard config"
msgstr "로컬 WireGuard 구성 만들기"
msgstr ""
msgid "Enable server"
msgstr "활성화된 서버"
msgid "Enable this option to secure network traffic by creating an encrypted tunnel between RaspAP and configured peers."
msgstr "RaspAP와 구성된 피어 간에 암호화된 터널을 생성하여 네트워크 트래픽을 보호하려면 이 옵션을 활성화합니다."
msgstr ""
msgid "This setting generates a new WireGuard <code>.conf</code> file on this device."
msgstr "이 설정은 이 장치에서 새 WireGuard <code>.conf</code> 파일을 생성합니다."
msgstr ""
msgid "Local public key"
msgstr "로컬 공개키(public Key)"
@ -1219,34 +1082,34 @@ msgid "Enable peer"
msgstr "활성화된 피어"
msgid "Enable this option to encrypt traffic by creating a tunnel between RaspAP and this peer."
msgstr "RaspAP와 이 피어 사이에 터널을 만들어 트래픽을 암호화하려면 이 옵션을 활성화합니다."
msgstr ""
msgid "This option adds <code>client.conf</code> to the WireGuard configuration."
msgstr "이 옵션은 WireGuard 구성에 <code>client.conf</code>를 추가합니다."
msgstr ""
msgid "Peer public key"
msgstr "피어 공개키(Public Key)"
msgid "Endpoint address"
msgstr "끝점(Endpoint) 주소"
msgstr ""
msgid "Allowed IPs"
msgstr "허용된 IP"
msgstr ""
msgid "Persistent keepalive"
msgstr "지속적 연결 유지(Persistent keepalive)"
msgstr ""
msgid "Enable this option to display an updated <code>wg-quick</code> debug log."
msgstr "업데이트된 <code>wg-quick</code> 디버그 로그를 표시하려면 이 옵션을 활성화하십시오."
msgstr ""
msgid "WireGuard debug log updated"
msgstr "WireGuard 디버그 로그 업데이트됨"
msgstr ""
msgid "Scan this QR code with your client to connect to this tunnel"
msgstr "클라이언트로 이 QR 코드를 스캔하여 이 터널에 연결하세요."
msgstr ""
msgid "or download the <code>client.conf</code> file to your device."
msgstr "또는 <code>client.conf</code> 파일을 장치에 다운로드하십시오."
msgstr ""
msgid "Download"
msgstr "다운로드"
@ -1258,176 +1121,86 @@ msgid "Stop WireGuard"
msgstr "WireGuard 정지"
msgid "Information provided by wireguard"
msgstr "wireguard에서 제공하는 정보"
msgstr ""
msgid "Attempting to start WireGuard"
msgstr "WireGuard 시작 시도 중입니다"
msgstr ""
msgid "Attempting to stop WireGuard"
msgstr "WireGuard 중지 시도 중입니다"
msgstr ""
msgid "WireGuard configuration updated successfully"
msgstr "WireGuard 구성이 성공적으로 업데이트되었습니다."
msgstr ""
msgid "WireGuard configuration failed to be updated"
msgstr "WireGuard 구성을 업데이트하지 못했습니다."
msgid "Enable kill switch"
msgstr "킬 스위치 활성화"
msgid "This option adds <strong>iptables</strong> <code>PostUp</code> and <code>PreDown</code> rules for the configured AP interface (%s)."
msgstr "이 옵션은 구성된 AP 인터페이스 (%s) 에 대한 <strong>iptables</strong> <code>PostUp</code> 및 <code>PreDown</code> 규칙을 추가합니다."
msgid "Recommended if you wish to prevent the flow of unencrypted packets through non-WireGuard interfaces."
msgstr "WireGuard가 아닌 인터페이스를 통해 암호화되지 않은 패킷의 흐름을 방지하려는 경우 권장됩니다."
msgid "iptables rules added to WireGuard configuration"
msgstr "WireGuard 구성에 iptables 규칙이 추가되었습니다."
msgid "Existing iptables rules found in WireGuard configuration - not added"
msgstr "WireGuard 구성에서 발견된 기존 iptables 규칙 - 추가되지 않음"
msgstr ""
msgid "Client Firewall"
msgstr "클라이언트 방화벽"
msgstr ""
msgid "Firewall is ENABLED"
msgstr "방화벽이 활성화됨"
msgstr ""
msgid "Firewall is OFF"
msgstr "방화벽이 꺼져 있습니다."
msgstr ""
msgid "The default firewall will only allow outgoing and already established traffic."
msgstr "기본 방화벽은 나가는 트래픽과 이미 설정된 트래픽만 허용합니다."
msgstr ""
msgid "No incoming UDP traffic is allowed."
msgstr "수신 UDP 트래픽이 허용되지 않습니다."
msgstr ""
msgid "There are no restrictions for the access point <code>%s</code>."
msgstr "액세스 포인트 <code>%s</code>에 대한 제한이 없습니다."
msgstr ""
msgid "Exception: Service"
msgstr "예외: 서비스"
msgstr ""
msgid "allow SSH access on port 22"
msgstr "포트 22에서 SSH 액세스 허용"
msgstr ""
msgid "allow access to the RaspAP GUI on port 80 or 443"
msgstr "포트 80 또는 443에서 RaspAP GUI에 대한 액세스 허용"
msgstr ""
msgid "Allow incoming connections for some services from the internet side."
msgstr "인터넷 측에서 일부 서비스에 대한 수신 연결을 허용합니다."
msgstr ""
msgid "Exception: network device"
msgstr "예외: 네트워크 장치"
msgstr ""
msgid "Exclude device(s)"
msgstr "장치 제외"
msgstr ""
msgid "Exclude the given network device(s) (separated by a blank or comma) from firewall rules."
msgstr "방화벽 규칙에서 지정된 네트워크 장치(공백 또는 쉼표로 구분) 를 제외합니다."
msgstr ""
msgid "Current client devices: <code>%s</code>"
msgstr "현재 클라이언트 장치: <code>%s</code>"
msgstr ""
msgid "The access point <code>%s</code> is per default excluded."
msgstr "액세스 포인트 <code>%s</code>는 기본적으로 제외됩니다."
msgstr ""
msgid "Exception: IP-Address"
msgstr "예외: IP 주소"
msgstr ""
msgid "Allow incoming connections from"
msgstr "다음에서 들어오는 연결 허용"
msgstr ""
msgid "For the given IP-addresses (separated by a blank or comma) the incoming connection (via TCP and UDP) is accepted."
msgstr "지정된 IP 주소(공백 또는 쉼표로 구분) 에 대해 들어오는 연결(TCP 및 UDP를 통해) 이 허용됩니다."
msgstr ""
msgid "This is required for an OpenVPN via UDP or Wireguard connection."
msgstr "이는 UDP 또는 Wireguard 연결을 통한 OpenVPN에 필요합니다."
msgstr ""
msgid "The list of configured VPN server IP addresses: <code><b>%s</b></code>"
msgstr "구성된 VPN 서버 IP 주소 목록: <code><b>%s</b></code>"
msgstr ""
msgid "Disable Firewall"
msgstr "방화벽 비활성화"
msgstr ""
msgid "Enable Firewall"
msgstr "방화벽 활성화"
msgstr ""
msgid "Apply changes"
msgstr "변경 사항을 적용합니다"
msgid "Dynamic DNS"
msgstr "동적 DNS"
msgid "Service provider"
msgstr "서비스 제공 업체"
msgid "Select a Dynamic DNS service supported by <strong>ddclient</strong> from the list below. Selecting a known service provider will populate the <code>protocol</code> and <code>server</code> fields. You may also configure the service manually."
msgstr "아래 목록에서 <strong>ddclient</strong>가 지원하는 동적 DNS 서비스를 선택하세요. 알려진 서비스 제공업체를 선택하면 <code>프로토콜</code> 및 <code>서버</code> 필드가 채워집니다. 서비스를 수동으로 구성할 수도 있습니다."
msgid "Method to obtain IP"
msgstr "IP를 얻는 방법"
msgid "Select the method used by <strong>ddclient</strong> to obtain an IP address. This value is specified in the <code>-use</code> option."
msgstr "IP 주소를 얻기 위해 <strong>ddclient</strong>에서 사용하는 방법을 선택하세요. 이 값은 <code>-use</code> 옵션에 지정됩니다."
msgid "Discovery page on the web"
msgstr "웹의 검색 페이지"
msgid "Network interface"
msgstr "네트워크 인터페이스"
msgid "Network address"
msgstr "네트워크 주소"
msgid "Firewall status page"
msgstr "방화벽 상태 페이지"
msgid "External command"
msgstr "외부 명령"
msgid "Web address"
msgstr "웹 주소"
msgid "Firewall"
msgstr "방화벽"
msgid "Command"
msgstr "명령어"
msgid "Example: <code>192.168.1.254/status.htm</code>."
msgstr "예제: <code>192.168.1.254/status.htm</code>."
msgid "Example: <code>/usr/local/bin/get-ip</code>."
msgstr "예제: <code>/usr/local/bin/get-ip</code>."
msgid "Domain"
msgstr "도메인"
msgid "Enable SSL"
msgstr "SSL 활성화"
msgid "Use an encrypted SSL connection for updates. Not supported by all providers."
msgstr "업데이트에는 암호화된 SSL 연결을 사용하십시오. 모든 공급자가 지원하지는 않습니다."
msgid "Value specified in milliseconds (ms). Default is 300."
msgstr "밀리초(ms) 단위로 지정된 값입니다. 기본값은 300입니다."
msgid "Use the <strong>Generate log</strong> button to output detailed <code>ddclient daemon</code> debug info"
msgstr "<strong>로그 생성</strong> 버튼을 사용하여 자세한 <code>ddclient daemon</code> 디버그 정보를 출력하세요."
msgid "Generate log"
msgstr "로그 생성하기"
msgid "Information provided by ddclient"
msgstr "ddclient에서 제공하는 정보"
msgid "Start Dynamic DNS"
msgstr "동적 DNS 시작"
msgid "Stop Dynamic DNS"
msgstr "동적 DNS 중지"
msgid "Restart Dynamic DNS"
msgstr "동적 DNS 다시 시작"
msgstr ""

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -844,7 +844,7 @@ msgstr "Configurații"
msgid "Currently available OpenVPN client configurations are displayed below."
msgstr "Configurațiile clientului OpenVPN disponibile sunt afișate mai jos."
msgid "Activating a configuration will restart the <code>openvpn-client</code> service."
msgid "Activating a configuraton will restart the <code>openvpn-client</code> service."
msgstr "Activarea unei configurații va reporni serviciul <code>openvpn-client</code>."
msgid "Delete OpenVPN client"

Binary file not shown.

File diff suppressed because it is too large Load Diff

19
raspap.php Executable file
View File

@ -0,0 +1,19 @@
<?php
function getConfig()
{
$config = array(
'admin_user' => 'admin',
'admin_pass' => '$2y$10$YKIyWAmnQLtiJAy6QgHQ.eCpY4m.HCEbiHaTgN6.acNC6bDElzt.i'
);
if (file_exists(RASPI_CONFIG . '/raspap.auth')) {
if ($auth_details = fopen(RASPI_CONFIG . '/raspap.auth', 'r')) {
$config['admin_user'] = trim(fgets($auth_details));
$config['admin_pass'] = trim(fgets($auth_details));
fclose($auth_details);
}
}
return $config;
}

View File

@ -1,136 +0,0 @@
<?php
/**
* Authentication class
*
* @description Basic HTTP authentication class for RaspAP
* @author Bill Zimmerman <billzimmerman@gmail.com>
* @license https://github.com/raspap/raspap-webgui/blob/master/LICENSE
* @see https://www.php.net/manual/en/features.http-auth.php
*/
declare(strict_types=1);
namespace RaspAP\Auth;
class HTTPAuth
{
/**
* @var string $realm
*/
public $realm = 'Authentication Required';
/**
* Stored login credentials
* @var array $auth_config
*/
protected $auth_config;
/**
* Default login credentials
* @var array $auth_default
*/
private $auth_default = array(
'admin_user' => 'admin',
'admin_pass' => '$2y$10$YKIyWAmnQLtiJAy6QgHQ.eCpY4m.HCEbiHaTgN6.acNC6bDElzt.i'
);
// Constructor
public function __construct()
{
$this->auth_config = $this->getAuthConfig();
}
/*
* Determines if user is logged in
* return boolean
*/
public function isLogged()
{
return isset($_SESSION['user_id']);
}
/*
* Authenticate a user using HTTP basic auth
*/
public function authenticate()
{
if (!$this->isLogged()) {
header('HTTP/1.0 401 Unauthorized');
header('WWW-Authenticate: Basic realm="'.$this->realm.'"');
if (function_exists('http_response_code')) {
// http_response_code will respond with proper HTTP version
http_response_code(401);
} else {
header('HTTP/1.0 401 Unauthorized');
}
exit('Not authorized'.PHP_EOL);
}
}
/*
* Attempt to login a user with supplied credentials
* @var string $user
* @var string $pass
* return boolean
*/
public function login(string $user, string $pass)
{
if ($this->isValidCredentials($user, $pass)) {
$_SESSION['user_id'] = $user;
return true;
}
return false;
}
/*
* Gets the current authentication config
* return array $config
*/
public function getAuthConfig()
{
$config = $this->auth_default;
if (file_exists(RASPI_CONFIG . '/raspap.auth')) {
if ($auth_details = fopen(RASPI_CONFIG . '/raspap.auth', 'r')) {
$config['admin_user'] = trim(fgets($auth_details));
$config['admin_pass'] = trim(fgets($auth_details));
fclose($auth_details);
}
}
return $config;
}
/*
* Validates a set of credentials
* @var string $user
* @var string $pass
* return boolean
*/
protected function isValidCredentials(string $user, string $pass)
{
return $this->validateUser($user) && $this->validatePassword($pass);
}
/**
* Validates a user
*
* @param string $user
*/
protected function validateUser(string $user)
{
return $user == $this->auth_config['admin_user'];
}
/**
* Validates a password
*
* @param string $pass
*/
protected function validatePassword(string $pass)
{
return password_verify($pass, $this->auth_config['admin_pass']);
}
}

View File

@ -19,9 +19,9 @@
<div class="row">
<div class="col-md-12">
<p id="blocklist-updated">
<div><small><?php echo _("Hostnames blocklist last updated") ?>: <span class="font-weight-bold" id="blocklist-hostnames">
<div><small><?php echo _("Hostnames blocklist last updated") ?>: <span class="font-weight-bold" id="notracking-hostnames">
<?php echo blocklistUpdated('hostnames.txt') ?></span></small></div>
<div><small><?php echo _("Domains blocklist last updated") ?>: <span class="font-weight-bold" id="blocklist-domains">
<div><small><?php echo _("Domains blocklist last updated") ?>: <span class="font-weight-bold" id="notracking-domains">
<?php echo blocklistUpdated('domains.txt') ?></b></small></div>
</p>
<div class="input-group col-md-12 mb-4">

View File

@ -21,35 +21,20 @@
</div>
<div class="row">
<div class="form-group col-md-6">
<div class="mb-2"><?php echo _("Old password"); ?></div>
<div class="input-group">
<label for="password"><?php echo _("Old password"); ?></label>
<input type="password" class="form-control" name="oldpass"/>
<div class="input-group-append">
<button class="btn btn-light js-toggle-password" type="button" data-target="[name=oldpass]" data-toggle-with="fas fa-eye-slash"><i class="fas fa-eye mx-2"></i></button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<div class="mb-2"><?php echo _("New password"); ?></div>
<div class="input-group">
<label for="password"><?php echo _("New password"); ?></label>
<input type="password" class="form-control" name="newpass"/>
<div class="input-group-append">
<button class="btn btn-light js-toggle-password" type="button" data-target="[name=newpass]" data-toggle-with="fas fa-eye-slash"><i class="fas fa-eye mx-2"></i></button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<div class="mb-2"><?php echo _("Repeat new password"); ?></div>
<div class="input-group">
<label for="password"><?php echo _("Repeat new password"); ?></label>
<input type="password" class="form-control" name="newpassagain"/>
<div class="input-group-append">
<button class="btn btn-light js-toggle-password" type="button" data-target="[name=newpassagain]" data-toggle-with="fas fa-eye-slash"><i class="fas fa-eye mx-2"></i></button>
</div>
</div>
</div>
</div>
<input type="submit" class="btn btn-outline btn-primary" name="UpdateAdminPassword" value="<?php echo _("Save settings"); ?>" />

110
templates/firewall.php Executable file
View File

@ -0,0 +1,110 @@
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col">
<i class="fas fa-shield-alt mr-2"></i><?php echo _("Firewall"); ?>
</div>
</div><!-- /.row -->
</div><!-- /.card-header -->
<div class="card-body">
<?php $status->showMessages(); ?>
<h4><?php echo _("Client Firewall"); ?></h4>
<?php if ( $fw_conf["firewall-enable"]) : ?>
<i class="fas fa-circle mr-2 service-status-up"></i><?php echo _("Firewall is ENABLED"); ?>
<?php else : ?>
<i class="fas fa-circle mr-2 service-status-down"></i><?php echo _("Firewall is OFF"); ?>
<?php endif ?>
<div class="row">
<div class="col-md-6">
<p class="mr-2">
<small>
<?php echo _("The default firewall will only allow outgoing and already established traffic."); ?><br />
<?php echo _("No incoming UDP traffic is allowed."); ?><br />
<?php printf(_("There are no restrictions for the access point <code>%s</code>."), $ap_device); ?>
</small>
</p>
</div>
</div>
<form id="frm-firewall" action="firewall_conf" method="POST" >
<?php echo CSRFTokenFieldTag(); ?>
<h5><?php echo _("Exception: Service"); ?></h4>
<div class="row">
<div class="form-group col-md-6">
<div class="custom-control custom-switch">
<input class="custom-control-input" id="ssh-enable" type="checkbox" name="ssh-enable" value="1" aria-describedby="exception-description" <?php if ($fw_conf["ssh-enable"]) echo "checked"; ?> >
<label class="custom-control-label" for="ssh-enable"><?php echo _("allow SSH access on port 22") ?></label>
</div>
<div class="custom-control custom-switch">
<input class="custom-control-input" id="http-enable" type="checkbox" name="http-enable" value="1" aria-describedby="exceptions-description" <?php if ($fw_conf["http-enable"]) echo "checked"; ?> >
<label class="custom-control-label" for="http-enable"><?php echo _("allow access to the RaspAP GUI on port 80 or 443") ?></label>
</div>
<p class="mb-0" id="exceptions-description">
<small><?php echo _("Allow incoming connections for some services from the internet side.") ?></small>
</p>
</div>
</div>
<h5><?php echo _("Exception: network device"); ?></h4>
<div class="row">
<div class="form-group col-md-6">
<label for="excl-device"><?php echo _("Exclude device(s)") ?></label>
<input class="form-control" id="excl-devices" type="text" name="excl-devices" value="<?php echo $fw_conf["excl-devices"] ?>" aria-describedby="exclusion-description" >
<p class="mb-0" id="exclusion-description">
<small>
<?php echo _("Exclude the given network device(s) (separated by a blank or comma) from firewall rules."); ?><br />
<?php printf(_("Current client devices: <code>%s</code>"), $str_clients); ?><br />
<?php printf(_("The access point <code>%s</code> is per default excluded."), $ap_device); ?>
</small>
</p>
</div>
</div>
<h5><?php echo _("Exception: IP-Address"); ?></h4>
<div class="row">
<div class="form-group col-md-6">
<label for="excluded-ips"><?php echo _("Allow incoming connections from") ?></label>
<input class="form-control" id="excluded-ips" type="text" name="excluded-ips" value="<?php echo $fw_conf["excluded-ips"] ?>" aria-describedby="excl-ips-description" >
<p class="mb-0" id="excl-ips-description">
<small>
<?php echo _("For the given IP-addresses (separated by a blank or comma) the incoming connection (via TCP and UDP) is accepted."); ?><br />
<?php echo _("This is required for an OpenVPN via UDP or Wireguard connection."); ?><br />
<?php if ( !empty($vpn_ips) ) printf (_("The list of configured VPN server IP addresses: <code><b>%s</b></code>"), $vpn_ips); ?>
</small>
</p>
</div>
</div>
<?php if ($fw_conf["firewall-enable"]) : ?>
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Apply changes"); ?>" name="apply-firewall" />
<input type="submit" class="btn btn-warning firewall-apply" value="<?php echo _("Disable Firewall") ?>" name="firewall-disable" data-toggle="modal" data-target="#firewallModal"/>
<?php else : ?>
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="save-firewall" />
<input type="submit" class="btn btn-success firewall-apply" value="<?php echo _("Enable Firewall") ?>" name="firewall-enable" data-toggle="modal" data-target="#firewallModal"/>
<?php endif ?>
</form>
</div><!-- /.card-body -->
<div class="card-footer"></div>
</div><!-- /.card -->
</div><!-- /.col-lg-12 -->
</div><!-- /.row -->
<!-- Modal -->
<div class="modal fade" id="firewallModal" 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="fas fa-sync-alt mr-2"></i><?php echo _("Executing firewall option") ?>
</div>
</div>
<div class="modal-body">
<div class="col-md-12 mb-3 mt-1">
<?php if($fw_conf["firewall-enable"]) echo _("Disabling firewall").'...'; else echo _("Enabling firewall").'...'; ?>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline btn-primary" data-dismiss="modal"><?php echo _("Close"); ?></button>
</div>
</div>
</div>
</div>

View File

@ -4,7 +4,7 @@
<h4 class="mt-3 mb-3"><?php echo _("Configurations"); ?></h4>
<p id="openvpnconfigs-description" class="mb-3">
<small><?php echo _("Currently available OpenVPN client configurations are displayed below.") ?></small>
<br><small class="text-muted"><?php echo _("Activating a configuration will restart the <code>openvpn-client</code> service.") ?></small>
<br><small class="text-muted"><?php echo _("Activating a configuraton will restart the <code>openvpn-client</code> service.") ?></small>
</p>
<div class="openvpn-configs js-openvpn-configs-container">
<?php foreach ($clients as $client) :

View File

@ -52,39 +52,3 @@
</div>
</div>
<!-- modal confirm-reboot-->
<div class="modal fade" id="system-confirm-reboot" 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="fas fa-sync mr-2"></i><?php echo _("System reboot"); ?></div>
</div>
<div class="modal-body">
<div class="col-md-12 mb-3 mt-1" id="system-reboot-message"><?php echo _("Reboot now? The system will be temporarily unavailable."); ?></div>
</div>
<div class="modal-footer">
<button type="button" data-message="<?php echo _("Close"); ?>" class="btn btn-outline-secondary" data-dismiss="modal"><?php echo _("Cancel"); ?></button>
<button type="button" id="js-sys-reboot" data-action="reboot" class="btn btn-outline-danger btn-delete"><?php echo _("Reboot"); ?></button>
</div>
</div>
</div>
</div>
<!-- modal confirm-shutdown-->
<div class="modal fade" id="system-confirm-shutdown" 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="fas fa-power-off mr-2"></i><?php echo _("System shutdown"); ?></div>
</div>
<div class="modal-body">
<div class="col-md-12 mb-3 mt-1" id="system-reboot-message"><?php echo _("Shutdown now? The system will be unavailable."); ?></div>
</div>
<div class="modal-footer">
<button type="button" data-message="<?php echo _("Close"); ?>" class="btn btn-outline-secondary" data-dismiss="modal"><?php echo _("Cancel"); ?></button>
<button type="button" id="js-sys-shutdown" data-action="shutdown" class="btn btn-outline-danger btn-delete"><?php echo _("Shutdown"); ?></button>
</div>
</div>
</div>
</div>

View File

@ -14,7 +14,7 @@ include('includes/sysstats.php');
<div class="info-item col-xs-3"><?php echo _("Hostname"); ?></div><div class="info-value col-xs-3"><?php echo htmlspecialchars($hostname, ENT_QUOTES); ?></div>
</div>
<div class="row mb-1">
<div class="info-item col-xs-3"><?php echo _("Pi Revision"); ?></div><div class="info-value col-xs-3"><?php echo htmlspecialchars($revision, ENT_QUOTES); ?></div>
<div class="info-item col-xs-3"><?php echo _("Pi Revision"); ?></div><div class="info-value col-xs-3"><?php echo htmlspecialchars(RPiVersion(), ENT_QUOTES); ?></div>
</div>
<div class="row mb-1">
<div class="info-item col-xs-3"><?php echo _("OS"); ?></div><div class="info-value col-xs-3"><?php echo htmlspecialchars($os, ENT_QUOTES); ?></div>
@ -55,8 +55,8 @@ include('includes/sysstats.php');
<form action="system_info" method="POST">
<?php echo CSRFTokenFieldTag() ?>
<?php if (!RASPI_MONITOR_ENABLED) : ?>
<input type="button" class="btn btn-warning" data-toggle="modal" data-target="#system-confirm-reboot" value="<?php echo _("Reboot"); ?>" />
<input type="button" class="btn btn-warning" data-toggle="modal" data-target="#system-confirm-shutdown" value="<?php echo _("Shutdown"); ?>" />
<input type="submit" class="btn btn-warning" name="system_reboot" value="<?php echo _("Reboot"); ?>" />
<input type="submit" class="btn btn-warning" name="system_shutdown" value="<?php echo _("Shutdown"); ?>" />
<?php endif ?>
<button type="button" onClick="window.location.reload();" class="btn btn-outline btn-primary"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh") ?></a>
</form>