perf(waf): IP 匹配改为索引查询(ipmatcher / 预编译)

加载时编译 IP 组与节点 IP/CIDR 索引,优先 resty.ipmatcher 基数树,
否则 exact 哈希 + 预解析 CIDR,避免大名单线性扫描打满边缘 CPU。
This commit is contained in:
ryan
2026-07-19 14:48:07 +08:00
parent 46ce7de513
commit 1a7e5e6c41
6 changed files with 271 additions and 45 deletions
+1
View File
@@ -28,6 +28,7 @@ FROM openresty/openresty:alpine
RUN apk add --no-cache ca-certificates tzdata perl libmaxminddb su-exec libcap \
&& ln -sf /usr/lib/libmaxminddb.so.0 /usr/lib/libmaxminddb.so \
&& opm get anjia0532/lua-resty-maxminddb \
&& opm get api7/lua-resty-ipmatcher \
&& addgroup -S openflare \
&& adduser -S -G openflare -H -h /data -s /sbin/nologin openflare \
&& mkdir -p /etc/openflare /data \