From a1097988033b1deb52ef53ed7b75fccde2f0ea80 Mon Sep 17 00:00:00 2001 From: Bill Zimmerman Date: Thu, 1 Apr 2021 20:05:54 +0200 Subject: [PATCH 01/11] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6672109..47c5dba5 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,9 @@ configured as an access point as follows: Please [read this](https://docs.raspap.com/issues/) before reporting an issue. ## Join Insiders -RaspAP is free software, but powered by _your_ support. If you find RaspAP useful for your personal or commercial projects, [become an Insider](https://github.com/sponsors/RaspAP/) and get early access to exclusive features in the [Insiders Edition](https://docs.raspap.com/insiders/). +[![](https://i.imgur.com/eml7k0b.png)](https://github.com/sponsors/RaspAP/) + +RaspAP is free software, but powered by _your_ support. If you find RaspAP useful for your personal or commercial projects, [become an Insider](https://github.com/sponsors/RaspAP/) and get early access to [exclusive features](https://docs.raspap.com/insiders/#exclusive-features) in the [Insiders Edition](https://docs.raspap.com/insiders/). A tangible side benefit of sponsorship is that **Insiders** are able to help _steer future development of RaspAP_. This is done through Insiders' team access to discussions, feature requests, issues and more in the private GitHub repository. @@ -168,8 +170,6 @@ This project exists thanks to all the awesome people who [contribute](CONTRIBUTI ### Financial Contributors Development of RaspAP is made possible thanks to a sponsorware release model. This means that new features are first exclusively released to sponsors as part of [**Insiders**](https://github.com/sponsors/RaspAP). -[![](https://i.imgur.com/azMTmuP.png)](https://github.com/sponsors/RaspAP/) - Learn more about [how sponsorship works](https://docs.raspap.com/insiders/#how-sponsorship-works), and how easy it is to get access to Insiders. ## License From b10ee7a98f9620c3c689d1afd435db7a2a55a70a Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Apr 2021 23:35:19 +0100 Subject: [PATCH 02/11] sort interface list for hostapd --- includes/hostapd.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/hostapd.php b/includes/hostapd.php index 43e04bd1..e364dd15 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -27,6 +27,8 @@ function DisplayHostAPDConfig() $arrEncType = array('TKIP' => 'TKIP', 'CCMP' => 'CCMP', 'TKIP CCMP' => 'TKIP+CCMP'); $managedModeEnabled = false; exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces); + sort($interfaces); + exec("iw reg get | awk '/country / { sub(/:/,\"\",$2); print $2 }'", $country_code); if (!RASPI_MONITOR_ENABLED) { From ec3fa1002bb6de76a6a96ff59e3486588b16d755 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Apr 2021 23:00:06 +0100 Subject: [PATCH 03/11] improving layout, text and styles of wifi client box --- app/css/custom.php | 5 +++-- templates/dashboard.php | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/app/css/custom.php b/app/css/custom.php index a4f98d72..6726a0a8 100644 --- a/app/css/custom.php +++ b/app/css/custom.php @@ -119,8 +119,9 @@ i.fa.fa-bars:hover{ } .info-item { - width: 10rem; - float: left; + text-transform: uppercase; + font-size: 0.7em; + color: #858796; } .info-item-xs { diff --git a/templates/dashboard.php b/templates/dashboard.php index ab1d3d8f..a1a2fac4 100755 --- a/templates/dashboard.php +++ b/templates/dashboard.php @@ -35,23 +35,23 @@

-
-
-
-
-
-
-
-
-
-
- -
- -
+
+

+
+

+

+

+

+

+
+
+ +
+ +
+
-
-
+
From b31c4a024dc7869d1ce2968006d27b7513a28173 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Apr 2021 23:03:33 +0100 Subject: [PATCH 04/11] add missing card-title class to headings --- templates/dashboard.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/dashboard.php b/templates/dashboard.php index a1a2fac4..b487edd8 100755 --- a/templates/dashboard.php +++ b/templates/dashboard.php @@ -21,7 +21,7 @@
-

+

@@ -33,7 +33,7 @@
-

+

@@ -57,7 +57,7 @@
-

+

From 1503d8131758c65d21fe34f85211f4e90b1d9f1c Mon Sep 17 00:00:00 2001 From: billz Date: Fri, 2 Apr 2021 17:03:35 +0100 Subject: [PATCH 05/11] Apply styles to themes css --- app/css/hackernews.css | 5 +++-- app/css/lightsout.css | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/css/hackernews.css b/app/css/hackernews.css index 1dbb2e97..37c12272 100644 --- a/app/css/hackernews.css +++ b/app/css/hackernews.css @@ -147,8 +147,9 @@ ul.nav-tabs, .nav-tabs .nav-link { } .info-item { - width: 10rem; - float: left; + text-transform: uppercase; + font-size: 0.7em; + color: #858796; } .info-item-xs { diff --git a/app/css/lightsout.css b/app/css/lightsout.css index c6fb580b..7f38035a 100644 --- a/app/css/lightsout.css +++ b/app/css/lightsout.css @@ -250,8 +250,9 @@ hr { } .info-item { - width: 12rem; - float: left; + text-transform: uppercase; + font-size: 0.7em; + color: #858796; } .info-item-xs { From 41e27cc546d405eabedc07850d266d50ff9de0f6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Apr 2021 23:00:06 +0100 Subject: [PATCH 06/11] improving layout, text and styles of wifi client box --- app/css/custom.php | 5 +++-- templates/dashboard.php | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/app/css/custom.php b/app/css/custom.php index a4f98d72..6726a0a8 100644 --- a/app/css/custom.php +++ b/app/css/custom.php @@ -119,8 +119,9 @@ i.fa.fa-bars:hover{ } .info-item { - width: 10rem; - float: left; + text-transform: uppercase; + font-size: 0.7em; + color: #858796; } .info-item-xs { diff --git a/templates/dashboard.php b/templates/dashboard.php index ab1d3d8f..a1a2fac4 100755 --- a/templates/dashboard.php +++ b/templates/dashboard.php @@ -35,23 +35,23 @@

-
-
-
-
-
-
-
-
-
-
- -
- -
+
+

+
+

+

+

+

+

+
+
+ +
+ +
+
-
-
+
From f2ec732bf0f3f27347d50a3b9214259879395c4e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Apr 2021 23:03:33 +0100 Subject: [PATCH 07/11] add missing card-title class to headings --- templates/dashboard.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/dashboard.php b/templates/dashboard.php index a1a2fac4..b487edd8 100755 --- a/templates/dashboard.php +++ b/templates/dashboard.php @@ -21,7 +21,7 @@
-

+

@@ -33,7 +33,7 @@
-

+

@@ -57,7 +57,7 @@
-

+

From b41821240896d8751c10f1a7fa719b3888ba7488 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 2 Apr 2021 17:18:15 +0100 Subject: [PATCH 08/11] div => p --- templates/dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dashboard.php b/templates/dashboard.php index b487edd8..47443ee8 100755 --- a/templates/dashboard.php +++ b/templates/dashboard.php @@ -37,7 +37,7 @@

-
+

From 8f0ae3b36aa1020d21477e66010c6b2146e7c222 Mon Sep 17 00:00:00 2001 From: glaszig Date: Fri, 2 Apr 2021 19:33:35 -0300 Subject: [PATCH 09/11] fix url rewriting (\?.+) already captures the question mark so it's not needed in the replaced string. this actually made the `page` GET parameter be `?page` because the url wound up being `??page=foo`. --- config/50-raspap-router.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/50-raspap-router.conf b/config/50-raspap-router.conf index c7634436..1c10d26f 100644 --- a/config/50-raspap-router.conf +++ b/config/50-raspap-router.conf @@ -3,7 +3,7 @@ server.modules += ( ) $HTTP["url"] =~ "^/REPLACE_ME/(?!(dist|app|ajax|config)).*" { - url.rewrite-once = ( "^/REPLACE_ME/(.*?)(\?.+)?$"=>"/REPLACE_ME/index.php/$1?$2" ) + url.rewrite-once = ( "^/REPLACE_ME/(.*?)(\?.+)?$"=>"/REPLACE_ME/index.php/$1$2" ) server.error-handler-404 = "/REPLACE_ME/index.php" } From 6196bcd311f1781ebd36fbbc0be918700f251531 Mon Sep 17 00:00:00 2001 From: glaszig Date: Sat, 3 Apr 2021 00:43:42 +0100 Subject: [PATCH 10/11] add 'default route' toggle to network interface configuration ui --- ajax/networking/get_netcfg.php | 2 ++ app/js/custom.js | 1 + includes/dhcp.php | 1 + templates/dhcp/general.php | 12 ++++++++++++ 4 files changed, 16 insertions(+) diff --git a/ajax/networking/get_netcfg.php b/ajax/networking/get_netcfg.php index 2dd330bb..7e7b8fa7 100644 --- a/ajax/networking/get_netcfg.php +++ b/ajax/networking/get_netcfg.php @@ -45,12 +45,14 @@ if (isset($interface)) { preg_match('/static\srouters=(.*)/', $matched[0], $static_routers); preg_match('/static\sdomain_name_server=(.*)/', $matched[0], $static_dns); preg_match('/fallback\sstatic_'.$interface.'/', $matched[0], $fallback); + preg_match('/(?:no)?gateway/', $matched[0], $gateway); $dhcpdata['Metric'] = $metric[1]; $dhcpdata['StaticIP'] = strpos($static_ip[1],'/') ? substr($static_ip[1], 0, strpos($static_ip[1],'/')) : $static_ip[1]; $dhcpdata['SubnetMask'] = cidr2mask($static_ip[1]); $dhcpdata['StaticRouters'] = $static_routers[1]; $dhcpdata['StaticDNS'] = $static_dns[1]; $dhcpdata['FallbackEnabled'] = empty($fallback) ? false: true; + $dhcpdata['DefaultRoute'] = empty($gateway) || $gateway[0] == "gateway"; echo json_encode($dhcpdata); } diff --git a/app/js/custom.js b/app/js/custom.js index 7a885472..13f0db92 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -186,6 +186,7 @@ function loadInterfaceDHCPSelect() { $('#txtsubnetmask').val(jsonData.SubnetMask); $('#txtgateway').val(jsonData.StaticRouters); $('#chkfallback')[0].checked = jsonData.FallbackEnabled; + $('#default-route').prop('checked', jsonData.DefaultRoute); $('#txtrangestart').val(jsonData.RangeStart); $('#txtrangeend').val(jsonData.RangeEnd); $('#txtrangeleasetime').val(jsonData.leaseTime); diff --git a/includes/dhcp.php b/includes/dhcp.php index bc323200..38d69ea5 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -244,6 +244,7 @@ function updateDHCPConfig($iface,$status) $cfg[] = 'profile static_'.$iface; $cfg[] = 'fallback static_'.$iface; } + $cfg[] = $_POST['DefaultRoute'] == '1' ? 'gateway' : 'nogateway'; $dhcp_cfg = file_get_contents(RASPI_DHCPCD_CONFIG); if (!preg_match('/^interface\s'.$iface.'$/m', $dhcp_cfg)) { $cfg[] = PHP_EOL; diff --git a/templates/dhcp/general.php b/templates/dhcp/general.php index 49758696..83bc3504 100644 --- a/templates/dhcp/general.php +++ b/templates/dhcp/general.php @@ -55,6 +55,18 @@
+
+
+
+ + +
+

+ gateway/nogateway option for this interface in the DHCPCD configuration.") ?> +

+
+
+
DHCP options
From 16098c0e96f967905e2a21ede208234e1b91494a Mon Sep 17 00:00:00 2001 From: billz Date: Mon, 5 Apr 2021 08:20:41 +0100 Subject: [PATCH 11/11] Update en_US msgstr --- locale/en_US/LC_MESSAGES/messages.po | 3 +++ 1 file changed, 3 insertions(+) diff --git a/locale/en_US/LC_MESSAGES/messages.po b/locale/en_US/LC_MESSAGES/messages.po index 8c4d5f97..8ce1cf38 100644 --- a/locale/en_US/LC_MESSAGES/messages.po +++ b/locale/en_US/LC_MESSAGES/messages.po @@ -362,6 +362,9 @@ msgstr "Log DHCP requests" msgid "Log DNS queries" msgstr "Log DNS queries" +msgid "This toggles the gateway/nogateway option for this interface in the DHCPCD configuration." +msgstr "This toggles the gateway/nogateway option for this interface in the DHCPCD configuration." + #: includes/hostapd.php msgid "Basic" msgstr "Basic"