include $(TOPDIR)/rules.mk
PKG_NAME:=apfree-wifidog
-PKG_VERSION:=3.8.1588
+PKG_VERSION:=3.11.1716
PKG_RELEASE=1
PKG_LICENSE:=GPL-3.0-or-later
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/liudf0716/apfree_wifidog.git
PKG_SOURCE_VERSION:=$(PKG_VERSION)
-PKG_MIRROR_HASH:=0d10ad5a29358a7124ba75570894f48998af841519b0f295e3fcbed66ee7bccc
-
-PKG_INSTALL:=1
+PKG_MIRROR_HASH:=76eda57e40b919091281305344bc57fc732a779d7944f57bd5de87914ba127d1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
SECTION:=net
CATEGORY:=Network
DEPENDS:=+zlib +iptables-mod-extra +iptables-mod-ipopt +kmod-ipt-nat +iptables-mod-nat-extra \
- +libjson-c +ipset +libip4tc +libevent2 +libevent2-openssl \
- +fping +libmosquitto +libuci +px5g
+ +libjson-c +ipset +libip4tc +libevent2 +libevent2-openssl +libuci +px5g
TITLE:=Apfree's wireless captive portal solution
URL:=https://github.com/liudf0716/apfree_wifidog
endef
The ApFree Wifidog project is a complete and embeddable captive portal
solution for wireless community groups or individuals who wish to open a free
Hotspot while still preventing abuse of their Internet connection.
-
It's enhanced wifidog
endef
define Package/apfree-wifidog/install
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wifidog $(1)/usr/bin/wifidogx
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wdctl $(1)/usr/bin/wdctlx
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhttpd.so* $(1)/usr/lib/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wifidogx $(1)/usr/bin/wifidogx
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wdctlx $(1)/usr/bin/wdctlx
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/wdping $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc
config wifidog
- option gateway_interface 'br-lan'
- option auth_server_hostname 'change wifidog.kunteng.org.cn to your auth server domain or ip'
- option auth_server_port 8001
- option auth_server_path '/wifidog/'
- option check_interval 60
- option client_timeout 5
- option httpd_max_conn 200
- option pool_mode 1
- option thread_number 5
- option queue_size 20
- option wired_passed 0
- option enable 0
+ option gateway_interface 'br-lan'
+ option auth_server_hostname 'change wifidog.kunteng.org.cn to your auth server domain or ip'
+ option auth_server_port 443
+ option auth_server_path '/wifidog/'
+ option check_interval 60
+ option client_timeout 5
+ option wired_passed 0
+ option disabled 1
USE_PROCD=1
PROG=/usr/bin/wifidogx
-CONFIGFILE=/tmp/wifidog.conf
+CONFIGFILE=/tmp/wifidogx.conf
EXTRA_COMMANDS="status"
EXTRA_HELP=" status Print the status of the service"
local delta_traffic
local check_interval
local client_timeout
- local httpd_max_conn
local trusted_domains
local js_filter
local trusted_maclist
[ -f ${CONFIGFILE} ] && rm -f ${CONFIGFILE}
- config_get enable "${cfg}" "enable" 0
- [ "${enable}" = "1" ] || return
+ config_get enable "${cfg}" "disabled" 0
+ [ "${enable}" = "0" ] || {
+ echo "wifidogx disabled in /etc/config/wifidogx file, please set disabled to 0 to enable it" >&2
+ return
+ }
default_gateway_id=$(sed -e 's/://g' /sys/class/net/br-lan/address)
config_get check_interval "${cfg}" "check_interval" "60"
config_get js_filter "${cfg}" "js_filter" 1
config_get client_timeout "${cfg}" "client_timeout" "5"
- config_get httpd_max_conn "${cfg}" "httpd_max_conn" "200"
config_get trusted_domains "${cfg}" "trusted_domains"
config_get trusted_maclist "${cfg}" "trusted_maclist"
config_get untrusted_maclist "${cfg}" "untrusted_maclist"
ClientTimeout $client_timeout
JsFilter $js_filter
WiredPassed $wired_passed
-
- HTTPDMaxConn $httpd_max_conn
-
- PoolMode $pool_mode
- ThreadNumber $thread_number
- QueueSize $queue_size
-
$set_trusted_domains
-
$set_untrusted_maclist
-
$set_trusted_maclist
-
$set_trusted_iplist
-
$set_trusted_pan_domains
-
$set_proxy_port
-
$set_no_auth
-
$set_apple_cna
-
$set_update_domain_interval
-
$set_dns_timeout
FirewallRuleSet global {
config_foreach prepare_wifidog_conf wifidog
[ ! -f ${CONFIGFILE} ] && {
- echo "no wifidog.conf, exit..."
- stop
+ echo "no wifidogx.conf, exit..." >&2
exit
}
}
[ -s ${APFREE_KEY} -a -s ${APFREE_CERT} ] || {
- echo "no cert or key, exit..."
- stop
+ echo "no cert or key, exit..." >&2
exit
}