mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-31 06:40:42 +03:00
Compare commits
17 Commits
v0.9.20260
...
v0.9.20260
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8302ed517f | ||
|
|
3f49fa3913 | ||
|
|
2e875efcf7 | ||
|
|
6a25a51571 | ||
|
|
a97d095aa6 | ||
|
|
13341758a0 | ||
|
|
6c3f5394f7 | ||
|
|
af466256af | ||
|
|
92b4159836 | ||
|
|
ea12fcc85a | ||
|
|
c261476262 | ||
|
|
7fb5b37ad3 | ||
|
|
da3cd4a341 | ||
|
|
b4c3854774 | ||
|
|
81c269a7a6 | ||
|
|
fe59ce025f | ||
|
|
bbc12a2e1f |
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -155,6 +155,7 @@ jobs:
|
||||
- mipsel_24kc_24kf
|
||||
- mipsel_74kc
|
||||
- mipsel_mips32
|
||||
- riscv64_generic
|
||||
- x86_64
|
||||
isTestOrFake:
|
||||
- ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}
|
||||
@@ -163,6 +164,8 @@ jobs:
|
||||
arch: arm_cortex-a9_vfpv3-d16
|
||||
- branch: ${{ needs.var.outputs.APK_BRANCH }}
|
||||
arch: mips_4kec
|
||||
- branch: ${{ needs.var.outputs.IPK_BRANCH }}
|
||||
arch: riscv64_generic
|
||||
- { isTestOrFake: true }
|
||||
include:
|
||||
- branch: ${{ needs.var.outputs.IPK_BRANCH }}
|
||||
@@ -270,6 +273,8 @@ jobs:
|
||||
run: |
|
||||
make defconfig
|
||||
sed -i 's/CONFIG_LUCI_JSMIN=y/CONFIG_LUCI_JSMIN=n/g' .config
|
||||
sed -i 's/CONFIG_LUCI_CSSTIDY=y/CONFIG_LUCI_CSSTIDY=n/g' .config
|
||||
grep -q '^CONFIG_LUCI_CSSTIDY=' .config || echo 'CONFIG_LUCI_CSSTIDY=n' >> .config
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Show config
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-zapret2
|
||||
PKG_VERSION:=0.9.20260128
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.9.20260130
|
||||
PKG_RELEASE:=2
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
||||
|
||||
|
||||
102
zapret2/Makefile
102
zapret2/Makefile
@@ -5,8 +5,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret2
|
||||
PKG_VERSION:=0.9.20260128
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.9.20260130
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
PKG_LICENSE:=MIT
|
||||
@@ -14,30 +14,45 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret2.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c8722d1ed9ac58561dd555b1c5b205e2f5f62432
|
||||
PKG_SOURCE_DATE:=2026-01-28
|
||||
PKG_SOURCE_VERSION:=27d387c76dd3a356a284b2875d5787a3b4d3cb4e
|
||||
PKG_SOURCE_DATE:=2026-01-30
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret2/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
#PKG_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
LUA_JIT?=1
|
||||
|
||||
ifeq ($(LUA_JIT),1)
|
||||
LUAJIT_VER?=2.1
|
||||
LUA_VER?=5.1
|
||||
LUA_DEPEND:=luajit
|
||||
LUA_INCLUDE:=-I$(STAGING_DIR)/usr/include/luajit-$(LUAJIT_VER)
|
||||
LUA_LIBRARY:=-L$(STAGING_DIR)/usr/lib -lluajit-$(LUA_VER)
|
||||
LUA_DEPEND:=
|
||||
LUAJIT_VER?=2.1
|
||||
ifeq ($(ARCH),riscv64)
|
||||
LUAJIT_URL:=https://github.com/infiWang/luajit2/archive
|
||||
LAUJIT_BRANCH:=v2.1-20260114-riscv64
|
||||
LUAJIT_COMMIT=4d8cf882a3a4ed3259407ad78614a60b02dd553f
|
||||
LUAJIT_RELEASE:=2.1-20260114-$(LUAJIT_COMMIT)
|
||||
LUAJIT_URL_FILE:=$(LUAJIT_COMMIT).tar.gz
|
||||
else
|
||||
LUAJIT_URL:=https://github.com/openresty/luajit2/archive/refs/tags
|
||||
LUAJIT_RELEASE:=2.1-20250826
|
||||
LUAJIT_URL_FILE:=v$(LUAJIT_RELEASE).tar.gz
|
||||
endif
|
||||
LUAJIT_TGZ:=$(PKG_NAME)-luajit-$(LUAJIT_RELEASE).tar.gz
|
||||
LUASRC_DIR:=$(PKG_BUILD_DIR)/luajit-$(LUAJIT_RELEASE)
|
||||
LUAOUT_DIR:=$(PKG_BUILD_DIR)/luajit-out
|
||||
LUA_INCLUDE:=-I$(LUAOUT_DIR)/include/luajit-$(LUAJIT_VER)
|
||||
LUA_LIBRARY:=-L$(LUAOUT_DIR)/lib -lluajit-$(LUA_VER)
|
||||
else
|
||||
LUA_VER?=5.5
|
||||
LUA_DEPEND:=lua$(LUA_VER)
|
||||
LUA_VER?=5.4
|
||||
LUA_DEPEND:= +lua$(LUA_VER)
|
||||
LUA_INCLUDE:=-I$(STAGING_DIR)/usr/include/lua$(LUA_VER)
|
||||
LUA_LIBRARY:=-L$(STAGING_DIR)/usr/lib -llua$(LUA_VER)
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
#TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
|
||||
#TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
||||
|
||||
@@ -49,23 +64,74 @@ define Package/$(PKG_NAME)
|
||||
TITLE:=$(PKG_NAME)
|
||||
SUBMENU:=Zapret2
|
||||
URL:=https://github.com/bol-van/zapret2
|
||||
DEPENDS:= +nftables +curl +gzip +$(LUA_DEPEND)
|
||||
DEPENDS:= +nftables +curl +gzip $(LUA_DEPEND)
|
||||
DEPENDS+= +coreutils +coreutils-sort +coreutils-sleep
|
||||
DEPENDS+= +kmod-nft-nat +kmod-nft-offload +kmod-nft-queue
|
||||
DEPENDS+= +libnetfilter-queue +libcap +zlib
|
||||
DEPENDS+= +libnetfilter-queue +libmnl +libcap +zlib
|
||||
endef
|
||||
|
||||
ifeq ($(LUA_JIT),1)
|
||||
define Download/$(PKG_NAME)-luajit
|
||||
FILE:=$(LUAJIT_TGZ)
|
||||
URL:=$(LUAJIT_URL)
|
||||
URL_FILE:=$(LUAJIT_URL_FILE)
|
||||
HASH:=skip
|
||||
endef
|
||||
$(eval $(call Download,$(PKG_NAME)-luajit))
|
||||
endif
|
||||
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
rm -f $(PKG_BUILD_DIR)/$(MAKE_PATH)/nfqws2
|
||||
rm -f $(PKG_BUILD_DIR)/ip2net/ip2net
|
||||
rm -f $(PKG_BUILD_DIR)/mdig/mdig
|
||||
if [ "$(LUA_JIT)" = 1 ]; then \
|
||||
if [ ! -f "$(DL_DIR)/$(LUAJIT_TGZ)" ]; then \
|
||||
echo "ERROR: LuaJIT tarball not found:"; \
|
||||
echo " $(LUAJIT_TGZ)"; \
|
||||
echo "Run: make package/$(PKG_NAME)/download"; \
|
||||
false; \
|
||||
fi ; \
|
||||
rm -rf $(LUASRC_DIR) ; \
|
||||
mkdir -p $(LUASRC_DIR) ; \
|
||||
tar -xzf "$(DL_DIR)/$(LUAJIT_TGZ)" --strip-components=1 -C "$(LUASRC_DIR)" ; \
|
||||
rm -rf $(LUAOUT_DIR) ; \
|
||||
fi
|
||||
endef
|
||||
|
||||
#define Build/Configure
|
||||
#endef
|
||||
|
||||
ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH), x86_64 mips64))
|
||||
ifeq ($(CONFIG_ARCH_64BIT),)
|
||||
HOST_BITS := -m32
|
||||
endif
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
if [ "$(LUA_JIT)" = 1 ]; then \
|
||||
$(MAKE) $(PKG_JOBS) -C $(LUASRC_DIR) \
|
||||
HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
|
||||
CROSS="$(TARGET_CROSS)" \
|
||||
XCFLAGS="-DLUAJIT_DISABLE_FFI" \
|
||||
TARGET_CFLAGS="-Os -s -flto=auto $(TARGET_CFLAGS)" \
|
||||
TARGET_AR="$(TARGET_AR) rcus" \
|
||||
BUILDMODE=static \
|
||||
DESTDIR=$(LUAOUT_DIR) \
|
||||
PREFIX= \
|
||||
TARGET_SYS=Linux ; \
|
||||
rm -rf $(LUAOUT_DIR) ; \
|
||||
if [ ! -f $(LUASRC_DIR)/src/libluajit.a ]; then \
|
||||
echo "ERROR: file libluajit.a not found!"; \
|
||||
false; \
|
||||
fi ; \
|
||||
mkdir -p $(LUAOUT_DIR) ; \
|
||||
$(MAKE) -C $(LUASRC_DIR) \
|
||||
DESTDIR=$(LUAOUT_DIR) \
|
||||
PREFIX= \
|
||||
TARGET_SYS=Linux \
|
||||
install ; \
|
||||
fi
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) $(TARGET_CONFIGURE_OPTS) LUA_JIT=$(LUA_JIT) LUA_CFLAGS="$(LUA_INCLUDE)" LUA_LIB="$(LUA_LIBRARY)"
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/ip2net $(TARGET_CONFIGURE_OPTS)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/mdig $(TARGET_CONFIGURE_OPTS)
|
||||
@@ -197,7 +263,7 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
$${ZAPRET_INITD} running && $${ZAPRET_INITD} stop >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
if $${PKG_CHECK} zapret2 >/dev/null 2>&1; then
|
||||
if $${PKG_CHECK} zapret2 2>/dev/null | grep -q . ; then
|
||||
if [ ! -f "/opt/zapret2/sync_config.sh" ]; then
|
||||
echo "Please uninstall incompatible \"zapret2\" package!"
|
||||
exit 47
|
||||
@@ -207,7 +273,7 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
exit 48
|
||||
fi
|
||||
fi
|
||||
if $${PKG_CHECK} luci-app-zapret2 >/dev/null 2>&1; then
|
||||
if $${PKG_CHECK} luci-app-zapret2 2>/dev/null | grep -q . ; then
|
||||
SVC_FILE=/www/luci-static/resources/view/zapret2/service.js
|
||||
if [ ! -f "$${SVC_FILE}" ] || ! grep -Fq "/remittor/zapret-openwrt" "$${SVC_FILE}"; then
|
||||
echo "Please uninstall incompatible \"luci-app-zapret2\" package!"
|
||||
@@ -223,10 +289,10 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
[ -d "$${ZAPRET_DIR}" ] && rm -rf $${ZAPRET_DIR}
|
||||
echo "All files of the previously installed package have been removed!"
|
||||
fi
|
||||
if $${PKG_CHECK} zapret2-mdig >/dev/null 2>&1; then
|
||||
if $${PKG_CHECK} zapret2-mdig 2>/dev/null | grep -q . ; then
|
||||
$${PKG_REMOVE} zapret2-mdig
|
||||
fi
|
||||
if $${PKG_CHECK} zapret2-ip2net >/dev/null 2>&1; then
|
||||
if $${PKG_CHECK} zapret2-ip2net 2>/dev/null | grep -q . ; then
|
||||
$${PKG_REMOVE} zapret2-ip2net
|
||||
fi
|
||||
if [ ! -d "$${ZAPRET_DIR}" ]; then
|
||||
|
||||
@@ -211,7 +211,7 @@ function set_cfg_nfqws_strat
|
||||
--new
|
||||
--filter-tcp=443
|
||||
--filter-l3=ipv4
|
||||
--filter-l7=tls <HOSTLIST_AUTO>
|
||||
--filter-l7=tls <HOSTLIST>
|
||||
--out-range=-s34228
|
||||
--in-range=-s5556 --lua-desync=circular:fails=2:maxtime=60
|
||||
--in-range=x
|
||||
|
||||
@@ -76,7 +76,7 @@ TEST_SUITE='
|
||||
{ id: "US.CF-04", provider: "🇨🇦 Cloudflare", times: 1, url: "https://www.bigcartel.com/" },
|
||||
{ id: "US.DO-01", provider: "🇺🇸 DigitalOcean", times: 2, url: "https://genderize.io/" },
|
||||
{ id: "DE.HE-01", provider: "🇩🇪 Hetzner", times: 1, url: "https://j.dejure.org/jcg/doctrine/doctrine_banner.webp" },
|
||||
{ id: "DE.HE-02", provider: "🇩🇪 Hetzner", times: 1, url: "https://maps.gnosis.earth/ogcapi/api/swagger-ui/swagger-ui-standalone-preset.js#" },
|
||||
{ id: "DE.HE-02", provider: "🇩🇪 Hetzner", times: 1, url: "https://accesorioscelular.com/tienda/css/plugins.css" },
|
||||
{ id: "FI.HE-01", provider: "🇫🇮 Hetzner", times: 1, url: "https://251b5cd9.nip.io/1MB.bin" },
|
||||
{ id: "FI.HE-02", provider: "🇫🇮 Hetzner", times: 1, url: "https://nioges.com/libs/fontawesome/webfonts/fa-solid-900.woff2" },
|
||||
{ id: "FI.HE-03", provider: "🇫🇮 Hetzner", times: 1, url: "https://5fd8bdae.nip.io/1MB.bin" },
|
||||
@@ -92,7 +92,7 @@ TEST_SUITE='
|
||||
{ id: "US.AKM-01", provider: "🇺🇸 Akamai", times: 1, url: "https://www.roxio.com/static/roxio/images/products/creator/nxt9/call-action-footer-bg.jpg" },
|
||||
{ id: "PL.AKM-01", provider: "🇵🇱 Akamai", times: 1, url: "https://media-assets.stryker.com/is/image/stryker/gateway_1?$max_width_1410$" },
|
||||
{ id: "US.CDN77-01", provider: "🇺🇸 CDN77", times: 1, url: "https://cdn.eso.org/images/banner1920/eso2520a.jpg" },
|
||||
{ id: "FR.CNTB-01", provider: "🇫🇷 Contabo", times: 1, url: "https://airsea.no/images/main_logo.png" },
|
||||
{ id: "FR.CNTB-01", provider: "🇫🇷 Contabo", times: 1, url: "https://xdmarineshop.gr/index.php?route=index" },
|
||||
{ id: "NL.SW-01", provider: "🇳🇱 Scaleway", times: 1, url: "https://www.velivole.fr/img/header.jpg" },
|
||||
{ id: "US.CNST-01", provider: "🇺🇸 Constant", times: 1, url: "https://cdn.xuansiwei.com/common/lib/font-awesome/4.7.0/fontawesome-webfont.woff2?v=4.7.0" }
|
||||
'
|
||||
|
||||
@@ -89,6 +89,16 @@ fi
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
|
||||
function check_pkg_installed
|
||||
{
|
||||
local pkg_name="$1"
|
||||
if [ "$PKG_MGR" = apk ]; then
|
||||
apk info -e "$pkg_name" >/dev/null 2>&1;
|
||||
else
|
||||
opkg status "$pkg_name" 2>/dev/null | grep -q .
|
||||
fi
|
||||
}
|
||||
|
||||
function get_distrib_param
|
||||
{
|
||||
local parname=$1
|
||||
@@ -475,7 +485,7 @@ if [ "$opt_update" != "" ]; then
|
||||
mkdir $ZAP_PKG_DIR
|
||||
ZAP_PKG_FN="$ZAP_PKG_DIR/${ZAP_PKG_URL##*/}"
|
||||
echo "Download ZIP-file..."
|
||||
curl -s -L --max-time 15 -H "$CURL_HEADER2" "$ZAP_PKG_URL" -o "$ZAP_PKG_FN"
|
||||
curl -s -L --retry 5 --retry-delay 1 --retry-max-time 55 --retry-all-errors --max-time 30 -H "$CURL_HEADER2" "$ZAP_PKG_URL" -o "$ZAP_PKG_FN"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: cannot download package!"
|
||||
return 215
|
||||
@@ -529,11 +539,11 @@ if [ "$opt_update" != "" ]; then
|
||||
if [ "$opt_forced" = true ]; then
|
||||
pkg_mgr_update
|
||||
fi
|
||||
if ${PKG_CHECK} ${ZAPRET_CFG_NAME}-mdig >/dev/null 2>&1; then
|
||||
if check_pkg_installed ${ZAPRET_CFG_NAME}-mdig; then
|
||||
echo "Uninstall mdig..."
|
||||
${PKG_REMOVE} ${ZAPRET_CFG_NAME}-mdig
|
||||
fi
|
||||
if ${PKG_CHECK} ${ZAPRET_CFG_NAME}-ip2net >/dev/null 2>&1; then
|
||||
if check_pkg_installed ${ZAPRET_CFG_NAME}-ip2net; then
|
||||
echo "Uninstall ip2net..."
|
||||
${PKG_REMOVE} ${ZAPRET_CFG_NAME}-ip2net
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user