From 50ab349d1b3b0e2f700806baf0a335e88f68807c Mon Sep 17 00:00:00 2001 From: Federico Frigo Date: Thu, 30 Sep 2021 11:04:57 +0100 Subject: [PATCH 1/7] Custom settings --- app/js/custom.js | 2 +- app/js/custom.min.js | 2 +- config/config.php | 6 +++--- config/defaults.json | 6 +++--- config/dhcpcd.conf | 8 ++++---- config/hostapd.conf | 9 +++++---- installers/common.sh | 2 +- installers/raspapd.service | 2 +- installers/uninstall.sh | 2 +- templates/wifi_stations.php | 29 +++++++++++++++++++++++++++++ 10 files changed, 49 insertions(+), 19 deletions(-) diff --git a/app/js/custom.js b/app/js/custom.js index da92097d..7edb4187 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -341,7 +341,7 @@ $(document).on("click", ".js-toggle-password", function(e) { } }); -$(document).on("keyup", ".js-validate-psk", function(e) { +$(document).on("input", ".js-validate-psk", function(e) { var field = $(e.target); var colors = field.data("colors").split(","); var target = $(field.data("target")); diff --git a/app/js/custom.min.js b/app/js/custom.min.js index 67444fb6..23a7c9b2 100644 --- a/app/js/custom.min.js +++ b/app/js/custom.min.js @@ -4,4 +4,4 @@ * Licensed under MIT (https://github.com/raspap-webgui/raspap-webgui/blob/master/LICENSE) */ -function msgShow(t,a){if(0==t)var e="success";else if(2==t||1==t)e="danger";return'"}function createNetmaskAddr(t){var a=[];for(i=0;i<4;i++){var e=Math.min(t,8);a.push(256-Math.pow(2,8-e)),t-=e}return a.join(".")}function loadSummary(a){$.post("/ajax/networking/get_ip_summary.php",{interface:a},function(t){jsonData=JSON.parse(t),console.log(jsonData),0==jsonData.return?$("#"+a+"-summary").html(jsonData.output.join("
")):2==jsonData.return&&$("#"+a+"-summary").append('")})}function getAllInterfaces(){$.get("/ajax/networking/get_all_interfaces.php",function(t){jsonData=JSON.parse(t),$.each(jsonData,function(t,a){loadSummary(a)})})}function setupTabs(){$('a[data-toggle="tab"]').on("shown.bs.tab",function(t){var a=$(t.target).attr("href");a.match("summary")||loadCurrentSettings(a.replace("#",""))})}function loadCurrentSettings(t){$.post("/ajax/networking/get_int_config.php",{interface:t},function(t){jsonData=JSON.parse(t),$.each(jsonData.output,function(t,a){var n=a.interface;$.each(a,function(t,a){switch(t){case"static":"true"==a?($("#"+n+"-static").click(),$("#"+n+"-nofailover").click()):$("#"+n+"-dhcp").click();break;case"failover":"true"===a?$("#"+n+"-failover").click():$("#"+n+"-nofailover").click();break;case"ip_address":var e=a.split("/");$("#"+n+"-ipaddress").val(e[0]),$("#"+n+"-netmask").val(createNetmaskAddr(e[1]));break;case"routers":$("#"+n+"-gateway").val(a);break;case"domain_name_server":svrsDNS=a.split(" "),$("#"+n+"-dnssvr").val(svrsDNS[0]),$("#"+n+"-dnssvralt").val(svrsDNS[1])}})})})}function saveNetworkSettings(t){var a=$("#frm-"+t).find(":input"),e={};$.each(a,function(t,a){"radio"==$(a).attr("type")?e[$(a).attr("id")]=$(a).prop("checked"):e[$(a).attr("id")]=$(a).val()}),e.interface=t,$.post("/ajax/networking/save_int_config.php",e,function(t){var a=JSON.parse(t);$("#msgNetworking").html(msgShow(a.return,a.output))})}function applyNetworkSettings(){$(this).data("int");arrFormData={generate:""},$.post("/ajax/networking/gen_int_config.php",arrFormData,function(t){console.log(t);var a=JSON.parse(t);$("#msgNetworking").html(msgShow(a.return,a.output))})}function setupBtns(){$("#btnSummaryRefresh").click(function(){getAllInterfaces()}),$(".intsave").click(function(){saveNetworkSettings($(this).data("int"))}),$(".intapply").click(function(){applyNetworkSettings()})}function setCSRFTokenHeader(t,a,e){var n=$("meta[name=csrf_token]").attr("content");/^(POST|PATCH|PUT|DELETE)$/i.test(e.type)&&a.setRequestHeader("X-CSRF-Token",n)}function contentLoaded(){switch(pageCurrent=window.location.href.split("?")[1].split("=")[1],pageCurrent=pageCurrent.replace("#",""),$("#side-menu").metisMenu(),pageCurrent){case"network_conf":getAllInterfaces(),setupTabs(),setupBtns()}}function loadWifiStations(a){return function(){var t=!0===a?"?refresh":"";$(".js-wifi-stations").addClass("loading-spinner").empty().load("/ajax/networking/wifi_stations.php"+t,function(){$(this).removeClass("loading-spinner")})}}$(document).on("click",".js-add-dhcp-static-lease",function(t){t.preventDefault();var a=$(".js-new-dhcp-static-lease"),e=$("input[name=mac]",a).val().trim(),n=$("input[name=ip]",a).val().trim();if(""!=e&&""!=n){var i=$("#js-dhcp-static-lease-row").html().replace("{{ mac }}",e).replace("{{ ip }}",n);$(".js-dhcp-static-lease-container").append(i),$("input[name=mac]",a).val(""),$("input[name=ip]",a).val("")}}),$(document).on("click",".js-remove-dhcp-static-lease",function(t){t.preventDefault(),$(this).parents(".js-dhcp-static-lease-row").remove()}),$(document).on("submit",".js-dhcp-settings-form",function(t){$(".js-add-dhcp-static-lease").trigger("click")}),$(".js-reload-wifi-stations").on("click",loadWifiStations(!0)),$(document).on("click",".js-toggle-password",function(t){var a=$(t.target),e=$(a.data("target"));e.is(":input")&&(t.preventDefault(),a.data("__toggle-with-initial")||a.data("__toggle-with-initial",a.text()),"password"===e.attr("type")?(a.text(a.data("toggle-with")),e.attr("type","text")):(a.text(a.data("__toggle-with-initial")),e.attr("type","password")))}),$(document).on("keyup",".js-validate-psk",function(t){var a=$(t.target),e=a.data("colors").split(","),n=$(a.data("target"));a.val().length<8||63'+a+""}function createNetmaskAddr(t){var a=[];for(i=0;i<4;i++){var e=Math.min(t,8);a.push(256-Math.pow(2,8-e)),t-=e}return a.join(".")}function loadSummary(a){$.post("/ajax/networking/get_ip_summary.php",{interface:a},function(t){jsonData=JSON.parse(t),console.log(jsonData),0==jsonData.return?$("#"+a+"-summary").html(jsonData.output.join("
")):2==jsonData.return&&$("#"+a+"-summary").append('")})}function getAllInterfaces(){$.get("/ajax/networking/get_all_interfaces.php",function(t){jsonData=JSON.parse(t),$.each(jsonData,function(t,a){loadSummary(a)})})}function setupTabs(){$('a[data-toggle="tab"]').on("shown.bs.tab",function(t){var a=$(t.target).attr("href");a.match("summary")||loadCurrentSettings(a.replace("#",""))})}function loadCurrentSettings(t){$.post("/ajax/networking/get_int_config.php",{interface:t},function(t){jsonData=JSON.parse(t),$.each(jsonData.output,function(t,a){var n=a.interface;$.each(a,function(t,a){switch(t){case"static":"true"==a?($("#"+n+"-static").click(),$("#"+n+"-nofailover").click()):$("#"+n+"-dhcp").click();break;case"failover":"true"===a?$("#"+n+"-failover").click():$("#"+n+"-nofailover").click();break;case"ip_address":var e=a.split("/");$("#"+n+"-ipaddress").val(e[0]),$("#"+n+"-netmask").val(createNetmaskAddr(e[1]));break;case"routers":$("#"+n+"-gateway").val(a);break;case"domain_name_server":svrsDNS=a.split(" "),$("#"+n+"-dnssvr").val(svrsDNS[0]),$("#"+n+"-dnssvralt").val(svrsDNS[1])}})})})}function saveNetworkSettings(t){var a=$("#frm-"+t).find(":input"),e={};$.each(a,function(t,a){"radio"==$(a).attr("type")?e[$(a).attr("id")]=$(a).prop("checked"):e[$(a).attr("id")]=$(a).val()}),e.interface=t,$.post("/ajax/networking/save_int_config.php",e,function(t){var a=JSON.parse(t);$("#msgNetworking").html(msgShow(a.return,a.output))})}function applyNetworkSettings(){$(this).data("int");arrFormData={generate:""},$.post("/ajax/networking/gen_int_config.php",arrFormData,function(t){console.log(t);var a=JSON.parse(t);$("#msgNetworking").html(msgShow(a.return,a.output))})}function setupBtns(){$("#btnSummaryRefresh").click(function(){getAllInterfaces()}),$(".intsave").click(function(){saveNetworkSettings($(this).data("int"))}),$(".intapply").click(function(){applyNetworkSettings()})}function setCSRFTokenHeader(t,a,e){var n=$("meta[name=csrf_token]").attr("content");/^(POST|PATCH|PUT|DELETE)$/i.test(e.type)&&a.setRequestHeader("X-CSRF-Token",n)}function contentLoaded(){switch(pageCurrent=window.location.href.split("?")[1].split("=")[1],pageCurrent=pageCurrent.replace("#",""),$("#side-menu").metisMenu(),pageCurrent){case"network_conf":getAllInterfaces(),setupTabs(),setupBtns()}}function loadWifiStations(a){return function(){var t=!0===a?"?refresh":"";$(".js-wifi-stations").addClass("loading-spinner").empty().load("/ajax/networking/wifi_stations.php"+t,function(){$(this).removeClass("loading-spinner")})}}$(document).on("click",".js-add-dhcp-static-lease",function(t){t.preventDefault();var a=$(".js-new-dhcp-static-lease"),e=$("input[name=mac]",a).val().trim(),n=$("input[name=ip]",a).val().trim();if(""!=e&&""!=n){var i=$("#js-dhcp-static-lease-row").html().replace("{{ mac }}",e).replace("{{ ip }}",n);$(".js-dhcp-static-lease-container").append(i),$("input[name=mac]",a).val(""),$("input[name=ip]",a).val("")}}),$(document).on("click",".js-remove-dhcp-static-lease",function(t){t.preventDefault(),$(this).parents(".js-dhcp-static-lease-row").remove()}),$(document).on("submit",".js-dhcp-settings-form",function(t){$(".js-add-dhcp-static-lease").trigger("click")}),$(".js-reload-wifi-stations").on("click",loadWifiStations(!0)),$(document).on("click",".js-toggle-password",function(t){var a=$(t.target),e=$(a.data("target"));e.is(":input")&&(t.preventDefault(),a.data("__toggle-with-initial")||a.data("__toggle-with-initial",a.text()),"password"===e.attr("type")?(a.text(a.data("toggle-with")),e.attr("type","text")):(a.text(a.data("__toggle-with-initial")),e.attr("type","password")))}),$(document).on("input",".js-validate-psk",function(t){var a=$(t.target),e=a.data("colors").split(","),n=$(a.data("target"));a.val().length<8||63 /dev/null; then diff --git a/installers/raspapd.service b/installers/raspapd.service index c5738465..7ec927f8 100644 --- a/installers/raspapd.service +++ b/installers/raspapd.service @@ -12,7 +12,7 @@ [Unit] Description=RaspAP Service Daemon DefaultDependencies=no -After=multi-user.target +After=network.target [Service] Type=oneshot diff --git a/installers/uninstall.sh b/installers/uninstall.sh index d0a3d9fb..4f155cac 100755 --- a/installers/uninstall.sh +++ b/installers/uninstall.sh @@ -158,7 +158,7 @@ function _restore_networking() { echo "Checking iptables rules" rules=( "-A POSTROUTING -j MASQUERADE" - "-A POSTROUTING -s 192.168.50.0/24 ! -d 192.168.50.0/24 -j MASQUERADE" + "-A POSTROUTING -s 192.168.200.0/24 ! -d 192.168.200.0/24 -j MASQUERADE" ) for rule in "${rules[@]}"; do if grep -- "$rule" $rulesv4 > /dev/null; then diff --git a/templates/wifi_stations.php b/templates/wifi_stations.php index 6949a51a..32cf8760 100755 --- a/templates/wifi_stations.php +++ b/templates/wifi_stations.php @@ -45,3 +45,32 @@ + +

+
+
+
+ + + +
+
+ +
+
+ +
+ +
+
+
+ +
+ " id="update" name="update" data-toggle="modal" data-target="#configureClientModal" /> +
+
+
+ + + +
From fd1c48b710bc730daefd583f3c97e2d3d434c81d Mon Sep 17 00:00:00 2001 From: Federico Frigo Date: Tue, 19 Oct 2021 18:51:44 +0200 Subject: [PATCH 2/7] Automated ssid and country code updates --- config/hostapd.conf | 2 +- installers/servicestart.sh | 64 ++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/config/hostapd.conf b/config/hostapd.conf index be3f7a71..792989f5 100644 --- a/config/hostapd.conf +++ b/config/hostapd.conf @@ -12,6 +12,7 @@ interface=uap0 wpa=2 wpa_pairwise=CCMP country_code=IT +ignore_broadcast_ssid=0 ## 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) @@ -22,4 +23,3 @@ country_code=IT ## RaspAP bridge AP mode (disabled by default) #bridge=br0 -ignore_broadcast_ssid=0 diff --git a/installers/servicestart.sh b/installers/servicestart.sh index 377678ca..fa0edbe4 100755 --- a/installers/servicestart.sh +++ b/installers/servicestart.sh @@ -10,27 +10,26 @@ DAEMONPATH="/lib/systemd/system/raspapd.service" OPENVPNENABLED=$(pidof openvpn | wc -l) positional=() -while [[ $# -gt 0 ]] -do -key="$1" +while [[ $# -gt 0 ]]; do + key="$1" -case $key in - -i|--interface) - interface="$2" - shift # past argument - shift # past value - ;; - -s|--seconds) - seconds="$2" - shift - shift - ;; - -a|--action) - action="$2" - shift - shift - ;; -esac + case $key in + -i | --interface) + interface="$2" + shift # past argument + shift # past value + ;; + -s | --seconds) + seconds="$2" + shift + shift + ;; + -a | --action) + action="$2" + shift + shift + ;; + esac done set -- "${positional[@]}" @@ -48,6 +47,24 @@ if [ "${action}" = "stop" ]; then exit 0 fi +HOSTAPD_CONF="/etc/hostapd/hostapd.conf" + +old_ssid=$(grep ^ssid $HOSTAPD_CONF | cut -d "=" -f 2) +new_ssid="isobox-$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2)" + +if [[ "$old_ssid" != "$new_ssid" ]]; then + sed -i "s/$old_ssid/$new_ssid/" $HOSTAPD_CONF + echo "Updated ssid: $new_ssid" +fi + +new_country_code=$(curl -s -H "Authorization: Bearer 9da1eb466ed052" https://ipinfo.io/json | jq -r ".country // empty") +old_country_code=$(grep ^country_code $HOSTAPD_CONF | cut -d "=" -f 2) + +if [[ ! -z "$new_country_code" ]] && [[ "$old_country_code" != "$new_country_code" ]]; then + sed -i "s/$old_country_code/$new_country_code/" $HOSTAPD_CONF + echo "Updated country code: $new_country_code" +fi + if [ -f "$DAEMONPATH" ] && [ ! -z "$interface" ]; then echo "Changing RaspAP Daemon --interface to $interface" sed -i "s/\(--interface \)[[:alnum:]]*/\1$interface/" "$DAEMONPATH" @@ -57,7 +74,7 @@ if [ -r "$CONFIGFILE" ]; then declare -A config while IFS=" = " read -r key value; do config["$key"]="$value" - done < "$CONFIGFILE" + done <"$CONFIGFILE" if [ "${config[BridgedEnable]}" = 1 ]; then if [ "${interface}" = "br0" ]; then @@ -79,7 +96,7 @@ if [ -r "$CONFIGFILE" ]; then echo "Disabling systemd-networkd" systemctl disable systemd-networkd - ip link ls up | grep -q 'br0' &> /dev/null + ip link ls up | grep -q 'br0' &>/dev/null if [ $? == 0 ]; then echo "Removing br0 interface..." ip link set down br0 @@ -89,7 +106,7 @@ if [ -r "$CONFIGFILE" ]; then if [ "${config[WifiAPEnable]}" = 1 ]; then if [ "${interface}" = "uap0" ]; then - ip link ls up | grep -q 'uap0' &> /dev/null + ip link ls up | grep -q 'uap0' &>/dev/null if [ $? == 0 ]; then echo "Removing uap0 interface..." iw dev uap0 del @@ -127,4 +144,3 @@ if [ "${config[WifiAPEnable]}" = 1 ]; then fi echo "RaspAP service start DONE" - From ec2e0af7db1a46b211c3ddc1c576e9237e3ae26b Mon Sep 17 00:00:00 2001 From: Federico Frigo Date: Tue, 19 Oct 2021 19:30:47 +0200 Subject: [PATCH 3/7] Hostname automatic update --- installers/servicestart.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/installers/servicestart.sh b/installers/servicestart.sh index fa0edbe4..c4bc1eb3 100755 --- a/installers/servicestart.sh +++ b/installers/servicestart.sh @@ -50,7 +50,8 @@ fi HOSTAPD_CONF="/etc/hostapd/hostapd.conf" old_ssid=$(grep ^ssid $HOSTAPD_CONF | cut -d "=" -f 2) -new_ssid="isobox-$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2)" +rpi_serial=$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2) +new_ssid="isobox-$rpi_serial" if [[ "$old_ssid" != "$new_ssid" ]]; then sed -i "s/$old_ssid/$new_ssid/" $HOSTAPD_CONF @@ -65,6 +66,15 @@ if [[ ! -z "$new_country_code" ]] && [[ "$old_country_code" != "$new_country_cod echo "Updated country code: $new_country_code" fi +old_hostname=$(hostname) +new_hostname=$(isobox-$rpi_serial) + +if [[ "$old_hostname" != "$new_hostname" ]]; then + echo $new_hostname >/etc/hostname + sed -i "s/$old_hostname/$new_hostname/" /etc/hosts + hostname $new_hostname +fi + if [ -f "$DAEMONPATH" ] && [ ! -z "$interface" ]; then echo "Changing RaspAP Daemon --interface to $interface" sed -i "s/\(--interface \)[[:alnum:]]*/\1$interface/" "$DAEMONPATH" From 6a08924dd19d4370bfe54d9d9a44c17487e9f2e1 Mon Sep 17 00:00:00 2001 From: Federico Frigo Date: Tue, 19 Oct 2021 20:23:19 +0200 Subject: [PATCH 4/7] servicestart.sh fixes --- installers/servicestart.sh | 57 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/installers/servicestart.sh b/installers/servicestart.sh index c4bc1eb3..0c3cc557 100755 --- a/installers/servicestart.sh +++ b/installers/servicestart.sh @@ -33,6 +33,35 @@ while [[ $# -gt 0 ]]; do done set -- "${positional[@]}" +HOSTAPD_CONF="/etc/hostapd/hostapd.conf" + +new_country_code=$(curl -s -H "Authorization: Bearer 9da1eb466ed052" https://ipinfo.io/json | jq -r ".country // empty") +old_country_code=$(grep ^country_code $HOSTAPD_CONF | cut -d "=" -f 2) + +if [[ ! -z "$new_country_code" ]] && [[ "$old_country_code" != "$new_country_code" ]]; then + sudo sed -i "s/country_code=$old_country_code/country_code=$new_country_code/" /etc/hostapd/hostapd.conf + echo "Updated country code: $new_country_code" +fi + +old_ssid=$(grep ^ssid $HOSTAPD_CONF | cut -d "=" -f 2) +rpi_serial=$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2) +new_ssid="isobox-$rpi_serial" + +if [[ "$old_ssid" != "$new_ssid" ]]; then + sed -i "s/ssid=$old_ssid/ssid=$new_ssid/" $HOSTAPD_CONF + echo "Updated ssid: $new_ssid" +fi + +old_hostname=$(hostname) +new_hostname="isobox-$rpi_serial" + +if [[ "$old_hostname" != "$new_hostname" ]]; then + echo $new_hostname >/etc/hostname + sed -i "s/$old_hostname/$new_hostname/" /etc/hosts + hostname $new_hostname + echo "Updated hostname: $new_hostname" +fi + echo "Stopping network services..." if [ $OPENVPNENABLED -eq 1 ]; then systemctl stop openvpn-client@client @@ -47,34 +76,6 @@ if [ "${action}" = "stop" ]; then exit 0 fi -HOSTAPD_CONF="/etc/hostapd/hostapd.conf" - -old_ssid=$(grep ^ssid $HOSTAPD_CONF | cut -d "=" -f 2) -rpi_serial=$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2) -new_ssid="isobox-$rpi_serial" - -if [[ "$old_ssid" != "$new_ssid" ]]; then - sed -i "s/$old_ssid/$new_ssid/" $HOSTAPD_CONF - echo "Updated ssid: $new_ssid" -fi - -new_country_code=$(curl -s -H "Authorization: Bearer 9da1eb466ed052" https://ipinfo.io/json | jq -r ".country // empty") -old_country_code=$(grep ^country_code $HOSTAPD_CONF | cut -d "=" -f 2) - -if [[ ! -z "$new_country_code" ]] && [[ "$old_country_code" != "$new_country_code" ]]; then - sed -i "s/$old_country_code/$new_country_code/" $HOSTAPD_CONF - echo "Updated country code: $new_country_code" -fi - -old_hostname=$(hostname) -new_hostname=$(isobox-$rpi_serial) - -if [[ "$old_hostname" != "$new_hostname" ]]; then - echo $new_hostname >/etc/hostname - sed -i "s/$old_hostname/$new_hostname/" /etc/hosts - hostname $new_hostname -fi - if [ -f "$DAEMONPATH" ] && [ ! -z "$interface" ]; then echo "Changing RaspAP Daemon --interface to $interface" sed -i "s/\(--interface \)[[:alnum:]]*/\1$interface/" "$DAEMONPATH" From 6a361b80aa8b0d3f667814a2dcde920ff62bece7 Mon Sep 17 00:00:00 2001 From: Federico Frigo Date: Sat, 23 Oct 2021 14:27:36 +0200 Subject: [PATCH 5/7] Update 50-raspap-router.conf --- config/50-raspap-router.conf | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/config/50-raspap-router.conf b/config/50-raspap-router.conf index 1c10d26f..249c7c9a 100644 --- a/config/50-raspap-router.conf +++ b/config/50-raspap-router.conf @@ -1,9 +1,8 @@ server.modules += ( - "mod_rewrite", + "mod_rewrite", ) -$HTTP["url"] =~ "^/REPLACE_ME/(?!(dist|app|ajax|config)).*" { - url.rewrite-once = ( "^/REPLACE_ME/(.*?)(\?.+)?$"=>"/REPLACE_ME/index.php/$1$2" ) - server.error-handler-404 = "/REPLACE_ME/index.php" +$HTTP["url"] =~ "^/var/www/html/(?!(dist|app|ajax|config)).*" { + url.rewrite-once = ( "^/var/www/html/(.*?)(\?.+)?$"=>"/var/www/html/index.php/$1$2" ) + server.error-handler-404 = "/var/www/html/index.php" } - From 70088732777ed2749b9ffaaee6e5cdee0b939e48 Mon Sep 17 00:00:00 2001 From: Federico Frigo Date: Sat, 23 Oct 2021 16:22:50 +0200 Subject: [PATCH 6/7] Update 50-raspap-router.conf --- config/50-raspap-router.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/50-raspap-router.conf b/config/50-raspap-router.conf index 249c7c9a..0248d545 100644 --- a/config/50-raspap-router.conf +++ b/config/50-raspap-router.conf @@ -1,8 +1,8 @@ server.modules += ( - "mod_rewrite", + "mod_rewrite", ) -$HTTP["url"] =~ "^/var/www/html/(?!(dist|app|ajax|config)).*" { - url.rewrite-once = ( "^/var/www/html/(.*?)(\?.+)?$"=>"/var/www/html/index.php/$1$2" ) - server.error-handler-404 = "/var/www/html/index.php" +$HTTP["url"] =~ "^/REPLACE_ME/(?!(dist|app|ajax|config)).*" { + url.rewrite-once = ( "^/REPLACE_ME/(.*?)(\?.+)?$"=>"/REPLACE_ME/index.php/$1$2" ) + server.error-handler-404 = "/REPLACE_ME/index.php" } From 6b276a8c4e703008a74dd04a1a30ba7d6ec4ad82 Mon Sep 17 00:00:00 2001 From: Federico Frigo Date: Sat, 23 Oct 2021 16:38:28 +0200 Subject: [PATCH 7/7] Update 50-raspap-router.conf --- config/50-raspap-router.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/50-raspap-router.conf b/config/50-raspap-router.conf index 0248d545..23c13b2d 100644 --- a/config/50-raspap-router.conf +++ b/config/50-raspap-router.conf @@ -1,8 +1,8 @@ server.modules += ( - "mod_rewrite", + "mod_rewrite", ) -$HTTP["url"] =~ "^/REPLACE_ME/(?!(dist|app|ajax|config)).*" { - url.rewrite-once = ( "^/REPLACE_ME/(.*?)(\?.+)?$"=>"/REPLACE_ME/index.php/$1$2" ) - server.error-handler-404 = "/REPLACE_ME/index.php" +$HTTP["url"] =~ "^/(?!(dist|app|ajax|config)).*" { + url.rewrite-once = ( "^/(.*?)(\?.+)?$"=>"/index.php/$1$2" ) + server.error-handler-404 = "/index.php" }