From ac46e6dfcbf4240b3e4d8f75879326cf655d5b9e Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 7 Jun 2022 19:57:16 +0100 Subject: [PATCH 01/15] Initial commit --- config/raspap-bridge-br0.netplan | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 config/raspap-bridge-br0.netplan diff --git a/config/raspap-bridge-br0.netplan b/config/raspap-bridge-br0.netplan new file mode 100644 index 00000000..e00b2833 --- /dev/null +++ b/config/raspap-bridge-br0.netplan @@ -0,0 +1,11 @@ +network: + version: 2 + renderer: networkd + ethernets: + eth0: + dhcp4: no + bridges: + br0: + dhcp4: yes + interfaces: + - eth0 From a75ead776ff956f7db4a8846655c11b4e2c2eee3 Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 7 Jun 2022 19:58:04 +0100 Subject: [PATCH 02/15] Created _manage_systemd_services() --- installers/common.sh | 49 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index f63a5baa..e4f6107f 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -41,6 +41,7 @@ function _install_raspap() { _display_welcome _config_installation _update_system_packages + _manage_systemd_services _install_dependencies _enable_php_lighttpd _create_raspap_directories @@ -157,6 +158,52 @@ function _set_php_package() { esac } +# Prompts the user to stop & disable Debian's systemd-networkd services +# It isn't possible to mix Debian networking with dhcpcd +# On Ubuntu 20.04 / Armbian 22, the systemd-resolved service uses port 53 +# by default which prevents dnsmasq from starting. +function _manage_systemd_services() { + _install_log "Checking for systemd-networkd services" + + # Prompt to disable systemd-networkd service + if systemctl is-active --quiet systemd-networkd.service; then + echo -n "Stop and disable systemd-networkd service? [Y/n]: " + if [ "$assume_yes" == 0 ]; then + read answer < /dev/tty + if [ "$answer" != "${answer#[Nn]}" ]; then + echo -e + else + sudo systemctl stop systemd-networkd.service + sudo systemctl disable systemd-networkd.service + fi + else + sudo systemctl stop systemd-networkd.service + sudo systemctl disable systemd-networkd.service + fi + else + echo "systemd-networkd.service is not running (OK)" + fi + + # Prompt to disable systemd-resolved service + if systemctl is-active --quiet systemd-resolved.service; then + echo -n "Stop and disable systemd-resolved service? [Y/n]: " + if [ "$assume_yes" == 0 ]; then + read answer < /dev/tty + if [ "$answer" != "${answer#[Nn]}" ]; then + echo -e + else + sudo systemctl stop systemd-resolved.service + sudo systemctl disable systemd-resolved.service + fi + else + sudo systemctl stop systemd-resolved.service + sudo systemctl disable systemd-resolved.service + fi + else + echo "systemd-resolved.service is not running (OK)" + fi +} + # Runs a system software update to make sure we're using all fresh packages function _install_dependencies() { _install_log "Installing required packages" @@ -528,8 +575,6 @@ function _default_configuration() { [ -d /etc/dnsmasq.d ] || sudo mkdir /etc/dnsmasq.d echo "Copying bridged AP config to /etc/systemd/network" - sudo systemctl stop systemd-networkd - sudo systemctl disable systemd-networkd sudo cp $webroot_dir/config/raspap-bridge-br0.netdev /etc/systemd/network/raspap-bridge-br0.netdev || _install_status 1 "Unable to move br0 netdev file" sudo cp $webroot_dir/config/raspap-br0-member-eth0.network /etc/systemd/network/raspap-br0-member-eth0.network || _install_status 1 "Unable to move br0 member file" From fcd3a7f204f6febf6612012edd308315af50fa55 Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 7 Jun 2022 20:46:55 +0100 Subject: [PATCH 03/15] Tidy function w/ do loop --- installers/common.sh | 55 ++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index e4f6107f..4017dfc9 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -163,45 +163,30 @@ function _set_php_package() { # On Ubuntu 20.04 / Armbian 22, the systemd-resolved service uses port 53 # by default which prevents dnsmasq from starting. function _manage_systemd_services() { - _install_log "Checking for systemd-networkd services" + _install_log "Checking for systemd network services" - # Prompt to disable systemd-networkd service - if systemctl is-active --quiet systemd-networkd.service; then - echo -n "Stop and disable systemd-networkd service? [Y/n]: " - if [ "$assume_yes" == 0 ]; then - read answer < /dev/tty - if [ "$answer" != "${answer#[Nn]}" ]; then - echo -e + services=( "systemd-networkd" "systemd-resolved" ) + for svc in "${services[@]}"; do + # Prompt to disable systemd service + if systemctl is-active --quiet "$svc".service; then + echo -n "Stop and disable ${svc} service? [Y/n]: " + if [ "$assume_yes" == 0 ]; then + read answer < /dev/tty + if [ "$answer" != "${answer#[Nn]}" ]; then + echo -e + else + sudo systemctl stop "$svc".service + sudo systemctl disable "$svc".service + fi else - sudo systemctl stop systemd-networkd.service - sudo systemctl disable systemd-networkd.service + sudo systemctl stop "$svc".service + sudo systemctl disable "$svc".service fi else - sudo systemctl stop systemd-networkd.service - sudo systemctl disable systemd-networkd.service + echo "${svc}.service is not running (OK)" fi - else - echo "systemd-networkd.service is not running (OK)" - fi - - # Prompt to disable systemd-resolved service - if systemctl is-active --quiet systemd-resolved.service; then - echo -n "Stop and disable systemd-resolved service? [Y/n]: " - if [ "$assume_yes" == 0 ]; then - read answer < /dev/tty - if [ "$answer" != "${answer#[Nn]}" ]; then - echo -e - else - sudo systemctl stop systemd-resolved.service - sudo systemctl disable systemd-resolved.service - fi - else - sudo systemctl stop systemd-resolved.service - sudo systemctl disable systemd-resolved.service - fi - else - echo "systemd-resolved.service is not running (OK)" - fi + done + _install_status 0 } # Runs a system software update to make sure we're using all fresh packages @@ -213,7 +198,7 @@ function _install_dependencies() { sudo apt-get install $apt_option software-properties-common || _install_status 1 "Unable to install dependency" sudo add-apt-repository $apt_option ppa:ondrej/php || _install_status 1 "Unable to add-apt-repository ppa:ondrej/php" else - echo "PHP will be installed from the main deb sources list" + echo "${php_package} will be installed from the main deb sources list" fi if [ ${OS,,} = "debian" ] || [ ${OS,,} = "ubuntu" ]; then dhcpcd_package="dhcpcd5" From 316b1616712d889ae0b1bb34c4d2f7b01307e08a Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 8 Jun 2022 07:24:36 +0100 Subject: [PATCH 04/15] Catch error & return install_status on failure --- installers/common.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 4017dfc9..a32bf8f4 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -158,8 +158,8 @@ function _set_php_package() { esac } -# Prompts the user to stop & disable Debian's systemd-networkd services -# It isn't possible to mix Debian networking with dhcpcd +# Prompts the user to stop & disable Debian's systemd-networkd services. +# It isn't possible to mix Debian networking with dhcpcd. # On Ubuntu 20.04 / Armbian 22, the systemd-resolved service uses port 53 # by default which prevents dnsmasq from starting. function _manage_systemd_services() { @@ -175,12 +175,12 @@ function _manage_systemd_services() { if [ "$answer" != "${answer#[Nn]}" ]; then echo -e else - sudo systemctl stop "$svc".service - sudo systemctl disable "$svc".service + sudo systemctl stop "$svc".service || _install_status 1 "Unable to stop ${svc}.service" + sudo systemctl disable "$svc".service || _install_status 1 "Unable to disable ${svc}.service" fi else - sudo systemctl stop "$svc".service - sudo systemctl disable "$svc".service + sudo systemctl stop "$svc".service || _install_status 1 "Unable to stop ${svc}.service" + sudo systemctl disable "$svc".service || _install_status 1 "Unable to disable ${svc}.service" fi else echo "${svc}.service is not running (OK)" From 705477a0116d61c69c642d9e629c284a6cdee6bf Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 8 Jun 2022 16:45:56 +0000 Subject: [PATCH 05/15] Install OS-specific bridge default config --- installers/common.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index a32bf8f4..7a76849c 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -553,15 +553,21 @@ function _default_configuration() { sudo cp $webroot_dir/config/dhcpcd.conf /etc/dhcpcd.conf || _install_status 1 "Unable to move dhcpcd configuration file" sudo cp $webroot_dir/config/defaults.json $raspap_network || _install_status 1 "Unable to move defaults.json settings" - echo "Changing file ownership of ${raspap_network}/defaults.json" + echo "Changing file ownership of ${raspap_network}defaults.json" sudo chown $raspap_user:$raspap_user "$raspap_network"/defaults.json || _install_status 1 "Unable to change file ownership for defaults.json" echo "Checking for existence of /etc/dnsmasq.d" [ -d /etc/dnsmasq.d ] || sudo mkdir /etc/dnsmasq.d - echo "Copying bridged AP config to /etc/systemd/network" - sudo cp $webroot_dir/config/raspap-bridge-br0.netdev /etc/systemd/network/raspap-bridge-br0.netdev || _install_status 1 "Unable to move br0 netdev file" - sudo cp $webroot_dir/config/raspap-br0-member-eth0.network /etc/systemd/network/raspap-br0-member-eth0.network || _install_status 1 "Unable to move br0 member file" + # Copy OS-specific bridge default config + if [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(20.04|19.10|18.04) ]]; then + echo "Copying bridged AP config to /etc/netplan" + sudo cp $webroot_dir/config/raspap-bridge-br0.netplan /etc/netplan/raspap-bridge-br0.netplan || _install_status 1 "Unable to move br0 netplan file" + else + echo "Copying bridged AP config to /etc/systemd/network" + sudo cp $webroot_dir/config/raspap-bridge-br0.netdev /etc/systemd/network/raspap-bridge-br0.netdev || _install_status 1 "Unable to move br0 netdev file" + sudo cp $webroot_dir/config/raspap-br0-member-eth0.network /etc/systemd/network/raspap-br0-member-eth0.network || _install_status 1 "Unable to move br0 member file" + fi echo "Copying primary RaspAP config to includes/config.php" if [ ! -f "$webroot_dir/includes/config.php" ]; then From 86bb8458b8eaacce462a292da4bce0046428cb8c Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 8 Jun 2022 16:47:00 +0000 Subject: [PATCH 06/15] Add sbin/netplan to sudoers --- installers/raspap.sudoers | 1 + 1 file changed, 1 insertion(+) diff --git a/installers/raspap.sudoers b/installers/raspap.sudoers index 945aa0c8..000f8057 100644 --- a/installers/raspap.sudoers +++ b/installers/raspap.sudoers @@ -62,4 +62,5 @@ www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wireguard/*.conf www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wireguard/wg-*.key www-data ALL=(ALL) NOPASSWD:/bin/rm /etc/wireguard/*.conf www-data ALL=(ALL) NOPASSWD:/bin/rm /etc/wireguard/wg-*.key +www-data ALL=(ALL) NOPASSWD:/usr/sbin/netplan From b5886882eefc8807682cbc7060886d6c4234d3e2 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 8 Jun 2022 17:21:50 +0000 Subject: [PATCH 07/15] Add os_desc + kernel version functions --- app/lib/system.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/lib/system.php b/app/lib/system.php index ee21ad84..22f7255a 100644 --- a/app/lib/system.php +++ b/app/lib/system.php @@ -75,5 +75,16 @@ class Sysinfo return $status; } + public function operatingSystem() + { + $os_desc = shell_exec("lsb_release -sd"); + return $os_desc; + } + + public function kernelVersion() + { + $kernel = shell_exec("uname -r"); + return $kernel; + } } From affc0396f1e254c04f94e36c35501e03e68b68ba Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 8 Jun 2022 17:22:52 +0000 Subject: [PATCH 08/15] Display os + kernel info on system > basic tab --- includes/system.php | 4 ++++ templates/system/basic.php | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/includes/system.php b/includes/system.php index db7f3c48..56f5e111 100755 --- a/includes/system.php +++ b/includes/system.php @@ -159,6 +159,8 @@ function DisplaySystem() $hostname = $system->hostname(); $uptime = $system->uptime(); $cores = $system->processorCount(); + $os = $system->operatingSystem(); + $kernel = $system->kernelVersion(); // mem used $memused = $system->usedMemory(); @@ -215,6 +217,8 @@ function DisplaySystem() "hostname", "uptime", "cores", + "os", + "kernel", "memused", "memused_status", "memused_led", diff --git a/templates/system/basic.php b/templates/system/basic.php index dd7fc278..887eeea7 100644 --- a/templates/system/basic.php +++ b/templates/system/basic.php @@ -16,6 +16,12 @@ include('includes/sysstats.php');
+
+
+
+
+
+
From 08a76445aec12f453e6dcbddd03bdc2411559135 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 8 Jun 2022 17:24:13 +0000 Subject: [PATCH 09/15] Add new messages to en_US locale --- locale/en_US/LC_MESSAGES/messages.mo | Bin 31005 -> 31057 bytes locale/en_US/LC_MESSAGES/messages.po | 6 ++++++ 2 files changed, 6 insertions(+) diff --git a/locale/en_US/LC_MESSAGES/messages.mo b/locale/en_US/LC_MESSAGES/messages.mo index 3433cbf6ee28d819ec2cb9cac01e5a2ec37f3f59..703307ef8c8d5c280183c231012a55e26b511a6e 100644 GIT binary patch delta 8162 zcmZYC2XIzZ8piPxAR&#CgcS0n5kg2H)Sw}h009z^P7J+;UW1_*^`fA3ko{mN3W%tP zz(~=ESP)?mRFJkP)yA?GjPxeR{-50A%+Bl`UVi7ix14(K2WzkU9KY`4TnsI@!f-6| zF(w9|4mKvXj4|hc)6Tc(5#HU^q5KJ+K>=$59x8MW_bmVF)h6HnS&&I4Ej=^jXFOc zE8!~CK;A;lz;@+n-|VN*8Bd}{mYD2X8~vy^LQQc~0j}-Hv2p0QL6h1X9SOFck-&rtUPV$3LPTbRAhP6Tn93i)rYK^Q=oyBU+A{ z@=d6be}o#~m#79iq`FI%kLvh{RINXSNhHeS9D8CBrcqywTGNB5>n+= z2kW7hXbNfoUQ|ccV_AF`193O1(kVl(-sF|JXP|(z^Lycqy#^GJm4Uu)+dIBa; zZ-MIAAk^-E3bpy3M@{(}R7W;r1$+-1;C?hd#@xcm6mQoxW+ysh>lxFNLVSHT1Wv_X zxDOj+G4hW}x=OGSqcDFbt2OI&=vG@g^4GBh=CrHFB4F8kVE}JVuxy ztbskTt~9~>iJ@Gu7uE9N(y5-!MmA-bRLL zGe=PMN2s}qf7~5PQ{;1M`k;2@(-@8~q89fRtb$uG0zXAf-8ZPA|6=p^FpPTT40i-c z8O(DEi8>_oBKJTwFda3N*{Jto0cyxEVFa#5HLx8u#LrMeI)WPNP1FE<*daO}i=~?Y zbzdf`V;vgvo@oSqN$7kQO;^CId&uiE?;R0rR;^-oZ1^95=qE}+)rI;z9> zQP+oLx(!F6o|ocKP><75AMci^k@iK6XejDI3sF<&MK!R=`Vp#uhMF<_VsJ( zUKfPws0THp^-<@W;Y@6W{JJ^jV+wk}IZVJysD^!;xi5YcYU&1~8XSdMvPr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subject: [PATCH 10/15] Get system->operatingSystem() --- includes/hostapd.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/hostapd.php b/includes/hostapd.php index 812d81ee..fc301417 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -7,6 +7,9 @@ require_once 'includes/config.php'; getWifiInterface(); +$system = new \RaspAP\System\Sysinfo; +$os = $system->operatingSystem(); + /** * Initialize hostapd values, display interface * From 7674feaf6141d7e27dbe3dc3175359bc821343c2 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 22 Jun 2022 11:50:00 +0100 Subject: [PATCH 11/15] Add operatingSystem check to bridge option --- includes/hostapd.php | 4 +++- templates/hostapd/advanced.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/hostapd.php b/includes/hostapd.php index fc301417..d1160d6d 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -18,6 +18,7 @@ function DisplayHostAPDConfig() { $status = new StatusMessages(); $system = new \RaspAP\System\Sysinfo; + $operatingSystem = $system->operatingSystem(); $arrConfig = array(); $arr80211Standard = [ 'a' => '802.11a - 5 GHz', @@ -122,7 +123,8 @@ function DisplayHostAPDConfig() "arrEncType", "arrTxPower", "txpower", - "arrHostapdConf" + "arrHostapdConf", + "operatingSystem" ) ); } diff --git a/templates/hostapd/advanced.php b/templates/hostapd/advanced.php index f331734b..89d90c72 100644 --- a/templates/hostapd/advanced.php +++ b/templates/hostapd/advanced.php @@ -4,7 +4,8 @@
- /> + + />
From a743f84529e9d1dc1ab463e84be697510f309b97 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 22 Jun 2022 11:56:42 +0100 Subject: [PATCH 12/15] Minor: case change --- installers/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/common.sh b/installers/common.sh index 7a76849c..fc661394 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -183,7 +183,7 @@ function _manage_systemd_services() { sudo systemctl disable "$svc".service || _install_status 1 "Unable to disable ${svc}.service" fi else - echo "${svc}.service is not running (OK)" + echo "${svc}.service is not running (ok)" fi done _install_status 0 From 52b11b092c1d8968ba567b96312e0fdd249c937d Mon Sep 17 00:00:00 2001 From: Bill Zimmerman Date: Wed, 22 Jun 2022 21:52:09 +0200 Subject: [PATCH 13/15] Set default country_code --- config/hostapd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hostapd.conf b/config/hostapd.conf index 856e4a1b..c058a308 100644 --- a/config/hostapd.conf +++ b/config/hostapd.conf @@ -11,7 +11,7 @@ wpa_passphrase=ChangeMe interface=wlan0 wpa=2 wpa_pairwise=CCMP -country_code= +country_code=UK ## Rapberry Pi 3 specific to on board WLAN/WiFi #ieee80211n=1 # 802.11n support (Raspberry Pi 3) #wmm_enabled=1 # QoS support (Raspberry Pi 3) From 10942aa8aebaea2170a075f8a3417905a8262d6d Mon Sep 17 00:00:00 2001 From: Bill Zimmerman Date: Thu, 23 Jun 2022 00:19:31 +0200 Subject: [PATCH 14/15] Update country_code --- config/hostapd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hostapd.conf b/config/hostapd.conf index c058a308..cdb2a881 100644 --- a/config/hostapd.conf +++ b/config/hostapd.conf @@ -11,7 +11,7 @@ wpa_passphrase=ChangeMe interface=wlan0 wpa=2 wpa_pairwise=CCMP -country_code=UK +country_code=GB ## Rapberry Pi 3 specific to on board WLAN/WiFi #ieee80211n=1 # 802.11n support (Raspberry Pi 3) #wmm_enabled=1 # QoS support (Raspberry Pi 3) From c1db8d64093b8e4a681c3fc5a535762e9280586b Mon Sep 17 00:00:00 2001 From: Bill Zimmerman Date: Thu, 23 Jun 2022 17:06:58 +0200 Subject: [PATCH 15/15] Set DAEMON_CONF path for hostapd --- installers/common.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/installers/common.sh b/installers/common.sh index fc661394..6e89f307 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -649,6 +649,15 @@ function _patch_system_files() { _install_log "Unmasking and enabling hostapd service" sudo systemctl unmask hostapd.service sudo systemctl enable hostapd.service + + # Set correct DAEMON_CONF path for hostapd (Ubuntu20 + Armbian22) + if [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(20.04|19.10|18.04) ]]; then + conf="/etc/default/hostapd" + key="DAEMON_CONF" + value="/etc/hostapd/hostapd.conf" + echo "Setting default ${key} path to ${value}" + sudo sed -i "/^$key/ { s/^#//; s%=.*%=\"$value\"%; }" "$conf" || _install_status 1 "Unable to set value in ${conf}" + fi _install_status 0 }