]> git.99rst.org Git - openwrt-packages.git/commitdiff
simple-captive-portal: update to 2026.08.06 / use port 80
authorEtienne Champetier <redacted>
Fri, 7 Aug 2026 00:49:31 +0000 (20:49 -0400)
committerEtienne Champetier <redacted>
Fri, 7 Aug 2026 02:24:04 +0000 (22:24 -0400)
No issue reported but this is a bit cleaner.

Signed-off-by: Etienne Champetier <redacted>
net/simple-captive-portal/Makefile
net/simple-captive-portal/files/etc/init.d/simple-captive-portal
net/simple-captive-portal/files/usr/share/simple-captive-portal/redirect.lua

index 2574feee9dd8c785ed7357a71e4ee6d5b7271055..48822c6c4ed4b74b0f0b0193bc9f5ac09494973d 100644 (file)
@@ -1,8 +1,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=simple-captive-portal
-PKG_VERSION:=2025.06.22
-PKG_RELEASE:=2
+PKG_VERSION:=2026.08.06
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
 PKG_LICENSE:=GPL-2.0-or-later
index 77cfba0f60635af8ad5e75223be42d597b763c36..85fffd1eb7a78e20b6a7266ad97a41b25119839d 100644 (file)
@@ -4,11 +4,12 @@ USE_PROCD=1
 EXTRA_COMMANDS='firewall'
 
 firewall() {
-    local INTF PORT_REDIRECT TIMEOUT
+    local INTF PORT_REDIRECT PORT_PORTAL TIMEOUT
     config_load "simple-captive-portal"
     config_get INTF main interface
     [ -z "${INTF}" ] && exit 0
     config_get PORT_REDIRECT main port_redirect 8888
+    config_get PORT_PORTAL main port_portal 8889
     config_get TIMEOUT main timeout 86400
 
     /usr/sbin/nft -f- <<EOF
@@ -24,6 +25,7 @@ table inet simple-captive-portal {
         type nat hook prerouting priority mangle - 5; policy drop;
         iif != ${INTF} accept
         ether saddr @guest_macs accept
+        tcp dport 80 fib daddr . iif type local redirect to ${PORT_PORTAL}
         tcp dport 80 redirect to ${PORT_REDIRECT}
         fib daddr . iif type { local, broadcast, multicast } accept
         reject
@@ -50,7 +52,6 @@ start_service() {
 
     procd_open_instance redirect
     procd_set_param command /usr/sbin/uhttpd -f -c /dev/null -k0 -h /etc/simple-captive-portal/ -l / -L /usr/share/simple-captive-portal/redirect.lua -p "${PORT_REDIRECT}"
-    procd_set_param env PORT_PORTAL=${PORT_PORTAL}
     procd_add_jail simple-captive-portal-redirect log procfs sysfs ronly
     procd_add_jail_mount /etc/simple-captive-portal/
     procd_add_jail_mount /usr/share/simple-captive-portal/redirect.lua
index c25dc397b2c898976885f14df5497fd4bb597fc7..f5dd3df9aab36a9403537f615d360d556ccffc95 100644 (file)
@@ -1,12 +1,10 @@
-port_portal = os.getenv("PORT_PORTAL")
-
 function handle_request(env)
     uhttpd.send("Status: 302 Found\r\n")
     uhttpd.send("Server: simple-captive-portal\r\n")
     if string.find(env.SERVER_ADDR, ":") == nil then
-        uhttpd.send("Location: http://" .. env.SERVER_ADDR .. ":" .. port_portal .. "/\r\n")
+        uhttpd.send("Location: http://" .. env.SERVER_ADDR .. "/\r\n")
     else
-        uhttpd.send("Location: http://[" .. env.SERVER_ADDR .. "]:" .. port_portal .. "/\r\n")
+        uhttpd.send("Location: http://[" .. env.SERVER_ADDR .. "]/\r\n")
     end
     uhttpd.send("Cache-Control: no-cache\r\n")
     uhttpd.send("Content-Length: 0\r\n\r\n")
git clone https://git.99rst.org/PROJECT