Compare commits

...

36 Commits

Author SHA1 Message Date
billz 81875fae10 Update release version 2023-10-09 08:59:20 +02:00
Bill Zimmerman 509af62586
Merge pull request #1411 from RaspAP/fix/wpa-passphrase
Correctly handle 64 hex digit passkey
2023-10-09 08:43:22 +02:00
Bill Zimmerman c331ef9aaf
Merge pull request #1412 from RaspAP/fix/sys-functions
Ajaxifies system reboot + shutdown
2023-10-09 08:42:34 +02:00
Bill Zimmerman 03118b9918
Merge pull request #1409 from RaspAP/maint/blocklists
Replaces ad block no-tracking lists w/ new sources
2023-10-08 20:30:59 +02:00
billz c208ad9357 Add modal dialogs for system reboot/shutdown 2023-10-08 19:54:56 +02:00
billz bd506f6831 Update system msgs + compile .mo 2023-10-08 19:54:26 +02:00
billz 21f703b5a9 Ajaxify system reboot/shutdown 2023-10-08 19:21:43 +02:00
billz ff3f6ddb90 fwrite priority to wpa network if defined 2023-10-08 11:49:56 +02:00
billz deac75af89 Fix: handle 64 char passkey in absence of 8-63 char passhprase 2023-10-08 11:46:12 +02:00
billz a0ff530318 Replace notracking w/ updated blocklist host + domain lists 2023-10-06 14:43:28 +02:00
billz 2e8d2b1e16 Update adblock logging regex 2023-10-06 14:42:33 +02:00
billz 911a6a3145 Update template blocklist ids + cbxblocklist option val 2023-10-06 14:41:55 +02:00
billz 104b8c340c Update set local file timestamp to when it was downloaded 2023-10-06 14:40:16 +02:00
billz 3e491c17f4 Update fetch remote blocklists 2023-10-06 10:58:54 +02:00
billz 1f5d4b0830 Replace notracking lists w/ alternatives 2023-10-06 09:11:13 +02:00
billz 2ac5f94594 Hotfix: delete _move_config_file (obsolete) 2023-10-02 15:12:39 +01:00
billz 2270fe4953 Update release version 2023-10-02 10:22:57 +01:00
Bill Zimmerman f11dbb1b28
Merge pull request #1404 from RaspAP/maint/translations
Updates ko_KR and pt_BR locales
2023-10-02 11:19:33 +02:00
billz 1e0405a91e Update pt_BR locale 100% - thanks @Osuppa 2023-10-02 10:11:41 +01:00
billz 5028c7aa0a Update ko_KR locale 100% - thanks @dansunmi 2023-10-02 10:09:36 +01:00
Bill Zimmerman 10637efee3
Merge pull request #1395 from RaspAP/security/sanitize-ajax-posts
Sanitize post with escapeshellcmd()
2023-09-17 07:44:34 -07:00
billz e87e7d1d3a Sanitize post with escapeshellcmd() 2023-09-17 16:33:23 +02:00
Bill Zimmerman 3575d1d185
Merge pull request #1394 from RaspAP/fix/theme-select
Fix theme select for material variants
2023-09-17 07:24:42 -07:00
billz a4e8beabdf Fix theme select for material variants 2023-09-17 10:38:01 +02:00
Bill Zimmerman 4f2a43365b
Merge pull request #1393 from RaspAP/maint/authenticate
Refactors existing auth mechanism
2023-09-16 05:12:34 -07:00
billz 33c596189d Apply autoloader support for status messages 2023-09-16 11:46:11 +02:00
billz 07b950cf65 Migrate includes/status_message.php to RaspAP/Messages 2023-09-16 11:43:40 +02:00
billz c2d740ef44 Implement PSR-4 compliant class autoloader 2023-09-16 10:43:05 +02:00
billz 93166171db Update additional ajax posts w/ csrf_token 2023-09-16 10:39:14 +02:00
billz 0116d87445 Create loadFooterScripts(), update page_actions + formatting 2023-09-15 20:02:37 +02:00
billz 66b3b20bf4 Update ajax post data w/ csrf_token 2023-09-14 19:56:36 +02:00
billz 8ff2a89cac Update sidebar items, formatting + bump reported php-cgi version 2023-09-14 19:47:37 +02:00
billz f9d27e3bae Reorg index components into includes 2023-09-14 15:14:02 +02:00
billz 8044bc8cb1 Minor: untabify 2023-09-13 21:45:12 +02:00
billz 1347cd7bfa Swap fas hide/show icons 2023-09-13 21:34:12 +02:00
billz 1e5ac9b3fc Apply patch from RaspAP/raspap-insiders#209 2023-09-13 21:26:19 +02:00
49 changed files with 1303 additions and 1073 deletions

1
.gitignore vendored
View File

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

View File

@ -1,5 +1,5 @@
![](https://i.imgur.com/xeKD93p.png)
[![Release 2.9.4](https://img.shields.io/badge/release-v2.9.4-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.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)
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,21 +4,50 @@ require '../../includes/csrf.php';
require_once '../../includes/config.php';
if (isset($_POST['blocklist_id'])) {
$blocklist_id = $_POST['blocklist_id'];
$notracking_url = "https://raw.githubusercontent.com/notracking/hosts-blocklists/master/";
$blocklist_id = escapeshellcmd($_POST['blocklist_id']);
switch ($blocklist_id) {
case "notracking-hostnames":
$file = "hostnames.txt";
break;
case "notracking-domains":
$file = "domains.txt";
break;
case "StevenBlack/hosts \(default\)":
$list_url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts";
$dest_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";
break;
}
$blocklist = $notracking_url . $file;
$blocklist = $list_url . $dest_file;
$dest = substr($dest_file, 0, strrpos($dest_file, "."));
exec("sudo /etc/raspap/adblock/update_blocklist.sh $blocklist $file " .RASPI_ADBLOCK_LISTPATH, $return);
$jsonData = ['return'=>$return];
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']];
echo json_encode($jsonData);
}

View File

@ -3,12 +3,6 @@
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

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

View File

@ -0,0 +1,21 @@
<?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,3 +228,8 @@ button > i.fas {
pointer-events: none;
}
.close {
font-weight: 400;
font-size: 1.3rem;
}

View File

@ -18,7 +18,8 @@ function createNetmaskAddr(bitCount) {
}
function loadSummary(strInterface) {
$.post('ajax/networking/get_ip_summary.php',{interface:strInterface},function(data){
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/networking/get_ip_summary.php',{'interface': strInterface, 'csrf_token': csrfToken},function(data){
jsonData = JSON.parse(data);
if(jsonData['return'] == 0) {
$('#'+strInterface+'-summary').html(jsonData['output'].join('<br />'));
@ -122,21 +123,24 @@ $(document).on("click", "#gen_wpa_passphrase", function(e) {
});
$(document).on("click", "#js-clearhostapd-log", function(e) {
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/hostapd.log'},function(data){
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/hostapd.log', 'csrf_token': csrfToken},function(data){
jsonData = JSON.parse(data);
$("#hostapd-log").val("");
});
});
$(document).on("click", "#js-cleardnsmasq-log", function(e) {
$.post('ajax/logging/clearlog.php?',{'logfile':'/var/log/dnsmasq.log'},function(data){
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/logging/clearlog.php?',{'logfile':'/var/log/dnsmasq.log', 'csrf_token': csrfToken},function(data){
jsonData = JSON.parse(data);
$("#dnsmasq-log").val("");
});
});
$(document).on("click", "#js-clearopenvpn-log", function(e) {
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/openvpn.log'},function(data){
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/openvpn.log', 'csrf_token': csrfToken},function(data){
jsonData = JSON.parse(data);
$("#openvpn-log").val("");
});
@ -286,7 +290,8 @@ $('#configureClientModal').on('shown.bs.modal', function (e) {
$('#ovpn-confirm-delete').on('click', '.btn-delete', function (e) {
var cfg_id = $(this).data('recordId');
$.post('ajax/openvpn/del_ovpncfg.php',{'cfg_id':cfg_id},function(data){
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/openvpn/del_ovpncfg.php',{'cfg_id':cfg_id, 'csrf_token': csrfToken},function(data){
jsonData = JSON.parse(data);
$("#ovpn-confirm-delete").modal('hide');
var row = $(document.getElementById("openvpn-client-row-" + cfg_id));
@ -303,7 +308,8 @@ $('#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');
$.post('ajax/openvpn/activate_ovpncfg.php',{'cfg_id':cfg_id},function(data){
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/openvpn/activate_ovpncfg.php',{'cfg_id':cfg_id, 'csrf_token': csrfToken},function(data){
jsonData = JSON.parse(data);
$("#ovpn-confirm-activate").modal('hide');
setTimeout(function(){
@ -348,6 +354,15 @@ $('#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();
});
@ -419,11 +434,12 @@ 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},function(data){
$.post('ajax/networking/get_frequencies.php?',{'interface': iface, 'csrf_token': csrfToken},function(data){
var responseText = JSON.parse(data);
$('#tiphwmode').attr('data-original-title', responseText + '\n' + hwmodeText );
});
@ -434,16 +450,18 @@ function setHardwareModeTooltip() {
* Interface elements are updated to indicate current progress, status.
*/
function updateBlocklist() {
var blocklist_id = $('#cbxblocklist').val();
var opt = $('#cbxblocklist option:selected');
var blocklist_id = opt.val();
var csrfToken = $('meta[name=csrf_token]').attr('content');
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 },function(data){
$.post('ajax/adblock/update_blocklist.php',{ 'blocklist_id':blocklist_id, 'csrf_token': csrfToken},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_id).text("Just now");
$('#blocklist-'+jsonData['list']).text("Just now");
}
})
}
@ -457,7 +475,8 @@ $('.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";
$.post('ajax/networking/get_wgkey.php',{'entity':entity_pub.attr('name') },function(data){
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/networking/get_wgkey.php',{'entity':entity_pub.attr('name'), 'csrf_token': csrfToken},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);

View File

@ -1,6 +1,17 @@
{
"notracking/hosts-blocklist": [
"notracking-hostnames",
"notracking-domains"
]
"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"
]
}

View File

@ -1,6 +1,5 @@
<?php
require_once 'includes/status_messages.php';
require_once 'config.php';
/**
@ -9,7 +8,7 @@ require_once 'config.php';
*/
function DisplayAdBlockConfig()
{
$status = new StatusMessages();
$status = new \RaspAP\Messages\StatusMessage;
$enabled = false;
$custom_enabled = false;
@ -85,7 +84,7 @@ function DisplayAdBlockConfig()
$handle = fopen(RASPI_DHCPCD_LOG, "r");
if ($handle) {
while (($line = fgets($handle)) !== false) {
if (preg_match('/(0.0.0.0)/', $line)) {
if (preg_match('/(is 0.0.0.0)|(using only locally-known addresses)/', $line)) {
$adblock_log .= $line;
}
}

View File

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

View File

@ -1,22 +1,16 @@
<?php
$user = $_SERVER['PHP_AUTH_USER'] ?? "";
$pass = $_SERVER['PHP_AUTH_PW'] ?? "";
require_once RASPI_CONFIG.'/raspap.php';
$config = getConfig();
if (RASPI_AUTH_ENABLED) {
$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);
$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();
} else {
header('HTTP/1.0 401 Unauthorized');
$auth->authenticate();
}
exit('Not authorized'.PHP_EOL);
}
} else {
$validated = true;
}

41
includes/autoload.php Executable file
View File

@ -0,0 +1,41 @@
<?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,6 +1,5 @@
<?php
require_once 'includes/status_messages.php';
require_once 'includes/wifi_functions.php';
/**
@ -9,7 +8,7 @@ require_once 'includes/wifi_functions.php';
*/
function DisplayWPAConfig()
{
$status = new StatusMessages();
$status = new \RaspAP\Messages\StatusMessage;
$networks = [];
getWifiInterface();
@ -78,6 +77,15 @@ 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 StatusMessages();
$status = new \RaspAP\Messages\StatusMessage;
// 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.4',
'RASPI_VERSION' => '2.9.6',
'RASPI_CONFIG_NETWORK' => RASPI_CONFIG.'/networking/defaults.json',
'RASPI_ADMIN_DETAILS' => RASPI_CONFIG.'/raspap.auth',
'RASPI_WIFI_AP_INTERFACE' => 'wlan0',

View File

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

View File

@ -1,368 +0,0 @@
<?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

@ -664,10 +664,18 @@ 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'];
}
@ -680,6 +688,7 @@ function getColorOpt()
$color = "#2b8080";
} else {
$color = $_COOKIE['color'];
setcookie('color', $color);
}
return $color;
}
@ -737,7 +746,7 @@ function validate_host($host)
// @return boolean
function getNightmode()
{
if ($_COOKIE['theme'] == 'lightsout.css') {
if (isset($_COOKIE['theme']) && $_COOKIE['theme'] == 'lightsout.css') {
return true;
} else {
return false;
@ -810,3 +819,15 @@ 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,22 +1,17 @@
<?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 StatusMessages();
$status = new \RaspAP\Messages\StatusMessage;
$system = new \RaspAP\System\Sysinfo;
$operatingSystem = $system->operatingSystem();
$arrConfig = array();

23
includes/navbar.php Executable file
View File

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

View File

@ -1,9 +1,7 @@
<?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();
@ -12,7 +10,7 @@ getWifiInterface();
*/
function DisplayOpenVPNConfig()
{
$status = new StatusMessages();
$status = new \RaspAP\Messages\StatusMessage;
if (!RASPI_MONITOR_ENABLED) {
if (isset($_POST['SaveOpenVPNSettings'])) {
if (isset($_POST['authUser'])) {
@ -109,7 +107,7 @@ function SaveOpenVPNConfig($status, $file, $authUser, $authPassword)
throw new RuntimeException('Invalid parameters');
}
$upload = \RaspAP\Uploader\Upload::factory('ovpn',$tmp_destdir);
$upload = \RaspAP\Uploader\FileUpload::factory('ovpn',$tmp_destdir);
$upload->set_max_file_size(64*KB);
$upload->set_allowed_mime_types(array('ovpn' => 'text/plain'));
$upload->file($file);

52
includes/page_actions.php Executable file
View File

@ -0,0 +1,52 @@
<?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);
}
?>

93
includes/sidebar.php Executable file
View File

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

View File

@ -1,74 +1,14 @@
<?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 StatusMessages();
$status = new \RaspAP\Messages\StatusMessage;
if (isset($_POST['SaveLanguage'])) {
if (isset($_POST['locale'])) {
@ -107,15 +47,6 @@ 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'])) {
@ -134,7 +65,7 @@ function DisplaySystem(&$extraFooterScripts)
// define locales
$arrLocales = getLocales();
#fetch system status variables.
// fetch system status variables
$system = new \RaspAP\System\Sysinfo;
$hostname = $system->hostname();
@ -143,7 +74,8 @@ function DisplaySystem(&$extraFooterScripts)
$os = $system->operatingSystem();
$kernel = $system->kernelVersion();
$systime = $system->systime();
$revision = $system->rpiRevision();
// mem used
$memused = $system->usedMemory();
$memused_status = "primary";
@ -203,6 +135,9 @@ function DisplaySystem(&$extraFooterScripts)
"material-light" => "material-light.php"
];
$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);
@ -215,6 +150,7 @@ function DisplaySystem(&$extraFooterScripts)
"hostname",
"uptime",
"systime",
"revision",
"cores",
"os",
"kernel",

View File

@ -1,7 +1,5 @@
<?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':
if (array_key_exists('passphrase', $network)) {
break;
}
$network['passkey'] = trim($lineArr[1]);
$network['protocol'] = 'WPA';
break;
case '#psk':
$network['protocol'] = 'WPA';
case 'wep_key0': // Untested

View File

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

253
index.php
View File

@ -4,17 +4,17 @@
* Raspbian WiFi Configuration Portal (RaspAP)
*
* Simple AP setup & WiFi management for Debian-based devices.
* Enables use of simple web interface rather than SSH to control WiFi and related services on the Raspberry Pi.
* Enables use of simple web interface rather than SSH to control WiFi and related services on the Raspberry Pi.
* 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.28 installed via apt)
* along with their supporting packages, php7.3 will also need to be enabled.
* php-cgi (version 7.4.33 installed via apt)
* along with their supporting packages, php7.4 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.4
* @version 2.9.6
* @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,15 +47,9 @@ require_once 'includes/openvpn.php';
require_once 'includes/wireguard.php';
require_once 'includes/torproxy.php';
$config = getConfig();
$output = $return = 0;
$page = $_SERVER['PATH_INFO'];
$theme_url = getThemeOpt();
$toggleState = getSidebarState();
$bridgedEnabled = getBridgedState();
?><!DOCTYPE html>
initializeApp();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
@ -86,8 +80,7 @@ $bridgedEnabled = getBridgedState();
<link href="dist/raspap/css/style.css" rel="stylesheet" type="text/css">
<!-- Custom CSS -->
<link href="<?php echo $theme_url; ?>" title="main" rel="stylesheet">
<link href="<?php echo $_SESSION["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">
@ -109,203 +102,30 @@ $bridgedEnabled = getBridgedState();
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Sidebar -->
<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
<?php require_once 'includes/sidebar.php'; ?>
<!-- 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'; ?>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<?php require_once 'includes/page_actions.php'; ?>
</div><!-- /.container-fluid -->
</div><!-- End of Main Content -->
<!-- Footer -->
<footer class="sticky-footer bg-grey-100">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span></span>
</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 -->
<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
$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 -->
<footer class="sticky-footer bg-grey-100">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span></span>
</div>
</div>
</footer>
<!-- End Footer -->
</div><!-- End of Content Wrapper -->
</footer>
<!-- End Footer -->
</div><!-- End of Content Wrapper -->
</div><!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top" style="display: inline;">
@ -330,15 +150,6 @@ $bridgedEnabled = getBridgedState();
<!-- Custom RaspAP JS -->
<script src="app/js/custom.js"></script>
<?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;
}
?>
<?php loadFooterScripts($extraFooterScripts); ?>
</body>
</html>

View File

@ -27,7 +27,8 @@ 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 notracking_url="https://raw.githubusercontent.com/notracking/hosts-blocklists/master/"
readonly blocklist_hosts="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
readonly blocklist_domains="https://big.oisd.nl/dnsmasq"
webroot_dir="/var/www/html"
if [ "$insiders" == 1 ]; then
@ -52,7 +53,6 @@ function _install_raspap() {
_create_hostapd_scripts
_create_lighttpd_scripts
_install_lighttpd_configs
_move_config_file
_default_configuration
_configure_networking
_prompt_install_adblock
@ -339,7 +339,7 @@ function _install_lighttpd_configs() {
# Prompt to install ad blocking
function _prompt_install_adblock() {
_install_log "Configure ad blocking (Beta)"
_install_log "Configure ad blocking"
echo -n "Install ad blocking and enable list management? [Y/n]: "
if [ "$assume_yes" == 0 ]; then
read answer < /dev/tty
@ -355,7 +355,7 @@ function _prompt_install_adblock() {
fi
}
# Download notracking adblock lists and enable option
# Download adblock lists and enable option
function _install_adblock() {
_install_log "Creating ad blocking base configuration (Beta)"
if [ ! -d "$raspap_dir/adblock" ]; then
@ -364,12 +364,12 @@ function _install_adblock() {
fi
if [ ! -f /tmp/hostnames.txt ]; then
echo "Fetching latest hostnames list"
wget ${notracking_url}hostnames.txt -q --show-progress --progress=bar:force -O /tmp/hostnames.txt 2>&1 \
wget ${blocklist_hosts} -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 ${notracking_url}domains.txt -q --show-progress --progress=bar:force -O /tmp/domains.txt 2>&1 \
wget ${blocklist_domains} -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"
@ -561,18 +561,6 @@ 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

View File

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

Binary file not shown.

View File

@ -752,6 +752,18 @@ 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!"

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: 2022-01-05 11:43\n"
"PO-Revision-Date: 2023-09-17 15:33\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 ""
msgstr "Wifi 스테이션을 찾을 수 없습니다."
msgid "Reinitializing wpa_supplicant"
msgstr ""
msgstr "wpa_supplicant 재초기화"
msgid "Click 'Rescan' to search for nearby Wifi stations."
msgstr ""
msgstr "근처 Wifi 스테이션을 검색하려면 '재검색'을 클릭하세요."
msgid "Click 'Reinitialize' to force reinitialize <code>wpa_supplicant</code>."
msgstr ""
msgstr "<code>wpa_supplicant</code>를 강제로 다시 초기화하려면 '재 초기화'를 클릭하십시오."
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 ""
msgstr "클라이언트: 스마트폰(USB 테더링)"
msgid "Smartphone"
msgstr ""
msgstr "스마트폰"
msgid "WiFi"
msgstr ""
msgstr "WiFi"
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 ""
msgstr "필수 실행 기능이 비활성화되었습니다. exec가 php <code>disable_functions</code>에 추가되지 않았는지 확인하십시오."
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 ""
msgstr "WAN IP"
msgid "Web-GUI"
msgstr ""
msgstr "웹-GUI"
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,49 +419,58 @@ 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 ""
msgstr "RaspAP가 <b>아래에 구성된 서버에만 DNS 쿼리를 보내도록</b> 하려면 이 옵션을 활성화하십시오. 기본적으로 RaspAP는 업스트림 DHCP 서버의 이름 서버도 사용합니다."
msgid "This option adds <code>no-resolv</code> to the dnsmasq configuration."
msgstr ""
msgstr "이 옵션은 dnsmasq 구성에 <code>no-resolv</code>를 추가합니다."
msgid "Add upstream DNS server"
msgstr ""
msgstr "업스트림 DNS 서버 추가"
msgid "Format"
msgstr "규격"
msgid "Choose a hosted server"
msgstr ""
msgstr "호스팅 서버 선택"
msgid "Enable these options to log DHCP server activity."
msgstr ""
msgid "Enable these options to log <code>dhcpcd</code> and <code>dnsmasq</code> activity."
msgstr "<code>dhcpcd</code> 및 <code>dnsmasq</code> 활동을 기록하려면 이 옵션을 활성화하세요."
msgid "Log DHCP requests"
msgstr ""
msgstr "DHCP 요청 로그"
msgid "Log DNS queries"
msgstr ""
msgstr "DNS 쿼리 로그"
msgid "Restrict access"
msgstr ""
msgstr "액세스 제한"
msgid "Limit network access to static clients"
msgstr ""
msgstr "정적(static) 클라이언트에 대한 네트워크 액세스 제한"
msgid "Enable this option if you want RaspAP to <b>ignore any clients</b> which are not specified in the static leases list."
msgstr ""
msgstr "RaspAP가 정적 임대 목록에 지정되지 않은 <b>모든 클라이언트를 무시</b>하도록 하려면 이 옵션을 활성화하십시오."
msgid "This option adds <code>dhcp-ignore</code> to the dnsmasq configuration."
msgstr ""
msgstr "이 옵션은 dnsmasq 구성에 <code>dhcp-ignore</code>를 추가합니다."
msgid "Clients with a particular hardware MAC address can always be allocated the same IP address."
msgstr ""
msgstr "특정 하드웨어 MAC 주소를 가진 클라이언트는 항상 동일한 IP 주소를 할당받을 수 있습니다."
msgid "This option adds <code>dhcp-host</code> entries to the dnsmasq configuration."
msgstr ""
msgstr "이 옵션은 dnsmasq 구성에 <code>dhcp-host</code> 항목을 추가합니다."
msgid "This toggles the <code>gateway</code>/<code>nogateway</code> option for this interface in the DHCPCD configuration."
msgstr ""
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 자체로 무선 연결을 관리하는 경우 후크가 원치 않는 연결 이벤트를 생성할 수 있습니다. 이 옵션은 후크를 비활성화합니다."
#: includes/hostapd.php
msgid "Basic"
@ -485,8 +494,8 @@ msgstr "보안 유형 "
msgid "Encryption Type"
msgstr "암호화 유형"
msgid "PSK"
msgstr "PSK (암호키)"
msgid "Pre-shared key (PSK)"
msgstr "사전 공유 키(PSK)"
msgid "Advanced settings"
msgstr "고급 설정 "
@ -555,41 +564,89 @@ 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 ""
msgstr "hostapd의 <code>max_num_sta</code> 옵션을 구성합니다. 기본값 및 최대값은 2007입니다. 비어 있거나 0이면 기본값이 적용됩니다."
msgid "Beacon interval"
msgstr ""
msgstr "비콘 간격"
msgid "Disable <code>disassoc_low_ack</code>"
msgstr ""
msgstr "<code>비활성화</code>"
msgid "Do not disassociate stations based on excessive transmission failures."
msgstr ""
msgstr "과도한 transmission 고장으로 인해 스테이션을 분리하지 마십시오."
msgid "Executing RaspAP service start"
msgstr ""
msgstr "RaspAP 서비스 시작 실행"
msgid "Close"
msgstr "닫기"
msgid "Enable this option to log <code>hostapd</code> activity."
msgstr ""
msgstr "<code>hostapd</code> 활동을 기록하려면 이 옵션을 활성화합니다."
msgid "Transmit power (dBm)"
msgstr ""
msgstr "송신 전력 (dBm)"
msgid "Sets the <code>txpower</code> option for the AP interface and the configured country."
msgstr ""
msgstr "AP 인터페이스 및 구성된 국가에 대한 <code>txpower</code> 옵션을 설정합니다."
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 ""
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 옵션은 호환되는 무선 규제 도메인이 설정될 때까지 비활성화됩니다."
#: includes/networking.php
msgid "Summary"
msgstr "요약 "
msgid "Internet connection"
msgstr ""
msgstr "인터넷 연결"
msgid "Current settings"
msgstr "현재 설정"
@ -619,7 +676,7 @@ msgid "Static IP Options"
msgstr "고정 IP 옵션"
msgid "Metric"
msgstr ""
msgstr "측정항목(Metric)"
msgid "Apply settings"
msgstr "설정 적용"
@ -627,56 +684,95 @@ msgstr "설정 적용"
msgid "Information provided by /sys/class/net"
msgstr "/sys/class/net이 제공한 정보 "
msgid "Network Devices"
msgstr ""
msgid "Devices"
msgstr "디바이스"
msgid "Mobile Data Settings"
msgstr ""
msgid "Diagnostics"
msgstr "진단"
msgid "Properties of network devices"
msgstr ""
msgstr "네트워크 장치의 속성"
msgid "Device"
msgstr ""
msgstr "장치"
msgid "MAC"
msgstr ""
msgstr "맥(MAC)"
msgid "USB vid/pid"
msgstr ""
msgstr "USB vid/pid"
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 ""
msgstr "SIM 카드의 PIN"
msgid "APN Settings (Modem device ppp0)"
msgstr ""
msgstr "APN 설정(모뎀 장치 ppp0)"
msgid "Access Point Name (APN)"
msgstr ""
msgstr "액세스 포인트 이름(APN)"
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 ""
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 "중단"
#: includes/system.php
msgid "System Information"
@ -706,6 +802,9 @@ msgstr "Pi 리비전"
msgid "Uptime"
msgstr "가동시간"
msgid "System Time"
msgstr "시스템 시간"
msgid "Memory Used"
msgstr "사용된 메모리"
@ -730,7 +829,42 @@ msgstr "웹서버 포트"
msgid "Web server bind address"
msgstr "웹서버 바인드 주소"
#: includes/themes.php
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에 적용됩니다."
msgid "Theme settings"
msgstr "테마 설정"
@ -842,22 +976,22 @@ msgid "Configurations"
msgstr "환경설정"
msgid "Currently available OpenVPN client configurations are displayed below."
msgstr ""
msgstr "현재 사용 가능한 OpenVPN 클라이언트 구성이 아래에 표시됩니다."
msgid "Activating a configuration will restart the <code>openvpn-client</code> service."
msgstr ""
msgstr "구성을 활성화하면 <code>openvpn-client</code> 서비스가 다시 시작됩니다."
msgid "Delete OpenVPN client"
msgstr ""
msgstr "OpenVPN 클라이언트 삭제"
msgid "Delete client configuration? This cannot be undone."
msgstr ""
msgstr "클라이언트 구성을 삭제하시겠습니까? 이 취소 할 수 없습니다."
msgid "Activate OpenVPN client"
msgstr ""
msgstr "OpenVPN 클라이언트 활성화"
msgid "Activate client configuration? This will restart the openvpn-client service."
msgstr ""
msgstr "클라이언트 구성을 활성화하시겠습니까? 그러면 openvpn-client 서비스가 다시 시작됩니다."
msgid "Activate"
msgstr "활성화"
@ -866,13 +1000,13 @@ msgid "Cancel"
msgstr "취소"
msgid "Enable this option to log <code>openvpn</code> activity."
msgstr ""
msgstr "<code>openvpn</code> 활동을 기록하려면 이 옵션을 활성화합니다."
msgid "Authentification Method"
msgstr ""
msgstr "인증 방식"
msgid "Username and password"
msgstr ""
msgstr "사용자 이름 및 암호"
msgid "Certificates"
msgstr "인증서"
@ -884,16 +1018,16 @@ msgid "Certificates in the configuration file"
msgstr "인증서의 구성파일"
msgid "RaspAP supports certificates by including them in the configuration file."
msgstr ""
msgstr "RaspAP는 구성 파일에 인증서를 포함하여 인증서를 지원합니다."
msgid "Signing certification authority (CA) certificate (e.g. <code>ca.crt</code>): enclosed in <code>&lt;ca> ... &lt;/ca></code> tags."
msgstr ""
msgstr "서명 인증 기관(CA) 인증서(예: <code>ca.crt</code>): <code>&lt;ca> ... &lt;/ca></code> 태그로 묶입니다."
msgid "Client certificate (public key) (e.g. <code>client.crt</code>): enclosed in <code>&lt;cert> ... &lt;/cert></code> tags."
msgstr ""
msgstr "클라이언트 인증서(공개 키)(예: <code>client.crt</code>): <code>&lt;cert> ... &lt;/cert></code> 태그로 묶입니다."
msgid "Private key of the client certificate (e.g. <code>client.key</code>): enclosed in <code>&lt;key> ... &lt;/key></code> tags."
msgstr ""
msgstr "클라이언트 인증서의 개인 키(예: <code>client.key</code>): <code>&lt;key> ... &lt;/key></code> 태그로 묶입니다."
msgid "Configuration File"
msgstr "설정 파일"
@ -934,7 +1068,7 @@ msgstr "TOR 중지 시도 중입니다 "
#: template/dashboard.php
msgid "Bridged AP mode is enabled. For Hostname and IP, see your router's admin page."
msgstr ""
msgstr "브릿지(Bridged) AP 모드가 활성화되었습니다. 호스트 이름 및 IP는 라우터의 관리 페이지를 참조하십시오."
#: common form controls
msgid "Save settings"
@ -958,6 +1092,9 @@ msgstr "작동"
msgid "down"
msgstr "다운"
msgid "Clear log"
msgstr "로그 삭제"
msgid "adblock"
msgstr "광고차단(adblock)"
@ -977,19 +1114,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 ""
msgstr "RaspAP가 <b>광고, 추적 및 기타 가상 쓰레기(virtual garbage) 에 대한 DNS 요청을 차단</b>하도록 하려면 이 옵션을 활성화합니다. 차단 목록은 활발하게 유지 관리되는 여러 소스에서 수집되며 매일 자동으로 업데이트, 정리, 최적화 및 조정됩니다."
msgid "This option adds <code>conf-file</code> and <code>addn-hosts</code> to the dnsmasq configuration."
msgstr ""
msgstr "이 옵션은 dnsmasq 구성에 <code>conf-file</code> 및 <code>addn-hosts</code>를 추가합니다."
msgid "Choose a blocklist provider"
msgstr ""
msgstr "차단 목록 공급자를 선택하십시오"
msgid "Hostnames blocklist last updated"
msgstr ""
msgstr "마지막으로 업데이트된 호스트 이름 차단 목록"
msgid "Domains blocklist last updated"
msgstr ""
msgstr "마지막으로 업데이트된 도메인 차단 목록(blocklist)"
msgid "Update now"
msgstr "지금 업데이트 시작"
@ -998,70 +1135,70 @@ msgid "Statistics"
msgstr "통계"
msgid "Information provided by adblock"
msgstr ""
msgstr "애드블록에서 제공하는 정보"
msgid "Enable custom blocklist"
msgstr ""
msgstr "사용자 지정 차단 목록(blocklist) 활성화"
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 ""
msgstr "IPv4 또는 IPv6 주소 뒤에 공백(공백 또는 탭) 과 호스트 이름을 입력하여 차단할 사용자 지정 호스트를 정의합니다."
msgid "<b>IPv4 example:</b> 0.0.0.0 badhost.com"
msgstr ""
msgstr "<b>IPv4 예:</b> 0.0.0.0 badhost.com"
msgid "This option adds an <code>addn-hosts</code> directive to the dnsmasq configuration."
msgstr ""
msgstr "이 옵션은 dnsmasq 구성에 <code>addn-hosts</code> 지시문을 추가합니다."
msgid "Custom blocklist not defined"
msgstr ""
msgstr "정의되지 않은 맞춤 차단 목록(blocklist)"
msgid "Invalid custom IP address found on line "
msgstr ""
msgstr "이 행에 잘못된 사용자 정의 IP 주소 발견 "
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 ""
msgstr "WireGuard 구성(config) 업로드"
msgid "This option uploads and installs an existing WireGuard <code>.conf</code> file on this device."
msgstr ""
msgstr "이 옵션은 이 장치에 기존 WireGuard <code>.conf</code> 파일을 업로드하고 설치합니다"
msgid "Apply iptables rules for AP interface"
msgstr ""
msgstr "AP 인터페이스에 iptables 규칙 적용"
msgid "Recommended if you wish to forward network traffic from the wg0 interface to clients connected on the AP interface."
msgstr ""
msgstr "wg0 인터페이스에서 AP 인터페이스에 연결된 클라이언트로 네트워크 트래픽을 전달하려는 경우에 권장됩니다."
msgid "This option adds <strong>iptables</strong> <code>Postup</code> and <code>PostDown</code> rules for the configured AP interface (%s)."
msgstr ""
msgstr "이 옵션은 구성된 AP 인터페이스(%s) 에 대한 <strong>iptables</strong> <code>Postup</code> 및 <code>PostDown</code> 규칙을 추가합니다."
msgid "Select WireGuard configuration file (.conf)"
msgstr ""
msgstr "WireGuard 구성 파일(.conf) 선택"
msgid "Create a local WireGuard config"
msgstr ""
msgstr "로컬 WireGuard 구성 만들기"
msgid "Enable server"
msgstr "활성화된 서버"
msgid "Enable this option to secure network traffic by creating an encrypted tunnel between RaspAP and configured peers."
msgstr ""
msgstr "RaspAP와 구성된 피어 간에 암호화된 터널을 생성하여 네트워크 트래픽을 보호하려면 이 옵션을 활성화합니다."
msgid "This setting generates a new WireGuard <code>.conf</code> file on this device."
msgstr ""
msgstr "이 설정은 이 장치에서 새 WireGuard <code>.conf</code> 파일을 생성합니다."
msgid "Local public key"
msgstr "로컬 공개키(public Key)"
@ -1082,34 +1219,34 @@ msgid "Enable peer"
msgstr "활성화된 피어"
msgid "Enable this option to encrypt traffic by creating a tunnel between RaspAP and this peer."
msgstr ""
msgstr "RaspAP와 이 피어 사이에 터널을 만들어 트래픽을 암호화하려면 이 옵션을 활성화합니다."
msgid "This option adds <code>client.conf</code> to the WireGuard configuration."
msgstr ""
msgstr "이 옵션은 WireGuard 구성에 <code>client.conf</code>를 추가합니다."
msgid "Peer public key"
msgstr "피어 공개키(Public Key)"
msgid "Endpoint address"
msgstr ""
msgstr "끝점(Endpoint) 주소"
msgid "Allowed IPs"
msgstr ""
msgstr "허용된 IP"
msgid "Persistent keepalive"
msgstr ""
msgstr "지속적 연결 유지(Persistent keepalive)"
msgid "Enable this option to display an updated <code>wg-quick</code> debug log."
msgstr ""
msgstr "업데이트된 <code>wg-quick</code> 디버그 로그를 표시하려면 이 옵션을 활성화하십시오."
msgid "WireGuard debug log updated"
msgstr ""
msgstr "WireGuard 디버그 로그 업데이트됨"
msgid "Scan this QR code with your client to connect to this tunnel"
msgstr ""
msgstr "클라이언트로 이 QR 코드를 스캔하여 이 터널에 연결하세요."
msgid "or download the <code>client.conf</code> file to your device."
msgstr ""
msgstr "또는 <code>client.conf</code> 파일을 장치에 다운로드하십시오."
msgid "Download"
msgstr "다운로드"
@ -1121,86 +1258,176 @@ msgid "Stop WireGuard"
msgstr "WireGuard 정지"
msgid "Information provided by wireguard"
msgstr ""
msgstr "wireguard에서 제공하는 정보"
msgid "Attempting to start WireGuard"
msgstr ""
msgstr "WireGuard 시작 시도 중입니다"
msgid "Attempting to stop WireGuard"
msgstr ""
msgstr "WireGuard 중지 시도 중입니다"
msgid "WireGuard configuration updated successfully"
msgstr ""
msgstr "WireGuard 구성이 성공적으로 업데이트되었습니다."
msgid "WireGuard configuration failed to be updated"
msgstr ""
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 규칙 - 추가되지 않음"
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 ""
msgstr "수신 UDP 트래픽이 허용되지 않습니다."
msgid "There are no restrictions for the access point <code>%s</code>."
msgstr ""
msgstr "액세스 포인트 <code>%s</code>에 대한 제한이 없습니다."
msgid "Exception: Service"
msgstr ""
msgstr "예외: 서비스"
msgid "allow SSH access on port 22"
msgstr ""
msgstr "포트 22에서 SSH 액세스 허용"
msgid "allow access to the RaspAP GUI on port 80 or 443"
msgstr ""
msgstr "포트 80 또는 443에서 RaspAP GUI에 대한 액세스 허용"
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 ""
msgstr "현재 클라이언트 장치: <code>%s</code>"
msgid "The access point <code>%s</code> is per default excluded."
msgstr ""
msgstr "액세스 포인트 <code>%s</code>는 기본적으로 제외됩니다."
msgid "Exception: IP-Address"
msgstr ""
msgstr "예외: IP 주소"
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 ""
msgstr "지정된 IP 주소(공백 또는 쉼표로 구분) 에 대해 들어오는 연결(TCP 및 UDP를 통해) 이 허용됩니다."
msgid "This is required for an OpenVPN via UDP or Wireguard connection."
msgstr ""
msgstr "이는 UDP 또는 Wireguard 연결을 통한 OpenVPN에 필요합니다."
msgid "The list of configured VPN server IP addresses: <code><b>%s</b></code>"
msgstr ""
msgstr "구성된 VPN 서버 IP 주소 목록: <code><b>%s</b></code>"
msgid "Disable Firewall"
msgstr ""
msgstr "방화벽 비활성화"
msgid "Enable Firewall"
msgstr ""
msgstr "방화벽 활성화"
msgid "Apply changes"
msgstr ""
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 다시 시작"

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-08-25 09:56\n"
"PO-Revision-Date: 2023-09-17 15:33\n"
"Last-Translator: Bill Zimmerman <billzimmerman@gmail.com>\n"
"Language-Team: Portuguese, Brazilian\n"
"Language: pt_BR\n"
@ -463,6 +463,15 @@ msgstr "Esta opção adiciona entradas <code>dhcp-host</code> na configuração
msgid "This toggles the <code>gateway</code>/<code>nogateway</code> option for this interface in the DHCPCD configuration."
msgstr "Isto alterna a opção <code>de gateway</code>/<code>nogateway</code> para essa interface na configuração do DHCPCD."
msgid "This toggles the <code>nohook wpa_supplicant</code> option for this interface in the DHCPCD configuration."
msgstr "Isso ativa/desativa a opção <code>nohook wpa_supplicant</code> para essa interface na configuração do DHCPCD."
msgid "Disable wpa_supplicant dhcp hook for this interface"
msgstr "Desativar wpa_supplicant dhcp hook para essa interface"
msgid "If you manage wireless connections with wpa_supplicant itself, the hook may create unwanted connection events. This option disables the hook."
msgstr "Se você gerenciar as conexões wireless utilizando o próprio wpa_supplicant, o hook pode criar eventos de conexão indesejados. Essa opção desabilita o hook."
#: includes/hostapd.php
msgid "Basic"
msgstr "Básico"
@ -485,8 +494,8 @@ msgstr "Tipo de Segurança"
msgid "Encryption Type"
msgstr "Tipo de Criptografia"
msgid "PSK"
msgstr "PSK"
msgid "Pre-shared key (PSK)"
msgstr "Chave pré-compartilhada (PSK)"
msgid "Advanced settings"
msgstr "Configurações avançadas"
@ -584,6 +593,39 @@ msgstr "Define a opção <code>txpower</code> para a interface AP e o país conf
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 é uma unidade de nível usada para indicar que uma taxa de potência é expressa em decibéis (dB) com referência a um miliwatt (mW). 30 dBm é igual a 1000 mW, enquanto 0 dBm é igual a 1.25 mW."
msgid "WPA and WPA2"
msgstr "WPA e WPA2"
msgid "WPA2 and WPA3-Personal (transitional mode)"
msgstr "WPA2 e WPA3-Personal (modo de transição)"
msgid "WPA3-Personal (required)"
msgstr "WPA3-Personal (Nesse modo, o suporte ao WPA3 é obrigatório)"
msgid "Enabled (for supported clients)"
msgstr "Habilitado (para clientes suportados)"
msgid "Required (for supported clients)"
msgstr "Necessário (para clientes suportados)"
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 "O 802.11w estende uma forte proteção criptográfica a um conjunto seleto de Robust Management Frames (RMF), incluindo desautenticação, desassociação e certas categorias de Action Management Frames. Colectivamente, isto é conhecido como Management Frame Protection (MFP)."
msgid "Scan this QR code directly or %s %sprint a sign%s for your users."
msgstr "Escaneie esse QR Code diretamente ou %s %simprima uma placa%s para os usuários da rede."
msgid "Printable Wi-Fi sign"
msgstr "Placa imprimível Wi-Fi"
msgid "To connect with your phone or tablet, scan the QR code above with your camera app."
msgstr "Para conectar com o seu telefone ou tablet, escaneie o QR Code acima com o seu app de câmera."
msgid "For other devices, use the login credentials below."
msgstr "Para outros dispositivos, use as informações de login abaixo."
msgid "Network"
msgstr "Rede"
msgid "The selected interface (%s) has support for the 2.4 GHz wireless band only."
msgstr "A interface selecionada (%s) tem suporte apenas para banda sem fio de 2.4 GHz."
@ -642,11 +684,11 @@ msgstr "Aplicar Configurações"
msgid "Information provided by /sys/class/net"
msgstr "Informação Provida por /sys/class/net"
msgid "Network Devices"
msgstr "Dispositivos de Rede"
msgid "Devices"
msgstr "Dispositivos"
msgid "Mobile Data Settings"
msgstr "Configurações de Dados Móveis"
msgid "Diagnostics"
msgstr "Diagnósticos"
msgid "Properties of network devices"
msgstr "Propriedades dos dispositivos de rede"
@ -699,6 +741,39 @@ msgstr "Tabela de roteamento"
msgid "raw output"
msgstr "raw output"
msgid "Speedtest"
msgstr "Teste de velocidade"
msgid "Selecting a server"
msgstr "Selecionando um servidor"
msgid "Privacy"
msgstr "Privacidade"
msgid "Server"
msgstr "Servidor"
msgid "ms"
msgstr "ms"
msgid "Mbps"
msgstr "Mbps"
msgid "Ping"
msgstr "Ping"
msgid "Jitter"
msgstr "Jitter"
msgid "Upload"
msgstr "Upload"
msgid "Start"
msgstr "Iniciar"
msgid "Abort"
msgstr "Interromper"
#: includes/system.php
msgid "System Information"
msgstr "Informação do sistema"
@ -727,6 +802,9 @@ msgstr "Revisão do Pi"
msgid "Uptime"
msgstr "Tempo de atividade"
msgid "System Time"
msgstr "Horário do sistema"
msgid "Memory Used"
msgstr "Memória utilizada"
@ -757,7 +835,36 @@ msgstr "OS [Sistema operacional]"
msgid "Kernel"
msgstr "Kernel"
#: includes/themes.php
msgid "System reset"
msgstr "Resetar sistema"
msgid "Reset RaspAP to its initial configuration? This action cannot be undone."
msgstr "Resetar o RaspAP para a sua configuração inicial? Essa ação não pode ser desfeita."
msgid "Reset complete. Restart the hotspot for the changes to take effect."
msgstr "Restauração completa. Reinicie o hotspot para as mudanças terem efeito."
msgid "System reset in progress..."
msgstr "Restauração do sistema em progresso..."
msgid "Reset"
msgstr "Resetar"
msgid "Restore settings"
msgstr "Restaurar configurações"
msgid "To reset RaspAP to its <a href=\"%s\">initial configuration</a>, click or tap the button below."
msgstr "Para resetar o RaspAP para a sua <a href=\"%s\">configuração original</a>, clique ou toque no botão abaixo."
msgid "Custom files for optional components such as Ad Blocking, WireGuard or OpenVPN will remain on the system."
msgstr "Arquivos personalizados para componentes opcionais, como AdBlock, WireGuard e/ou OpenVPN permanecerão no sistema."
msgid "Perform reset"
msgstr "Executar restauração"
msgid "Restores all access point (AP) service settings to their default values. This applies to hostapd, dhcpcd and dnsmasq."
msgstr "Restaura todas as configurações de serviço do ponto de acesso (AP) para seus valores padrão. Isto aplica-se ao hostapd, dhcpcd e dnsmasq."
msgid "Theme settings"
msgstr "Configurações de tema"
@ -1165,6 +1272,21 @@ msgstr "Configuração do Wireguard atualizada com sucesso"
msgid "WireGuard configuration failed to be updated"
msgstr "A configuração do WireGuard falhou ao ser atualizada"
msgid "Enable kill switch"
msgstr "Ativar kill switch"
msgid "This option adds <strong>iptables</strong> <code>PostUp</code> and <code>PreDown</code> rules for the configured AP interface (%s)."
msgstr "Esta opção adiciona as regras do <strong>iptables</strong>, <code>Postup</code> e <code>PostDown</code> para a interface AP configurada (%s)."
msgid "Recommended if you wish to prevent the flow of unencrypted packets through non-WireGuard interfaces."
msgstr "Recomendado se você quer evitar o fluxo de pacotes não criptografados através de interfaces sem WireGuard."
msgid "iptables rules added to WireGuard configuration"
msgstr "Regras do iptable adicionadas à configuração do WireGuard"
msgid "Existing iptables rules found in WireGuard configuration - not added"
msgstr "Regras do iptable existentes encontradas na configuração do WireGuard - não adicionado"
msgid "Client Firewall"
msgstr "Firewall do Cliente"
@ -1234,3 +1356,78 @@ msgstr "Ativar Firewall"
msgid "Apply changes"
msgstr "Aplicar alterações"
msgid "Dynamic DNS"
msgstr "DNS dinâmico (Dynamic DNS)"
msgid "Service provider"
msgstr "Provedor de serviços"
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 "Selecione um serviço de DNS dinâmico suportado por <strong>ddclient</strong> na lista abaixo. Selecionar um provedor de serviço conhecido preencherá os campos <code>protocolo</code> e <code>servidor</code>. Você também pode configurar o serviço manualmente."
msgid "Method to obtain IP"
msgstr "Método para obter o 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 "Selecione o método usado pelo <strong>ddclient</strong> para obter um endereço IP. Este valor é especificado na opção <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 ""
msgid "Example: <code>/usr/local/bin/get-ip</code>."
msgstr ""
msgid "Domain"
msgstr ""
msgid "Enable SSL"
msgstr ""
msgid "Use an encrypted SSL connection for updates. Not supported by all providers."
msgstr ""
msgid "Value specified in milliseconds (ms). Default is 300."
msgstr ""
msgid "Use the <strong>Generate log</strong> button to output detailed <code>ddclient daemon</code> debug info"
msgstr ""
msgid "Generate log"
msgstr ""
msgid "Information provided by ddclient"
msgstr ""
msgid "Start Dynamic DNS"
msgstr ""
msgid "Stop Dynamic DNS"
msgstr ""
msgid "Restart Dynamic DNS"
msgstr ""

View File

@ -1,19 +0,0 @@
<?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;
}

136
src/RaspAP/Auth/HTTPAuth.php Executable file
View File

@ -0,0 +1,136 @@
<?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

@ -1,5 +1,16 @@
<?php
class StatusMessages
/**
* 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
{
public $messages = array();

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

@ -1,7 +1,7 @@
<?php
/**
* Sytem info class
* System info class
*
* @description System info class for RaspAP
* @author Bill Zimmerman <billzimmerman@gmail.com>
@ -92,5 +92,62 @@ 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,8 +3,6 @@
/**
* 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
@ -14,7 +12,7 @@
namespace RaspAP\Uploader;
class Upload
class FileUpload
{
/**
@ -110,7 +108,7 @@ class Upload
*/
public static function factory($destination, $root = false)
{
return new Upload($destination, $root);
return new FileUpload($destination, $root);
}
/**

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="notracking-hostnames">
<div><small><?php echo _("Hostnames blocklist last updated") ?>: <span class="font-weight-bold" id="blocklist-hostnames">
<?php echo blocklistUpdated('hostnames.txt') ?></span></small></div>
<div><small><?php echo _("Domains blocklist last updated") ?>: <span class="font-weight-bold" id="notracking-domains">
<div><small><?php echo _("Domains blocklist last updated") ?>: <span class="font-weight-bold" id="blocklist-domains">
<?php echo blocklistUpdated('domains.txt') ?></b></small></div>
</p>
<div class="input-group col-md-12 mb-4">

View File

@ -21,20 +21,35 @@
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="password"><?php echo _("Old password"); ?></label>
<input type="password" class="form-control" name="oldpass"/>
<div class="mb-2"><?php echo _("Old password"); ?></div>
<div class="input-group">
<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">
<label for="password"><?php echo _("New password"); ?></label>
<input type="password" class="form-control" name="newpass"/>
<div class="mb-2"><?php echo _("New password"); ?></div>
<div class="input-group">
<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">
<label for="password"><?php echo _("Repeat new password"); ?></label>
<input type="password" class="form-control" name="newpassagain"/>
<div class="mb-2"><?php echo _("Repeat new password"); ?></div>
<div class="input-group">
<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"); ?>" />

View File

@ -1,110 +0,0 @@
<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

@ -52,3 +52,39 @@
</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(RPiVersion(), 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($revision, 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="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"); ?>" />
<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"); ?>" />
<?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>