🤞 Sync 2022-02-07 17:51:46

This commit is contained in:
github-actions[bot] 2022-02-07 17:51:46 +08:00
parent d374efd3bb
commit 9f90959a41
4112 changed files with 1997294 additions and 0 deletions

View File

@ -0,0 +1,76 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic-Go
PKG_VERSION:=0.2.13
PKG_RELEASE:=
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/cnsilvan/UnblockNeteaseMusic.git
PKG_SOURCE_VERSION:=2479ad75f8fbfe7cfdd7d86ebe330013dcb6a372
PKG_HASH:=72b28cc22bfdfb1810e50c307ce00cbc124d55a7d10fe7c510227dfe1efa76bc
PKG_MAINTAINER:=Silvan <cnsilvan@gmail.com>
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/cnsilvan/UnblockNeteaseMusic
GO_PKG_LDFLAGS:=-s -w
GO_PKG_LDFLAGS_X:= \
$(GO_PKG)/version.Version=$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)/config
config $(PKG_NAME)_INCLUDE_GOPROXY
bool "Compiling with GOPROXY proxy"
default y
endef
ifeq ($(CONFIG_$(PKG_NAME)_INCLUDE_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.io
#export GOPROXY=https://mirrors.aliyun.com/goproxy/
endif
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Revive Netease Cloud Music (Golang)
DEPENDS:=$(GO_ARCH_DEPENDS)
URL:=https://github.com/cnsilvan/UnblockNeteaseMusic
SUBMENU:=NeteaseMusic
endef
define Package/$(PKG_NAME)/description
Revive Netease Cloud Music (Golang)
endef
define Build/Prepare
tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(BUILD_DIR)/$(PKG_NAME) --strip-components 1
endef
define Build/Configure
endef
define Build/Compile
$(eval GO_PKG_BUILD_PKG:=$(GO_PKG))
$(call GoPackage/Build/Configure)
$(call GoPackage/Build/Compile)
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/UnblockNeteaseMusic $(1)/usr/bin/UnblockNeteaseMusic
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusicGo
$(CP) ./files/* $(1)/usr/share/UnblockNeteaseMusicGo/
endef
$(eval $(call GoBinPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICIjCCAaigAwIBAgIUTc9HQDej5hLCQ74u436a5yE4MDcwCgYIKoZIzj0EAwMw
SDELMAkGA1UEBhMCQ04xJDAiBgNVBAMMG1VuYmxvY2tOZXRlYXNlTXVzaWMgUm9v
dCBDQTETMBEGA1UECgwKMTcxNTE3MzMyOTAeFw0yMTA0MzAwNzIzMDJaFw0yNjA0
MjkwNzIzMDJaMEgxCzAJBgNVBAYTAkNOMSQwIgYDVQQDDBtVbmJsb2NrTmV0ZWFz
ZU11c2ljIFJvb3QgQ0ExEzARBgNVBAoMCjE3MTUxNzMzMjkwdjAQBgcqhkjOPQIB
BgUrgQQAIgNiAASIyI7lYgGlq49qWtY1O2/XNDeowYf7W/Z+l7C14bphxAJ9jSDo
tLwbFPWy5VPENc0rB0/yeHA2z7LU67POL2gGgp+17y7scLkkBk3Q7wRMETrtP44Z
ITBstZ0wzVyyQEKjUzBRMB0GA1UdDgQWBBQ2F7+t8cPHJaWuCD8RHTSdLugKYzAf
BgNVHSMEGDAWgBQ2F7+t8cPHJaWuCD8RHTSdLugKYzAPBgNVHRMBAf8EBTADAQH/
MAoGCCqGSM49BAMDA2gAMGUCMQDqaRX2e01e0U+f0As/KUKDhmG5ElkK5CjYK9jk
kXLNGFXJLGta6CDvjtMLBPc20qkCMBvDs+JnJKVBEJNZVsRBBs+v2YxNU/u2aYJa
dMwXuFveSDWOS7mBeRztX/geEggiSw==
-----END CERTIFICATE-----

View File

@ -0,0 +1,15 @@
-----BEGIN CERTIFICATE-----
MIICRDCCAcqgAwIBAgIUeVqRrT2mHG5Mc8JD+ErphiAmlgkwCgYIKoZIzj0EAwMw
SDELMAkGA1UEBhMCQ04xJDAiBgNVBAMMG1VuYmxvY2tOZXRlYXNlTXVzaWMgUm9v
dCBDQTETMBEGA1UECgwKMTcxNTE3MzMyOTAeFw0yMTA0MzAwNzIzMDJaFw0yMjA0
MzAwNzIzMDJaMHsxCzAJBgNVBAYTAkNOMREwDwYDVQQHDAhIYW5nemhvdTEsMCoG
A1UECgwjTmV0RWFzZSAoSGFuZ3pob3UpIE5ldHdvcmsgQ28uLCBMdGQxETAPBgNV
BAsMCElUIERlcHQuMRgwFgYDVQQDDA8qLm11c2ljLjE2My5jb20wdjAQBgcqhkjO
PQIBBgUrgQQAIgNiAAQTPyU9RQ1pAFMLmozi+c4pEC1rrxAlPGwO9Em+qV+a5qLW
gQjjsJeabMqJ/UQ7hDtdKVxWuXiAjMiDcXwL63I71MZKPTAEKXdCmNQwb4kXvRUn
oOR4r7BMxEpGlf0CULWjQjBAMBMGA1UdJQQMMAoGCCsGAQUFBwMBMCkGA1UdEQQi
MCCCDW11c2ljLjE2My5jb22CDyoubXVzaWMuMTYzLmNvbTAKBggqhkjOPQQDAwNo
ADBlAjEAs5bdgnNP/DiK919RiWscC0kyuY0ugG1C8m8F2Yod4MI3oTyrkVcag21o
NSzm802uAjBoPuKEbjjFP4ics0BQdICiVd6WCVAsE69FnlmqRteAJqxvdKGpVLi+
Qi3arfomrrc=
-----END CERTIFICATE-----

View File

@ -0,0 +1,9 @@
-----BEGIN EC PARAMETERS-----
BgUrgQQAIg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MIGkAgEBBDBfW3twxGaQmMzP9p0/UU5EvHFVCbBw4piVFJ+pm/uFY6CKZkC5LGMa
Uc9vn/KiewGgBwYFK4EEACKhZANiAAQTPyU9RQ1pAFMLmozi+c4pEC1rrxAlPGwO
9Em+qV+a5qLWgQjjsJeabMqJ/UQ7hDtdKVxWuXiAjMiDcXwL63I71MZKPTAEKXdC
mNQwb4kXvRUnoOR4r7BMxEpGlf0CULU=
-----END EC PRIVATE KEY-----

View File

@ -0,0 +1,52 @@
# SPDX-Identifier-License: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic
PKG_BASE_VERSION:=0.27.0-rc.4
PKG_RELEASE:=
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/UnblockNeteaseMusic/server.git
PKG_SOURCE_DATE:=2021-12-21
PKG_SOURCE_VERSION:=54b7a60b07a85dea3b52a5d9f1ada456aba12609
PKG_MIRROR_HASH:=1865a01021ced0a57bcb1f0d63ef72b0e517771602ad7e4026d18222713a77ac
PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))
PKG_LICENSE:=LGPL-3.0-only
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
include $(INCLUDE_DIR)/package.mk
define Package/UnblockNeteaseMusic
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE:=Revive Netease Cloud Music (NodeJS)
URL:=https://github.com/nondanee/UnblockNeteaseMusic
DEPENDS:=+node
PKGARCH:=all
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
xzcat $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
endef
define Build/Configure
echo -e $(PKG_BASE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/core_ver
echo -e $(PKG_SOURCE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/local_ver
endef
define Build/Compile
endef
define Package/UnblockNeteaseMusic/install
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusic
$(CP) $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/* $(1)/usr/share/UnblockNeteaseMusic
endef
$(eval $(call BuildPackage,UnblockNeteaseMusic))

76
adbyby/Makefile Normal file
View File

@ -0,0 +1,76 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=adbyby
PKG_VERSION:=2.7
PKG_RELEASE:=
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Powerful adblock module to block ad.
DEPENDS:=@(i386||x86_64||arm||mipsel||mips||aarch64)
URL:=http://www.adbyby.com/
endef
define Package/$(PKG_NAME)/description
Adbyby is a powerful adblock module to block ad,just like adblock.
endef
ifeq ($(ARCH),x86_64)
ADBYBY_DIR:=amd64
endif
ifeq ($(ARCH),mipsel)
ADBYBY_DIR:=mipsle
endif
ifeq ($(ARCH),mips)
ADBYBY_DIR:=mips
endif
ifeq ($(ARCH),i386)
ADBYBY_DIR:=x86
endif
ifeq ($(ARCH),arm)
ADBYBY_DIR:=armv7
ifeq ($(BOARD),bcm53xx)
ADBYBY_DIR:=arm
endif
ifeq ($(BOARD),kirkwood)
ADBYBY_DIR:=arm
endif
endif
ifeq ($(ARCH),aarch64)
ADBYBY_DIR:=armv7
endif
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/share/adbyby
$(INSTALL_BIN) ./files/adbyby.sh $(1)/usr/share/adbyby/
$(INSTALL_CONF) ./files/adhook.ini $(1)/usr/share/adbyby/
$(INSTALL_CONF) ./files/user.action $(1)/usr/share/adbyby/
$(INSTALL_DIR) $(1)/usr/share/adbyby/data
$(INSTALL_DATA) ./files/data/* $(1)/usr/share/adbyby/data/
$(INSTALL_DIR) $(1)/usr/share/adbyby/doc
$(INSTALL_DATA) ./files/doc/* $(1)/usr/share/adbyby/doc/
$(INSTALL_BIN) ./files/$(ADBYBY_DIR)/adbyby $(1)/usr/share/adbyby/adbyby
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

16
adbyby/files/adbyby.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
err=0
until [ $err -ge 5 ]; do
if [ -n "$(pgrep $PROG_PATH/adbyby)" ]; then
iptables-save | grep ADBYBY >/dev/null || \
/etc/init.d/adbyby add_rule
sleep 10
err=0
else
$PROG_PATH/adbyby --no-daemon &>/dev/null &
sleep 1
err=$((err+1))
fi
done
/etc/init.d/adbyby del_rule

14
adbyby/files/adhook.ini Normal file
View File

@ -0,0 +1,14 @@
[cfg]
### 2.1 ###
listen-address=0.0.0.0:8118
buffer-limit=1024
keep-alive-timeout=30
socket-timeout=60
### 2.5 ###
max_client_connections=0
### 2.6 ###
stack_size=200
auto_restart=0
### 2.7 ###
debug=0
ipset=0

BIN
adbyby/files/amd64/adbyby Executable file

Binary file not shown.

BIN
adbyby/files/arm/adbyby Executable file

Binary file not shown.

BIN
adbyby/files/armv7/adbyby Executable file

Binary file not shown.

BIN
adbyby/files/data/lazy.bin Normal file

Binary file not shown.

View File

@ -0,0 +1,25 @@
! -----¸üÐÂʱ¼ä: 2018-10-08 23:07:52 by:xwhyc-----
.php?ad=
/99rejs/js
/agetsou.js^
/c@*!25.js|$script
/cococ-66/$script
/defaultts.tc.qq.com/*.ts?index=0&start=0&
/defaultts.tc.qq.com/*.ts?index=0&start=0&end=*&ver=4
/gg_js/
/imgs.js?t=
/js/adtop.js|
/js/guanggao_gg.js?d=
/js/sss/ad.js
/static/js/aall.js
/unionjs/$script
/variety.tc.qq.com/*.mp4^*fmt=hd
/variety.tc.qq.com/*.mp4^*fmt=shd
/video.dispatch.tc.qq.com/*.mp4^*sdtfrom=
/view/image/QT_HY.jpg?t=
/view/js/slade.js|$script
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=hd
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=shd
/vmind.qqvideo.tc.qq.com/*.mp4^*sdtfrom=
/vmindhls.tc.qq.com/*ugc=0&ga=0&gv=0&start=
/zzhzgg.js

View File

@ -0,0 +1,15 @@
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
! -------------- 规则基于abp规则并进行了字符替换部分的扩展-----------------------------
! ABP规则请参考https://adblockplus.org/zh_CN/filters下面为大致摘要
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
! "*" 为字符通配符能够匹配0长度或任意长度的字符串该通配符不能与正则语法混用。
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
! "|" 为管线符号,来表示地址的最前端或最末端
! "||" 为子域通配符,方便匹配主域名下的所有子域。
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
! "##" 为元素选择器标识符后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
!! 元素隐藏暂不支持全局规则和排除规则
!! 字符替换扩展
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
! 支持通配符*和?
! -------------------------------------------------------------------------------------------

View File

View File

@ -0,0 +1,30 @@
! -----更新时间: 2018-10-08 23:06:11 by:xwhyc-----------------------------------------------
! -----广告反馈:http://www.adbyby.com/help.htm QQ群: 79547134(满), 364066294(满)470705224(满)534897434,438394572--------------
!-------------------------------------------
/showadv/
3199.cn###ad640,[id^="ad0"]
76fengyun.com###down_box{display:block!important;}.gggg,.ggao
9553.com##[class="zm"]
962.net##.show_ad,.g-962-ad
amazon.cn##.adv-float-div
downsx.rocks##.adbox,.Left-ad3_fixed,.google-ad2_fixed
edu-acc.cn###doyoo_monitor
fx678.com##[class^="adv-"]
||76fengyun.com/body22233.js
||76fengyun.com/file/$s@onclick="window.open('*');startWait();"@onclick="window.open(document.getElementById('downpage_link').href);startWait();"@
||atanx.alicdn.com/t/tanxssp.js?_v=
||biquguan.com/guan/$script
||djv99sxoqpv11.cloudfront.net
||jmxlaser.com
||jump2.bdimg.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
||nxkycx.com
||res.jklan.cn/wp-content/themes/tt/js/system.js?ver=$s@function goto()@function xxx()@
||tieba.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
||ychap.com
!-----------------------
/qkostn.js|
|http://mark.l.qq.com/fcgi-bin/get_video_mark_all*&strAdParam=
!---------adbyby---------

File diff suppressed because one or more lines are too long

BIN
adbyby/files/mips/adbyby Executable file

Binary file not shown.

BIN
adbyby/files/mipsle/adbyby Executable file

Binary file not shown.

10
adbyby/files/update.info Normal file
View File

@ -0,0 +1,10 @@
;¸üйæÔòurl,dir,size,reverse,reverse
http://update.adbyby.com/rule3/lazy.jpg \data\lazy.txt 385337 4 0
http://update.adbyby.com/rule3/video.jpg \data\video.txt 1028 4 0
http://update.adbyby.com/rule3/user.action \user.action 512 5 0
http://update.adbyby.com/rule3/clean.ini \data\clean.ini 2167 0 0
http://update.adbyby.com/rule3/adclear.ini \data\adclear.ini 4901 0 0
https://github.com/gchangchen/suho/raw/master/adhook.dll \adhook.dll 117248 0 0 2.4.3.2
https://github.com/gchangchen/suho/raw/master/adhook64.dll \adhook64.dll 142848 0 0 2.4.3.2
https://github.com/gchangchen/suho/raw/master/adbyby.exe \adbyby.exe 1004183 1 0 2.4.4.0

0
adbyby/files/user.action Normal file
View File

BIN
adbyby/files/x86/adbyby Executable file

Binary file not shown.

77
aliyundrive-fuse/Makefile Normal file
View File

@ -0,0 +1,77 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=aliyundrive-fuse
PKG_VERSION:=0.1.6
PKG_RELEASE:=
PKG_LICENSE:=MIT
PKG_MAINTAINER:=messense <messense@icloud.com>
PKG_LIBC:=musl
ifeq ($(ARCH),arm)
PKG_LIBC:=musleabi
ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
ifneq ($(filter $(ARM_CPU_FEATURES),vfp vfpv2),)
PKG_LIBC:=musleabihf
endif
endif
PKG_ARCH=$(ARCH)
ifeq ($(ARCH),i386)
PKG_ARCH:=i686
endif
PKG_SOURCE:=aliyundrive-fuse-v$(PKG_VERSION).$(PKG_ARCH)-unknown-linux-$(PKG_LIBC).tar.gz
PKG_SOURCE_URL:=https://github.com/messense/aliyundrive-fuse/releases/download/v$(PKG_VERSION)/
PKG_HASH:=skip
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=multimedia
CATEGORY:=Multimedia
DEPENDS:=+fuse-utils
TITLE:=FUSE for AliyunDrive
URL:=https://github.com/messense/aliyundrive-fuse
endef
define Package/$(PKG_NAME)/description
FUSE for AliyunDrive.
endef
define Package/$(PKG_NAME)/conffiles
/etc/config/aliyundrive-fuse
endef
define Download/sha256sum
FILE:=$(PKG_SOURCE).sha256
URL_FILE:=$(FILE)
URL:=$(PKG_SOURCE_URL)
HASH:=skip
endef
$(eval $(call Download,sha256sum))
define Build/Prepare
mv $(DL_DIR)/$(PKG_SOURCE).sha256 .
cp $(DL_DIR)/$(PKG_SOURCE) .
shasum -a 256 -c $(PKG_SOURCE).sha256
rm $(PKG_SOURCE).sha256 $(PKG_SOURCE)
tar -C $(PKG_BUILD_DIR)/ -zxf $(DL_DIR)/$(PKG_SOURCE)
endef
define Build/Compile
echo "$(PKG_NAME) using precompiled binary."
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/aliyundrive-fuse $(1)/usr/bin/aliyundrive-fuse
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/aliyundrive-fuse.init $(1)/etc/init.d/aliyundrive-fuse
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/aliyundrive-fuse.config $(1)/etc/config/aliyundrive-fuse
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,7 @@
config default
option enable '0'
option debug '0'
option refresh_token ''
option domain_id ''
option mount_point '/mnt/aliyundrive'
option read_buffer_size '10485760'

View File

@ -0,0 +1,48 @@
#!/bin/sh /etc/rc.common
USE_PROCD=1
START=99
STOP=15
NAME=aliyundrive-fuse
uci_get_by_type() {
local ret=$(uci get $NAME.@$1[0].$2 2>/dev/null)
echo ${ret:=$3}
}
start_service() {
local enable=$(uci_get_by_type default enable)
case "$enable" in
1|on|true|yes|enabled)
local refresh_token=$(uci_get_by_type default refresh_token)
local domain_id=$(uci_get_by_type default domain_id)
local mount_point=$(uci_get_by_type default mount_point)
local read_buf_size=$(uci_get_by_type default read_buffer_size 10485760)
local extra_options=""
if [[ ! -z "$domain_id" ]]; then
extra_options="$extra_options --domain-id $domain_id"
fi
mkdir -p "$mount_point"
procd_open_instance
procd_set_param command /bin/sh -c "/usr/bin/$NAME $extra_options -S $read_buf_size --workdir /var/run/$NAME $mount_point >>/var/log/$NAME.log 2>&1"
procd_set_param pidfile /var/run/$NAME.pid
procd_set_param env REFRESH_TOKEN="$refresh_token"
case $(uci_get_by_type default debug) in
1|on|true|yes|enabled)
procd_append_param env RUST_LOG="aliyundrive_fuse=debug" ;;
*) ;;
esac
procd_close_instance ;;
*)
stop_service ;;
esac
}
service_triggers() {
procd_add_reload_trigger "aliyundrive-fuse"
}

View File

@ -0,0 +1,76 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=aliyundrive-webdav
PKG_VERSION:=1.2.2
PKG_RELEASE:=
PKG_LICENSE:=MIT
PKG_MAINTAINER:=messense <messense@icloud.com>
PKG_LIBC:=musl
ifeq ($(ARCH),arm)
PKG_LIBC:=musleabi
ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
ifneq ($(filter $(ARM_CPU_FEATURES),vfp vfpv2),)
PKG_LIBC:=musleabihf
endif
endif
PKG_ARCH=$(ARCH)
ifeq ($(ARCH),i386)
PKG_ARCH:=i686
endif
PKG_SOURCE:=aliyundrive-webdav-v$(PKG_VERSION).$(PKG_ARCH)-unknown-linux-$(PKG_LIBC).tar.gz
PKG_SOURCE_URL:=https://github.com/messense/aliyundrive-webdav/releases/download/v$(PKG_VERSION)/
PKG_HASH:=skip
include $(INCLUDE_DIR)/package.mk
define Package/aliyundrive-webdav
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE:=WebDAV server for AliyunDrive
URL:=https://github.com/messense/aliyundrive-webdav
endef
define Package/aliyundrive-webdav/description
WebDAV server for AliyunDrive.
endef
define Package/aliyundrive-webdav/conffiles
/etc/config/aliyundrive-webdav
endef
define Download/sha256sum
FILE:=$(PKG_SOURCE).sha256
URL_FILE:=$(FILE)
URL:=$(PKG_SOURCE_URL)
HASH:=skip
endef
$(eval $(call Download,sha256sum))
define Build/Prepare
mv $(DL_DIR)/$(PKG_SOURCE).sha256 .
cp $(DL_DIR)/$(PKG_SOURCE) .
shasum -a 256 -c $(PKG_SOURCE).sha256
rm $(PKG_SOURCE).sha256 $(PKG_SOURCE)
tar -C $(PKG_BUILD_DIR)/ -zxf $(DL_DIR)/$(PKG_SOURCE)
endef
define Build/Compile
echo "aliyundrive-webdav using precompiled binary."
endef
define Package/aliyundrive-webdav/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/aliyundrive-webdav $(1)/usr/bin/aliyundrive-webdav
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/aliyundrive-webdav.init $(1)/etc/init.d/aliyundrive-webdav
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/aliyundrive-webdav.config $(1)/etc/config/aliyundrive-webdav
endef
$(eval $(call BuildPackage,aliyundrive-webdav))

View File

@ -0,0 +1,17 @@
config server
option enable '0'
option debug '0'
option refresh_token ''
option host '0.0.0.0'
option port '8080'
option auth_user ''
option auth_password ''
option read_buffer_size '10485760'
option cache_size '1000'
option cache_ttl '600'
option root '/'
option no_trash '0'
option domain_id ''
option read_only '0'
option tls_cert ''
option tls_key ''

View File

@ -0,0 +1,75 @@
#!/bin/sh /etc/rc.common
USE_PROCD=1
START=99
STOP=15
NAME=aliyundrive-webdav
uci_get_by_type() {
local ret=$(uci get $NAME.@$1[0].$2 2>/dev/null)
echo ${ret:=$3}
}
start_service() {
local enable=$(uci_get_by_type server enable)
case "$enable" in
1|on|true|yes|enabled)
local refresh_token=$(uci_get_by_type server refresh_token)
local auth_user=$(uci_get_by_type server auth_user)
local auth_password=$(uci_get_by_type server auth_password)
local read_buf_size=$(uci_get_by_type server read_buffer_size 10485760)
local cache_size=$(uci_get_by_type server cache_size 1000)
local cache_ttl=$(uci_get_by_type server cache_ttl 600)
local host=$(uci_get_by_type server host 127.0.0.1)
local port=$(uci_get_by_type server port 8080)
local root=$(uci_get_by_type server root /)
local domain_id=$(uci_get_by_type server domain_id)
local tls_cert=$(uci_get_by_type server tls_cert)
local tls_key=$(uci_get_by_type server tls_key)
local extra_options="-I"
if [[ ! -z "$domain_id" ]]; then
extra_options="$extra_options --domain-id $domain_id"
else
case "$(uci_get_by_type server no_trash 0)" in
1|on|true|yes|enabled)
extra_options="$extra_options --no-trash"
;;
*) ;;
esac
case "$(uci_get_by_type server read_only 0)" in
1|on|true|yes|enabled)
extra_options="$extra_options --read-only"
;;
*) ;;
esac
fi
if [[ ! -z "$tls_cert" && ! -z "$tls_key" ]]; then
extra_options="$extra_options --tls-cert $tls_cert --tls-key $tls_key"
fi
procd_open_instance
procd_set_param command /bin/sh -c "/usr/bin/$NAME $extra_options --host $host --port $port --root $root -S $read_buf_size --cache-size $cache_size --cache-ttl $cache_ttl --workdir /var/run/$NAME >>/var/log/$NAME.log 2>&1"
procd_set_param pidfile /var/run/$NAME.pid
procd_set_param env REFRESH_TOKEN="$refresh_token"
[[ ! -z "$auth_user" ]] && procd_append_param env WEBDAV_AUTH_USER="$auth_user"
[[ ! -z "$auth_password" ]] && procd_append_param env WEBDAV_AUTH_PASSWORD="$auth_password"
case $(uci_get_by_type server debug) in
1|on|true|yes|enabled)
procd_append_param env RUST_LOG="aliyundrive_webdav=debug" ;;
*) ;;
esac
procd_close_instance ;;
*)
stop_service ;;
esac
}
service_triggers() {
procd_add_reload_trigger "aliyundrive-webdav"
}

58
antileech/Makefile Normal file
View File

@ -0,0 +1,58 @@
#
# Copyright (C) 2007-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=antileech
PKG_VERSION:=2.3.2
PKG_RELEASE:=
#PKG_SOURCE:=antileech-2.3.1.tar.gz
#PKG_SOURCE_URL:=@SF/amule
#PKG_MD5SUM:=a892a1cc00d03e943e03434d182fe73e
PKG_BUILD_DEPENDS:=libgd
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/antileech
SUBMENU:=P2P
SECTION:=net
CATEGORY:=Network
TITLE:=AntiLeech for amule
URL:=http://www.amule.org/
DEPENDS:=+libc +amule +libwxbase
endef
TARGET_LDFLAGS += \
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Configure
sed -i "s:^AC_CHECK_PROG.WXCONFIG,.*::g" $(PKG_BUILD_DIR)/configure.ac
sed -i "s:wx-config --cppflags:$(STAGING_DIR)/usr/bin/wx-config --cppflags:g" $(PKG_BUILD_DIR)/configure.ac
cd $(PKG_BUILD_DIR) && sh ./autogen.sh
$(call Build/Configure/Default)
endef
define Build/Compile
$(MAKE) -k -C $(PKG_BUILD_DIR) \
HOSTCC="$(HOSTCC)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
all install
endef
define Package/antileech/install
$(INSTALL_DIR) $(1)/usr/share/amule
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/amule/libantiLeech.so $(1)/usr/share/amule
endef
$(eval $(call BuildPackage,antileech))

View File

@ -0,0 +1,63 @@
/**
* Author: Bill Lee<bill.lee.y@gmail.com>
* License: GNU GPL
*/
//---------------------
#ifndef CSTRING_WX_H
#define CSTRING_WX_H
//#include <wx/wx.h>
#include <wx/string.h>
class CString : public wxString{
public:
CString(){}
CString(wxChar c, size_t n=1): wxString(c, n){}
CString(const wxChar* str): wxString(str){}
CString(const wxString& str): wxString(str){}
CString(const CString& str): wxString(str){}
//---------------------
CString& operator=(const wxChar* str){
wxString::operator=(str);
return *this;
}
//operator*() from wxString;
size_t GetLength()const{ return Length(); }
wxChar GetAt(size_t nIndex)const{ return GetChar(nIndex); }
//IsEmpty() from wxString;
CString& TrimLeft(wxChar c){
size_t pos = find_first_not_of(c);
if(pos == 0)
return *this;
erase(0, pos);
return *this;
}
CString& TrimRight(wxChar c){
size_t pos = find_last_not_of(c) + 1;
if(pos == Length())
return *this;
erase(pos, Length() - pos);
return *this;
}
CString Trim(){
CString ret(*this);
ret.wxString::Trim(false); /* wxString::Trim(bool fromright = true) */
ret.wxString::Trim(true);
return ret;
}
//Find(wxChar) and Find(wxChar*) from wxString;
int Find(const CString& str)const{ return wxString::Find(str.c_str()); }
int ReverseFind(const wxChar c)const{ return wxString::Find(c, true); }
int ReverseFind(const wxChar* str)const{ return rfind(str); }
int ReverseFind(const CString& str)const{ return rfind(str); }
CString Right(size_t len)const{ return wxString::Right(len); }
CString Left(size_t len)const{ return wxString::Left(len); }
#if wxCHECK_VERSION(2, 9, 0)
CString Mid(size_t first, size_t count = wxString::npos)const{
#else
CString Mid(size_t first, size_t count = wxSTRING_MAXLEN)const{
#endif
return wxString::Mid(first, count);
}
};
#endif

View File

@ -0,0 +1,28 @@
/*
* =====================================================================================
*
* Filename: Interface.cpp
*
* Description: A part of aMule DLP
*
* Created: 2011-02-24 19:49
*
* Author: Bill Lee , bill.lee.y@gmail.com
*
* Copyright (c) 2011, Bill Lee
* License: GNU General Public License
*
* =====================================================================================
*/
/* ##### HEADER FILE INCLUDES ################################################### */
#include "antiLeech.h"
/* ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################ */
extern "C" IantiLeech* createAntiLeechInstant(){
return new CantiLeech;
}
extern "C" int destoryAntiLeechInstant(IantiLeech* ptr){
delete ptr;
return 0;
}

16
antileech/src/Makefile.am Normal file
View File

@ -0,0 +1,16 @@
AUTOMAKE_OPTIONS = foreign
pkgdir = $(datadir)/amule
ACLOCAL_AMFLAGS = -I m4
pkg_LTLIBRARIES = libantiLeech.la
libantiLeech_la_CPPFLAGS = ${ANTILEECH_CPPFLAGS}
libantiLeech_la_LDFLAGS = ${ANTILEECH_LDFLAGS} -module -avoid-version --no-la-files
libantiLeech_la_SOURCES = \
antiLeech.h \
antiLeech_wx.h \
CString_wx.h \
antiLeech.cpp \
antiLeech_wx.cpp \
Interface.cpp

1599
antileech/src/antiLeech.cpp Normal file

File diff suppressed because it is too large Load Diff

161
antileech/src/antiLeech.h Normal file
View File

@ -0,0 +1,161 @@
#ifndef ANTILEECH_H
#define ANTILEECH_H
#pragma once
#include "antiLeech_wx.h"
#include "CString_wx.h"
class IantiLeech
{
public:
virtual ~IantiLeech(){}; /* Bill Lee: Not be used currently */
//BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD,LPVOID);
virtual DWORD GetDLPVersion() = 0;
//old versions to keep compatible
/* //drop old version support
virtual LPCTSTR DLPCheckModstring(LPCTSTR modversion, LPCTSTR clientversion);
virtual LPCTSTR DLPCheckUsername(LPCTSTR username);
virtual LPCTSTR DLPCheckNameAndHash(CString username, CString& userhash);
*/
//new versions
virtual LPCTSTR DLPCheckModstring_Hard(LPCTSTR modversion, LPCTSTR clientversion) = 0;
virtual LPCTSTR DLPCheckModstring_Soft(LPCTSTR modversion, LPCTSTR clientversion) = 0;
virtual LPCTSTR DLPCheckUsername_Hard(LPCTSTR username) = 0;
virtual LPCTSTR DLPCheckUsername_Soft(LPCTSTR username) = 0;
virtual LPCTSTR DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion) = 0;
virtual LPCTSTR DLPCheckMessageSpam(LPCTSTR messagetext) = 0;
virtual LPCTSTR DLPCheckUserhash(const PBYTE userhash) = 0;
virtual LPCTSTR DLPCheckHelloTag(UINT tagnumber) = 0;
virtual LPCTSTR DLPCheckInfoTag(UINT tagnumber) = 0;
//void TestFunc();
//Bill Lee: no need in interface abstract class
//private:
// static bool IsTypicalHex (const CString& addon);
};
//Bill Lee: never call delete on IantiLeech, use destoryAntiLeechInstat instead.
extern "C" IantiLeech* createAntiLeechInstant();
extern "C" int destoryAntiLeechInstant(IantiLeech*);
class CantiLeech: public IantiLeech
{
public:
//BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD,LPVOID);
virtual DWORD GetDLPVersion(){ return DLPVersion; }
//old versions to keep compatible
/* //drop old version support
virtual LPCTSTR DLPCheckModstring(LPCTSTR modversion, LPCTSTR clientversion);
virtual LPCTSTR DLPCheckUsername(LPCTSTR username);
virtual LPCTSTR DLPCheckNameAndHash(CString username, CString& userhash);
*/
//new versions
virtual LPCTSTR DLPCheckModstring_Hard(LPCTSTR modversion, LPCTSTR clientversion);
virtual LPCTSTR DLPCheckModstring_Soft(LPCTSTR modversion, LPCTSTR clientversion);
virtual LPCTSTR DLPCheckUsername_Hard(LPCTSTR username);
virtual LPCTSTR DLPCheckUsername_Soft(LPCTSTR username);
virtual LPCTSTR DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion);
virtual LPCTSTR DLPCheckMessageSpam(LPCTSTR messagetext);
virtual LPCTSTR DLPCheckUserhash(const PBYTE userhash);
virtual LPCTSTR DLPCheckHelloTag(UINT tagnumber);
virtual LPCTSTR DLPCheckInfoTag(UINT tagnumber);
//void TestFunc();
private:
static const DWORD DLPVersion;
static bool IsTypicalHex (const CString& addon);
};
//<<< new tags from eMule 0.04x
#define CT_UNKNOWNx0 0x00 // Hybrid Horde protocol
#define CT_UNKNOWNx12 0x12 // http://www.haspepapa-welt.de (DodgeBoards)
#define CT_UNKNOWNx13 0x13 // http://www.haspepapa-welt.de (DodgeBoards)
#define CT_UNKNOWNx14 0x14 // http://www.haspepapa-welt.de (DodgeBoards)
#define CT_UNKNOWNx15 0x15 // http://www.haspepapa-welt.de (DodgeBoards) & DarkMule |eVorte|X|
#define CT_UNKNOWNx16 0x16 // http://www.haspepapa-welt.de (DodgeBoards)
#define CT_UNKNOWNx17 0x17 // http://www.haspepapa-welt.de (DodgeBoards)
#define CT_UNKNOWNx4D 0x4D // pimp my mule (00de)
#define CT_UNKNOWNxE6 0xE6 // http://www.haspepapa-welt.de
#define CT_UNKNOWNx22 0x22 // DarkMule |eVorte|X|
#define CT_UNKNOWNx5D 0x5D // md4
#define CT_UNKNOWNx63 0x63 // ?
#define CT_UNKNOWNx64 0x64 // ?
#define CT_UNKNOWNx69 0x69 // eMuleReactor //Xman don't use this, it's webcache!
#define CT_UNKNOWNx6B 0x6B // md4
#define CT_UNKNOWNx6C 0x6C // md4
#define CT_UNKNOWNx74 0x74 // md4
#define CT_UNKNOWNx76 0x76 // www.donkey2002.to
#define CT_UNKNOWNx79 0x79 // Bionic
#define CT_UNKNOWNx7A 0x7A // NewDarkMule
#define CT_UNKNOWNx83 0x83 // Fusspi
#define CT_UNKNOWNx87 0x87 // md4
#define CT_UNKNOWNx88 0x88 // DarkMule v6 |eVorte|X|
#define CT_UNKNOWNx8c 0x8c // eMule v0.27c [LSD7c]
#define CT_UNKNOWNx8d 0x8d // unknown Leecher - (client version:60)
#define CT_UNKNOWNx94 0x94 // 00.de community //Xman 20.08.05
#define CT_UNKNOWNx97 0x97 // Emulereactor Community Mod
#define CT_UNKNOWNx98 0x98 // Emulereactor Community Mod
#define CT_UNKNOWNx99 0x99 // eMule v0.26d [RAMMSTEIN 8b]
#define CT_UNKNOWNx9C 0x9C // Emulereactor Community Mod
#define CT_UNKNOWNxbb 0xbb // emule.de (client version:60)
#define CT_UNKNOWNxc4 0xc4 //MD5 Community from new bionic - hello
#define CT_UNKNOWNxC8 0xc8 // MD5 Community from new bionic - hello //Xman x4
#define CT_UNKNOWNxCA 0xCA // NewDarkMule
#define CT_UNKNOWNxCD 0xCD // www.donkey2002.to
#define CT_UNKNOWNxCE 0xCE // FRZ community //Xman 20.08.05
#define CT_UNKNOWNxCF 0xCF // FRZ community //Xman 20.08.05
#define CT_UNKNOWNxDA 0xDA // Emulereactor Community Mod
#define CT_UNKNOWNxEC 0xec // SpeedMule and clones //Xman x4
#define CT_UNKNOWNxF0 0xF0 // Emulereactor Community Mod
#define CT_UNKNOWNxF4 0xF4 // Emulereactor Community Mod
#define CT_UNKNOWNxD2 0xD2 // Chinese Leecher //SquallATF
//#define CT_UNKNOWNx85 0x85 // viper-israel.org and eChanblardNext //zz_fly, viper become good
#define CT_FRIENDSHARING 0x66 //eWombat [SNAFU]
#define CT_DARK 0x54 //eWombat [SNAFU]
#define FRIENDSHARING_ID 0x5F73F1A0 // Magic Key, DO NOT CHANGE!
// unknown eMule tags
#define ET_MOD_UNKNOWNx12 0x12 // http://www.haspepapa-welt.de
#define ET_MOD_UNKNOWNx13 0x13 // http://www.haspepapa-welt.de
#define ET_MOD_UNKNOWNx14 0x14 // http://www.haspepapa-welt.de
#define ET_MOD_UNKNOWNx17 0x17 // http://www.haspepapa-welt.de
#define ET_MOD_UNKNOWNx2F 0x2F // eMule v0.30 [OMEGA v.07 Heiko]
#define ET_MOD_UNKNOWNx30 0x30 // aMule 1.2.0
#define ET_MOD_UNKNOWNx36 0x36 // eMule v0.26
#define ET_MOD_UNKNOWNx3C 0x3C // enkeyDev.6 / LamerzChoice 9.9a
#define ET_MOD_UNKNOWNx41 0x41 // CrewMod (pre-release mod based on Plus) identification
#define ET_MOD_UNKNOWNx42 0x42 // CrewMod (pre-release mod based on Plus) key verification
#define ET_MOD_UNKNOWNx43 0x43 // CrewMod (pre-release mod based on Plus) version info
#define ET_MOD_UNKNOWNx50 0x50 // Bionic 0.20 Beta]
#define ET_MOD_UNKNOWNx59 0x59 // emule 0.40 / eMule v0.30 [LSD.12e]
#define ET_MOD_UNKNOWNx5B 0x5B // eMule v0.26
#define ET_MOD_UNKNOWNx60 0x60 // eMule v0.30a Hunter.6 + eMule v0.26
#define ET_MOD_UNKNOWNx64 0x64 // LSD.9dT / Athlazan(0.29c)Alpha.3
#define ET_MOD_UNKNOWNx76 0x76 // http://www.haspepapa-welt.de (DodgeBoards)
#define ET_MOD_UNKNOWNx84 0x84 // eChanblardv3.2
#define ET_MOD_UNKNOWNx85 0x85 // ?
#define ET_MOD_UNKNOWNx86 0x86 // ?
#define ET_MOD_UNKNOWNx93 0x93 // ?
#define ET_MOD_UNKNOWNxA6 0xA6 // eMule v0.26
#define ET_MOD_UNKNOWNxB1 0xB1 // Bionic 0.20 Beta]
#define ET_MOD_UNKNOWNxB4 0xB4 // Bionic 0.20 Beta]
#define ET_MOD_UNKNOWNxC8 0xC8 // Bionic 0.20 Beta]
#define ET_MOD_UNKNOWNxC9 0xC9 // Bionic 0.20 Beta]
#define ET_MOD_UNKNOWNxDA 0xDA // Rumata (rus)(Plus v1f) - leecher mod?
//>>> eWombat [SNAFU_V3]
#undef __declspec
#endif

View File

@ -0,0 +1,25 @@
//Author: greensea <gs@bbxy.net>
#include "antiLeech_wx.h" //Modified by Bill Lee.
//Bug fixed by Orzogc Lee
LPCTSTR StrStrI(LPCTSTR haystack, LPCTSTR needle){
//Bill Lee: allocate wchar array on the stack
wchar_t haystacki[512];
wchar_t needlei[512];
int i = 0;
do{
haystacki[i] = towlower(haystack[i]);
if(i == 511)
break;
}while(haystack[i++]); //As haystacki is allocated on the stack, it wans't set 0. So the NULL needs to be copy.
i = 0;
do{
needlei[i] = towlower(needle[i]);
if(i == 511)
break;
}while(needle[i++]);
const wchar_t* ret = wcsstr(haystacki, needlei);
if(ret != NULL)
ret = ret - haystacki + haystack;
return ret;
}

View File

@ -0,0 +1,54 @@
#ifndef ANTILEECH_WX_H
#define ANTILEECH_WX_H
#include <wx/defs.h>
#include <string.h>
#include <wctype.h> // for towlower()
#define LPCTSTR const wxChar*
#define BOOL bool
//#define _T(var) wxT(var) //defined in wxWidgets
#define DWORD wxUint32
#define UINT wxUint16
#define WINAPI
#define HINSTANCE
#define LPVOID void*
#define PBYTE unsigned char*
#define TCHAR wxChar
#define _TINT wxInt32
#define SSIZE_T ptrdiff_t
#define StrCmpI _tcsicmp
#define _tcsicmp _wcsicmp
#define _istdigit(var) iswdigit(var)
#define _istcntrl(var) iswcntrl(var)
#define _istpunct(var) iswpunct(var)
#define _istspace(var) iswspace(var)
#define _istxdigit(var) iswxdigit(var)
inline float _tstof(const wchar_t* str){
wchar_t** ptail = NULL;
return wcstof(str, ptail);
}
//This function is not used. by Orzogc Lee
//But I think there is no need to removing, linker will remove it.
/*
inline void tolowers(wxChar* str){
int i = 0;
do{
str[i] = towlower(str[i]);
}while(str[++i]);
}
*/
#define _tcsstr(haystack, needle) wcsstr(haystack, needle)
#define _tcslen(var) wcslen(var)
#define StrStr(a, b) wcsstr(a, b)
#define StrStrIW(a, b) StrStrI(a, b)
LPCTSTR StrStrI(LPCTSTR haystack, LPCTSTR needle);
//Bill Lee: I think inlining this function make no senses, because it is a very large operation.
#define _wcsicmp(a, b) wcscasecmp(a, b)
#define StrCmpIW(a, b) wcscasecmp(a, b)
#endif

8
antileech/src/autogen.sh Normal file
View File

@ -0,0 +1,8 @@
mkdir -pv m4
libtoolize
aclocal
aclocal -I m4
automake --add-missing --copy
autoconf

View File

@ -0,0 +1,44 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# Copyright (C) 2011 Bill Lee <bill.lee.y@gmail.com>
# License: GNU GPL v3 or any later version released by Free Software Foundation
#AC_PREREQ([2.65])
AC_INIT([antiLeech], [44], [https://github.com/persmule/amule-dlp/issues])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR([antiLeech.cpp])
#AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
AM_DISABLE_STATIC
AC_PROG_LIBTOOL
#Check for wx-config
AC_CHECK_PROG(WXCONFIG, [wx-config], [wx-config])
ANTILEECH_CPPFLAGS=$(wx-config --cppflags)
AC_SUBST(ANTILEECH_CPPFLAGS)
# Checks for libraries.
ANTILEECH_LDFLAGS=
AC_SUBST(ANTILEECH_LDFLAGS)
# Checks for header files.
AC_CHECK_HEADERS([string.h], [wx/string.h], [wx/defs.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@ -0,0 +1,61 @@
--- antiLeech.cpp.win 2016-02-15 19:31:18.748711749 +0800
+++ antiLeech.cpp 2016-02-15 20:49:25.691484626 +0800
@@ -17,8 +17,11 @@
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#include <atlstr.h>
+#include "CString_wx.h"
#include "antiLeech.h"
+#define __declspec(var) CantiLeech::
+#define SPECIAL_DLP_VERSION
+#define ALL_VERYCD_MOD
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -51,7 +54,10 @@ LPCTSTR apszSnafuTag[]=
//,_T("[eChanblardNext]") //21 zz_fly
};
+const DWORD CantiLeech::DLPVersion = 4405;
+//deactivate M$WIN-specific codes
+#if 0
BOOL WINAPI DllMain (
HANDLE hModule,
DWORD dwFunction,
@@ -74,6 +80,7 @@ void __declspec(dllexport) TestFunc()
{
::MessageBox(NULL,_T("Inside the DLL!"),_T("Nix"),0);
}
+#endif
//old versions just to keep compatible
/* //drop old version support
@@ -285,7 +292,7 @@ LPCTSTR __declspec(dllexport) DLPCheckNa
*/
//end old version ------------------------------------------
-bool IsTypicalHex(CString& addon)
+bool CantiLeech::IsTypicalHex(const CString& addon)
{
if(addon.GetLength()>25 || addon.GetLength()<5)
return false;
@@ -1244,7 +1251,7 @@ LPCTSTR __declspec(dllexport) DLPCheckUs
return NULL;
}
-LPCTSTR __declspec(dllexport) DLPCheckNameAndHashAndMod(CString username, CString& userhash, CString& modversion)
+LPCTSTR __declspec(dllexport) DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion)
{
if(username.IsEmpty() || userhash.IsEmpty())
return NULL;
@@ -1309,7 +1316,7 @@ LPCTSTR __declspec(dllexport) DLPCheckNa
//Check for aedit
//remark: a unmodded emule can't send a space at last sign
- if(modversion.IsEmpty() && username.Right(1)==32)
+ if(modversion.IsEmpty() && username.Right(1)==_T(" "))
return _T("AEdit");
//Check for Hex-Modstring

38
automount/Makefile Normal file
View File

@ -0,0 +1,38 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=automount
PKG_VERSION:=1
PKG_RELEASE:=
PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/automount
TITLE:=Mount autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=+block-mount +kmod-fs-exfat +kmod-fs-ext4 +kmod-fs-vfat +libblkid \
+kmod-usb-storage +kmod-usb-storage-extras +!TARGET_ramips:kmod-usb-storage-uas \
+!LINUX_5_15:antfs-mount +LINUX_5_15:ntfs3-mount
endef
define Package/automount/description
A usb autoconfig hotplug script.
endef
define Build/Compile
endef
define Package/automount/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/15-automount $(1)/etc/15-automount
$(INSTALL_BIN) ./files/zzz-move-automount $(1)/etc/uci-defaults/zzz-move-automount
endef
$(eval $(call BuildPackage,automount))

27
automount/files/15-automount Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
# Copyright (C) 2015 OpenWrt.org
# 0 yes blockdevice handles this - 1 no it is not there
blkdev=`dirname $DEVPATH`
basename=`basename $blkdev`
device=`basename $DEVPATH`
skip=`block info | sed 's/\(.*\): .*/\1/' | grep -q $device ; echo $?`
path=$DEVPATH
if [ $basename != "block" ] && [ -z "${device##sd*}" ] && [ $skip -eq 1 ]; then
mntpnt=$device
case "$ACTION" in
add)
mkdir -p /mnt/$mntpnt
chmod 777 /mnt/$mntpnt
# Try to be gentle on solid state devices
mount -o rw,noatime,discard /dev/$device /mnt/$mntpnt
;;
remove)
# Once the device is removed, the /dev entry disappear. We need mountpoint
mountpoint=`mount |grep /dev/$device | sed 's/.* on \(.*\) type.*/\1/'`
umount -l $mountpoint
;;
esac
fi

View File

@ -0,0 +1,4 @@
#!/bin/sh
sleep 15
mv /etc/15-automount /etc/hotplug.d/block/

84
baidupcs-web/Makefile Normal file
View File

@ -0,0 +1,84 @@
#
# Copyright (C) 2019 OpenWrt.org
#
# KFERMercer <KFER.Mercer@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=baidupcs-web
PKG_VERSION:=3.7.4
PKG_RELEASE:=
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/Erope/BaiduPCS-Go.git
PKG_SOURCE_VERSION:=5649b562ef4d5390fa18a996042f5f7d27b2ef8d
PKG_MIRROR_HASH:=5cdff81544f52cbadc8eb0eb7a855a41ad8f751edd702e9da5f3a05041baf81d
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_CONFIG_DEPENDS:= \
CONFIG_BAIDUPCS_WEB_COMPRESS_GOPROXY \
CONFIG_BAIDUPCS_WEB_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/Erope/BaiduPCS-Go
GO_PKG_LDFLAGS:=-s -w
GO_PKG_LDFLAGS_X:=main.Version=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=BaiduPCS-Web is a web controller for BaiduPCS-Go
URL:=https://github.com/Erope/BaiduPCS-Go
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/$(PKG_NAME)/description
BaiduPCS-Web is a web controller for BaiduPCS-Go
endef
define Package/$(PKG_NAME)/config
config BAIDUPCS_WEB_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config BAIDUPCS_WEB_COMPRESS_UPX
bool "Compress executable files with UPX"
default y
endef
ifeq ($(CONFIG_BAIDUPCS_WEB_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.baidu.com
endif
define Build/Compile
( \
GOOS=$$$$(go env GOOS) GOARCH=$$$$(go env GOARCH) go get -v github.com/GeertJohan/go.rice/rice/... ; \
cd $(PKG_BUILD_DIR)/internal/pcsweb ; \
"$$$$(go env GOPATH)/bin/rice" embed-go ; \
)
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_BAIDUPCS_WEB_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/BaiduPCS-Go
endif
endef
define Package/$(PKG_NAME)/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/BaiduPCS-Go $(1)/usr/bin/$(PKG_NAME)
endef
$(eval $(call GoBinPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,21 @@
--- a/go.sum
+++ b/go.sum
@@ -45,6 +45,7 @@ github.com/daaku/go.zipexe v1.0.1 h1:wV4zMsDOI2SZ2m7Tdz1Ps96Zrx+TzaK15VbUaGozw0M
github.com/daaku/go.zipexe v1.0.1/go.mod h1:5xWogtqlYnfBXkSB1o9xysukNP9GTvaNkqzUZbt3Bw8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
--- a/pcsutil/jwted25519/jwted25519.go
+++ b/pcsutil/jwted25519/jwted25519.go
@@ -2,7 +2,7 @@ package jwted25519
import (
"github.com/dgrijalva/jwt-go"
- "golang.org/x/crypto/ed25519"
+ "crypto/ed25519"
"unsafe"
)

View File

@ -0,0 +1,11 @@
_____
_____________________________ __________ /_
_ __ \__ __ \ _ \_ __ \_ | /| / /_ ___/ __/
/ /_/ /_ /_/ / __/ / / /_ |/ |/ /_ / / /_
\____/_ .___/\___//_/ /_/____/|__/ /_/ \__/
/_/
_________________________________________
%D %C by Kiddin'
_________________________________________

View File

@ -0,0 +1,5 @@
#!/bin/sh
#
for eth in "$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -vE "(@|\.)")"; do
ethtool -s $eth autoneg on
done

72
brook/Makefile Normal file
View File

@ -0,0 +1,72 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=brook
PKG_VERSION:=20210701
PKG_RELEASE:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/txthinking/brook/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=92c2253349af05ea5aa7a45cddd39ca638c732b2ffdb5066a5f03d2df40cb0b5
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_CONFIG_DEPENDS:= \
CONFIG_BROOK_COMPRESS_GOPROXY \
CONFIG_BROOK_COMPRESS_UPX
GO_PKG:=github.com/txthinking/brook
GO_PKG_BUILD_PKG:=github.com/txthinking/brook/cli/brook
GO_PKG_LDFLAGS:=-s -w
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/brook
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=A cross-platform proxy software
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
URL:=https://github.com/txthinking/brook
endef
define Package/brook/description
Brook is a cross-platform strong encryption and not detectable proxy.
Zero-Configuration.
endef
define Package/brook/config
config BROOK_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config BROOK_COMPRESS_UPX
bool "Compress executable files with UPX"
depends on !mips64
default n
endef
ifeq ($(CONFIG_BROOK_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.baidu.com
endif
define Build/Compile
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_BROOK_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/brook
endif
endef
$(eval $(call GoBinPackage,brook))
$(eval $(call BuildPackage,brook))

40
chinadns-ng/Makefile Normal file
View File

@ -0,0 +1,40 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=chinadns-ng
PKG_VERSION:=1.0-beta.25
PKG_RELEASE:=
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/zfl9/chinadns-ng.git
PKG_SOURCE_DATE:=2021-05-08
PKG_SOURCE_VERSION:=14cc6348d67b09cae37d9bce554c89c2c0e0b265
PKG_MIRROR_HASH:=3b66fc0888d9488e3b8e39df3016d51fae1b43325d292381e94aa3c7d2318282
PKG_LICENSE:=AGPL-3.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=pexcn <i@pexcn.me>
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/chinadns-ng
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
TITLE:=ChinaDNS next generation, refactoring with epoll and ipset.
URL:=https://github.com/zfl9/chinadns-ng
DEPENDS:=+ipset
endef
define Package/chinadns-ng/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/chinadns-ng $(1)/usr/bin
endef
$(eval $(call BuildPackage,chinadns-ng))

53
dns2socks/Makefile Normal file
View File

@ -0,0 +1,53 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=dns2socks
PKG_VERSION:=2.1
PKG_RELEASE:=
PKG_SOURCE:=SourceCode.zip
PKG_SOURCE_URL:=@SF/dns2socks
PKG_SOURCE_DATE:=2020-02-18
PKG_HASH:=406b5003523577d39da66767adfe54f7af9b701374363729386f32f6a3a995f4
PKG_MAINTAINER:=ghostmaker
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILE:=LICENSE
include $(INCLUDE_DIR)/package.mk
UNZIP_CMD:=unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
define Package/dns2socks
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
TITLE:=DNS to SOCKS or HTTP proxy
URL:=http://dns2socks.sourceforge.net/
DEPENDS:=+libpthread
endef
define Package/dns2socks/description
This is a command line utility to resolve DNS requests via
a SOCKS tunnel like Tor or a HTTP proxy.
endef
define Build/Compile
$(TARGET_CC) \
$(TARGET_CFLAGS) \
$(TARGET_CPPFLAGS) \
$(FPIC) \
-o $(PKG_BUILD_DIR)/DNS2SOCKS/dns2socks \
$(PKG_BUILD_DIR)/DNS2SOCKS/DNS2SOCKS.c \
$(TARGET_LDFLAGS) -pthread
endef
define Package/dns2socks/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/DNS2SOCKS/dns2socks $(1)/usr/bin/dns2socks
endef
$(eval $(call BuildPackage,dns2socks))

61
dnsforwarder/Makefile Normal file
View File

@ -0,0 +1,61 @@
#
# Copyright (C) 2021 ImmortalWrt
# <https://immortalwrt.org>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsforwarder
PKG_VERSION:=6.1.15
PKG_RELEASE:=
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/1715173329/dnsforwarder.git
PKG_SOURCE_DATE:=2018-06-26
PKG_SOURCE_VERSION:=587e61ae4d75dc976f538088b715a3c8ee26c144
PKG_MIRROR_HASH:=7c141040ae384d254d90b3c3ee502d87330c9fdcd201ff29a669336a27b176d4
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=Dennis <openwrt@tossp.com>
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/dnsforwarder
SECTION:=net
CATEGORY:=Network
TITLE:=A simple DNS forwarder
URL:=https://github.com/holmium/dnsforwarder
DEPENDS:=+coreutils +coreutils-base64 +dnsmasq-full +libpthread +wget-ssl
endef
define Package/dnsforwarder/description
Forwarding queries to customized domains (and their subdomains) to specified servers
over a specified protocol (UDP or TCP). non-standard ports are supported.
endef
CONFIGURE_ARGS+= --enable-downloader=wget
define Package/dnsforwarder/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnsforwarder $(1)/usr/bin/dnsforwarder
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) files/etc/config/dnsforwarder $(1)/etc/config/dnsforwarder
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) files/etc/init.d/dnsforwarder $(1)/etc/init.d/dnsforwarder
$(INSTALL_DIR) $(1)/etc/dnsforwarder
$(INSTALL_CONF) files/etc/dnsforwarder/gfw.txt $(1)/etc/dnsforwarder/gfw.txt
$(INSTALL_DIR) $(1)/usr/share/dnsforwarder
$(INSTALL_BIN) files/usr/share/dnsforwarder/gfwlist.sh $(1)/usr/share/dnsforwarder/gfwlist.sh
endef
$(eval $(call BuildPackage,dnsforwarder))

View File

@ -0,0 +1,79 @@
config arguments
option enabled '0'
option addr '127.0.0.1:5053'
config config
option cache 'true'
option cache_size '102400'
option cache_ignore 'false'
option gfw 'true'
list block_ip '74.125.127.102'
list block_ip '74.125.155.102'
list block_ip '74.125.39.102'
list block_ip '74.125.39.113'
list block_ip '209.85.229.138'
list block_ip '128.121.126.139'
list block_ip '159.106.121.75'
list block_ip '169.132.13.103'
list block_ip '192.67.198.6'
list block_ip '202.106.1.2'
list block_ip '202.181.7.85'
list block_ip '203.161.230.171'
list block_ip '203.98.7.65'
list block_ip '207.12.88.98'
list block_ip '208.56.31.43'
list block_ip '209.145.54.50'
list block_ip '209.220.30.174'
list block_ip '209.36.73.33'
list block_ip '211.94.66.147'
list block_ip '213.169.251.35'
list block_ip '216.221.188.182'
list block_ip '216.234.179.13'
list block_ip '243.185.187.39'
list block_ip '37.61.54.158'
list block_ip '4.36.66.178'
list block_ip '46.82.174.68'
list block_ip '59.24.3.173'
list block_ip '64.33.88.161'
list block_ip '64.33.99.47'
list block_ip '64.66.163.251'
list block_ip '65.104.202.252'
list block_ip '65.160.219.113'
list block_ip '66.45.252.237'
list block_ip '69.55.52.253'
list block_ip '72.14.205.104'
list block_ip '72.14.205.99'
list block_ip '78.16.49.15'
list block_ip '8.7.198.45'
list block_ip '93.46.8.89'
list block_ip '37.61.54.158'
list block_ip '243.185.187.39'
list block_ip '190.93.247.4'
list block_ip '190.93.246.4'
list block_ip '190.93.245.4'
list block_ip '190.93.244.4'
list block_ip '65.49.2.178'
list block_ip '189.163.17.5'
list block_ip '23.89.5.60'
list block_ip '49.2.123.56'
list block_ip '54.76.135.1'
list block_ip '77.4.7.92'
list block_ip '118.5.49.6'
list block_ip '159.24.3.173'
list block_ip '188.5.4.96'
list block_ip '197.4.4.12'
list block_ip '220.250.64.24'
list block_ip '243.185.187.30'
list block_ip '249.129.46.48'
list block_ip '253.157.14.165'
option block_ipv6 'false'
list cache_control 'tossp.com $orig'
list cache_control '* fixed 3600'
option log 'false'
list udp_group '9.9.9.9,119.29.29.29,223.5.5.5,114.114.114.114 * on'
option block_negative_resp 'true'
list udp_local '0.0.0.0:5053'
list udp_local '[::0]:5053'
option domain_statistic 'false'

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,260 @@
#!/bin/sh /etc/rc.common
START=60
EXTRA_COMMANDS="makeconfig makegfwlist health"
CRON_FILE=/etc/crontabs/root
PID_PATH=/var/run/dnsforwarder
PID_FILE=${PID_PATH}/dns.pid
DNSFORWARDER_CONF=/tmp/dnsforwarder.conf
add_cron()
{
sed -i '/dnsforwarder/d' $CRON_FILE
echo '*/5 * * * * /etc/init.d/dnsforwarder health' >> $CRON_FILE
echo '0 1 * * 0 /etc/init.d/dnsforwarder makegfwlist' >> $CRON_FILE
crontab $CRON_FILE
}
del_cron()
{
sed -i '/dnsforwarder/d' $CRON_FILE
/etc/init.d/cron restart
}
fixturboacc(){
dns=$(uci get turboacc.config.dns_caching 2>/dev/null)
if [ $dns -eq 1 ]; then
uci set turboacc.config.dns_caching=0 && uci commit turboacc
/etc/init.d/turboacc restart
fi
}
makelist() {
[ -z "$2" ] && return
local i
local t="$1"; shift
for i in "$@"
do
echo "$t $i"
done
}
health(){
rm /var/log/dnsforwarder.log.* 2>/dev/null
local pid=$(cat ${PID_FILE} 2>/dev/null)
if [ -n "${pid}" -a -d /proc/$pid ]; then
echo "[health] process exists ${pid}"
else
echo "[health] Dnsforwarder is not running ${pid}"
start
fi
}
makegfwlist(){
local GFW_FILE='/etc/dnsforwarder/gfw.txt'
local GFW_TMP_FILE='/tmp/dnsforwarder-gfw.old'
local TSTIME=`date '+%Y-%m-%d %H:%M:%S'`
touch ${GFW_TMP_FILE}
cat /etc/config/gfw.list 2>/dev/null > /tmp/edf.ts
cat /etc/dnsmasq.ssr/gfw_base.conf 2>/dev/null | awk -F '/' '{print $2}' | sed 's/^.//g' >> /tmp/edf.ts
cat /etc/dnsmasq.ssr/gfw_list.conf 2>/dev/null | awk -F '/' '{print $2}' | sed 's/^.//g' >> /tmp/edf.ts
sort /tmp/edf.ts | uniq > /tmp/edf.ts
/usr/share/dnsforwarder/gfwlist.sh -i -l -o /tmp/dnsforwarder-gfw.tmp --extra-domain-file /tmp/edf.ts
if [ $? != 0 ]; then
echo 'Failed to fetch gfwlist'
logger -t Failed to fetch gfwlist
return 2
fi
local gfw=$(cat /tmp/dnsforwarder-gfw.tmp)
echo "# GenerationAt TS_BUILD_TIME" > ${GFW_TMP_FILE}.new
echo "protocol tcp" >> ${GFW_TMP_FILE}.new
echo "server 8.8.8.8,8.8.4.4,1.1.1.1,1.0.0.1,208.67.222.222,208.67.220.220,209.244.0.3,209.244.0.4,8.26.56.26,8.20.247.20,156.154.70.1,156.154.71.1,199.85.126.10" >> ${GFW_TMP_FILE}.new
echo -e 'proxy no\n\n\n' >> ${GFW_TMP_FILE}.new
echo "${gfw}" >> ${GFW_TMP_FILE}.new
if [ "`cat ${GFW_TMP_FILE}.new | md5sum`" == "`cat ${GFW_TMP_FILE} | md5sum`" ]; then
printf "[\e[32m%s\e[0m]\n" "hold"
else
cp ${GFW_TMP_FILE}.new ${GFW_TMP_FILE}
cp ${GFW_TMP_FILE} ${GFW_FILE}
sed -i "s/TS_BUILD_TIME/${TSTIME}/g" ${GFW_FILE}
printf "[\e[33m%s\e[0m]" "PID"
restart
fi
}
makeconfig () {
config_load dnsforwarder
local log=$(uci get dnsforwarder.@config[0].log 2>/dev/null)
local log_size=$(uci get dnsforwarder.@config[0].log_size 2>/dev/null)
local gfw=$(uci get dnsforwarder.@config[0].gfw 2>/dev/null)
local udp_local=$(uci -d ',' get dnsforwarder.@config[0].udp_local 2>/dev/null)
local udp_local_list=$(uci get dnsforwarder.@config[0].udp_local 2>/dev/null)
local tcp_group=$(uci get dnsforwarder.@config[0].tcp_group 2>/dev/null)
local udp_group=$(uci get dnsforwarder.@config[0].udp_group 2>/dev/null)
local group_file=$(uci get dnsforwarder.@config[0].group_file 2>/dev/null)
local block_ip=$(uci -d ',' get dnsforwarder.@config[0].block_ip 2>/dev/null)
local ip_substituting=$(uci -d ',' get dnsforwarder.@config[0].ip_substituting 2>/dev/null)
local block_negative_resp=$(uci get dnsforwarder.@config[0].block_negative_resp 2>/dev/null)
local append_host=$(uci get dnsforwarder.@config[0].append_host 2>/dev/null)
local block_ipv6=$(uci get dnsforwarder.@config[0].block_ipv6 2>/dev/null)
local cache=$(uci get dnsforwarder.@config[0].cache 2>/dev/null)
local cache_size=$(uci get dnsforwarder.@config[0].cache_size 2>/dev/null)
local cache_ignore=$(uci get dnsforwarder.@config[0].cache_ignore 2>/dev/null)
local cache_control=$(uci get dnsforwarder.@config[0].cache_control 2>/dev/null)
local domain_statistic=$(uci get dnsforwarder.@config[0].domain_statistic 2>/dev/null)
local udp_local_addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
udp_local_addr=${udp_local_addr/:/#}
echo "LogOn ${log}" > $DNSFORWARDER_CONF
if [ $log = "true" ]; then
rm /var/log/dnsforwarder.log.* 2>/dev/null
echo '' > /var/log/dnsforwarder.log
echo "LogFileThresholdLength ${log_size}" >> $DNSFORWARDER_CONF
echo "LogFileFolder /var/log" >> $DNSFORWARDER_CONF
fi
[ -n "$udp_local" ] && echo "UDPLocal ${udp_local}" >> $DNSFORWARDER_CONF
[ -n "$udp_local_addr" ] && eval "makelist 'server=' $udp_local_addr" > /tmp/dnsmasq.dnsforwarder.conf
sed -i "s/ //g" /tmp/dnsmasq.dnsforwarder.conf
eval "makelist 'TCPGroup' $tcp_group" >> $DNSFORWARDER_CONF
eval "makelist 'UDPGroup' $udp_group" >> $DNSFORWARDER_CONF
eval "makelist 'GroupFile' $group_file" >> $DNSFORWARDER_CONF
if [ $gfw = "true" ]; then
echo 'GroupFile /etc/dnsforwarder/gfw.txt' >> $DNSFORWARDER_CONF
fi
echo "BlockIP ${block_ip}" >> $DNSFORWARDER_CONF
eval "makelist 'IPSubstituting' $ip_substituting" >> $DNSFORWARDER_CONF
echo "BlockNegativeResponse ${block_negative_resp}" >> $DNSFORWARDER_CONF
eval "makelist 'AppendHosts' $append_host" >> $DNSFORWARDER_CONF
echo "BlockIpv6WhenIpv4Exists ${block_ipv6}" >> $DNSFORWARDER_CONF
echo "UseCache ${cache}" >> $DNSFORWARDER_CONF
if [ $cache = "true" ]; then
echo "CacheSize ${cache_size}" >> $DNSFORWARDER_CONF
echo "MemoryCache false" >> $DNSFORWARDER_CONF
echo "CacheFile /tmp/dnsforwarder.cache" >> $DNSFORWARDER_CONF
echo "IgnoreTTL ${cache_ignore}" >> $DNSFORWARDER_CONF
eval "makelist 'CacheControl' $cache_control" >> $DNSFORWARDER_CONF
echo "ReloadCache true" >> $DNSFORWARDER_CONF
echo "OverwriteCache true" >> $DNSFORWARDER_CONF
fi
echo "DomainStatistic ${domain_statistic}" >> $DNSFORWARDER_CONF
if [ $domain_statistic = "true" ]; then
touch /tmp/dnsforwarder-statistic.html
mkdir -p /root/.dnsforwarder
rm /root/.dnsforwarder/statistic.html 2 > /dev/null
ln -s /tmp/dnsforwarder-statistic.html /root/.dnsforwarder/statistic.html
local domain_statistic_tag='<!-- TS DNSFORWARDER -->'
echo "DomainStatisticTempletFile /tmp/dnsforwarder-statistic.html" >> $DNSFORWARDER_CONF
echo "StatisticInsertionPosition ${domain_statistic_tag}" >> $DNSFORWARDER_CONF
echo "StatisticUpdateInterval 60" >> $DNSFORWARDER_CONF
echo "${domain_statistic_tag}" > /tmp/dnsforwarder-statistic.html
fi
}
start()
{
echo luci for dnsforwarder
local vt_enabled=$(uci get dnsforwarder.@arguments[0].enabled 2>/dev/null)
if [ $vt_enabled = 0 ]; then
echo dnsforwarder is not enabled
exit
fi
makeconfig
fixturboacc
dnsforwarder -f $DNSFORWARDER_CONF -d
sleep 10
mkdir -p ${PID_PATH}
pid=$(ps | awk '$5 ~ /\[dnsforwarder\]/ {print $1}')
echo "dnsforwarder running pid is ${pid}"
logger -t The pid of dnsforwarder is ${PID_FILE} ${pid}
echo ${pid} > ${PID_FILE}
/etc/init.d/dnsforwarder enable
local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null)
local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
[ -n "${addr}" ] && addr=${addr/:/#}
if [ "${dnsmasq}" = "1" ]; then
uci delete dhcp.@dnsmasq[0].server 2>/dev/null
# uci add_list dhcp.@dnsmasq[0].server=$addr
uci delete dhcp.@dnsmasq[0].resolvfile 2>/dev/null
uci set dhcp.@dnsmasq[0].noresolv=1
uci set dhcp.@dnsmasq[0].serversfile=/tmp/dnsmasq.dnsforwarder.conf
uci commit dhcp
/etc/init.d/dnsmasq restart
fi
local dnsmasq_server_addr=$(uci get dhcp.@dnsmasq[0].server 2>/dev/null)
if [ -n "${dnsmasq_server_addr}" ]; then
uci set dhcp.@dnsmasq[0].noresolv=1
uci commit dhcp
/etc/init.d/dnsmasq restart
fi
add_cron
}
stop()
{
del_cron
logger -t stopping dnsforwarder
local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null)
addr=${addr/:/#}
if [ "${dnsmasq}" = "1" ]; then
uci del_list dhcp.@dnsmasq[0].server=$addr 2>/dev/null
fi
uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.d/resolv.conf.auto 2>/dev/null
uci delete dhcp.@dnsmasq[0].noresolv 2>/dev/null
uci delete dhcp.@dnsmasq[0].serversfile 2>/dev/null
uci commit dhcp
/etc/init.d/dnsmasq restart
[ -e ${PID_FILE} ] && {
pid=$(cat ${PID_FILE})
logger -t killing dnsforwarder pid ${pid}
echo killing dnsforwarder pid ${pid}
kill ${pid}
rm -f ${PID_FILE}
} || {
logger -t Cannot find dnsforwarder pid file
}
}
restart()
{
pid=$(cat ${PID_FILE} 2>/dev/null)
echo Dnsforwarder pid file is ${pid}
[ -n "$pid" ] && {
echo stopping pid ${pid}
logger -t There is dnsforwarder pid ${pid}
stop
} || {
logger -t Dnsforwarder is not running
}
sleep 7
local vt_enabled=$(uci get dnsforwarder.@arguments[0].enabled 2>/dev/null)
echo dnsforwarder status is ${vt_enabled}
logger -t Dnsforwarder is initializing enabled is ${vt_enabled}
if [ ${vt_enabled} = 1 ]; then
[ -n "$pid" ] && {
logger -t There is dnsforwarder pid ${pid}
stop
} || {
logger -t Dnsforwarder is not running
}
logger -t Restarting dnsforwarder
start
else
/etc/init.d/dnsforwarder disable
fi
}

View File

@ -0,0 +1,313 @@
#/bin/sh
# Name: gfwlist2dnsmasq.sh
# Desription: A shell script which convert gfwlist into dnsmasq rules.
# Version: 0.8.0 (2017.12.25)
# Author: Cokebar Chi
# Website: https://github.com/cokebar
_green() {
printf '\033[1;31;32m'
printf -- "%b" "$1"
printf '\033[0m'
}
_red() {
printf '\033[1;31;31m'
printf -- "%b" "$1"
printf '\033[0m'
}
_yellow() {
printf '\033[1;31;33m'
printf -- "%b" "$1"
printf '\033[0m'
}
usage() {
cat <<-EOF
Name: gfwlist2dnsmasq.sh
Desription: A shell script which convert gfwlist into dnsmasq rules.
Version: 0.8.0 (2017.12.25)
Author: Cokebar Chi
Website: https://github.com/cokebar
Usage: sh gfwlist2dnsmasq.sh [options] -o FILE
Valid options are:
-d, --dns <dns_ip>
DNS IP address for the GfwList Domains (Default: 127.0.0.1)
-p, --port <dns_port>
DNS Port for the GfwList Domains (Default: 5353)
-s, --ipset <ipset_name>
Ipset name for the GfwList domains
(If not given, ipset rules will not be generated.)
-o, --output <FILE>
/path/to/output_filename
-i, --insecure
Force bypass certificate validation (insecure)
-l, --domain-list
Convert Gfwlist into domain list instead of dnsmasq rules
(If this option is set, DNS IP/Port & ipset are not needed)
--exclude-domain-file <FILE>
Delete specific domains in the result from a domain list text file
Please put one domain per line
--extra-domain-file <FILE>
Include extra domains to the result from a domain list text file
This file will be processed after the exclude-domain-file
Please put one domain per line
-h, --help
Usage
EOF
exit $1
}
clean_and_exit(){
# Clean up temp files
printf 'Cleaning up... '
rm -rf $TMP_DIR
_green 'Done\n\n'
[ $1 -eq 0 ] && _green 'Job Finished.\n\n' || _red 'Exit with Error code '$1'.\n'
exit $1
}
check_depends(){
which sed base64 curl >/dev/null
if [ $? != 0 ]; then
_red 'Error: Missing Dependency.\nPlease check whether you have the following binaries on you system:\nwhich, sed, base64, curl.\n'
exit 3
fi
SYS_KERNEL=`uname -s`
if [ $SYS_KERNEL = "Darwin" -o $SYS_KERNEL = "FreeBSD" ]; then
BASE64_DECODE='base64 -D'
SED_ERES='sed -E'
else
BASE64_DECODE='base64 -d'
SED_ERES='sed -r'
fi
}
get_args(){
OUT_TYPE='DNSMASQ_RULES'
DNS_IP='127.0.0.1'
DNS_PORT='5353'
IPSET_NAME=''
FILE_FULLPATH=''
CURL_EXTARG=''
WITH_IPSET=0
EXTRA_DOMAIN_FILE=''
EXCLUDE_DOMAIN_FILE=''
IPV4_PATTERN='^((2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)\.){3}(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)$'
IPV6_PATTERN='^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?$'
while [ ${#} -gt 0 ]; do
case "${1}" in
--help | -h)
usage 0
;;
--domain-list | -l)
OUT_TYPE='DOMAIN_LIST'
;;
--insecure | -i)
CURL_EXTARG='--insecure'
;;
--dns | -d)
DNS_IP="$2"
shift
;;
--port | -p)
DNS_PORT="$2"
shift
;;
--ipset | -s)
IPSET_NAME="$2"
shift
;;
--output | -o)
OUT_FILE="$2"
shift
;;
--extra-domain-file)
EXTRA_DOMAIN_FILE="$2"
shift
;;
--exclude-domain-file)
EXCLUDE_DOMAIN_FILE="$2"
shift
;;
*)
_red "Invalid argument: $1"
usage 1
;;
esac
shift 1
done
# Check path & file name
if [ -z $OUT_FILE ]; then
_red 'Error: Please specify the path to the output file(using -o/--output argument).\n'
exit 1
else
if [ -z ${OUT_FILE##*/} ]; then
_red 'Error: '$OUT_FILE' is a path, not a file.\n'
exit 1
else
if [ ${OUT_FILE}a != ${OUT_FILE%/*}a ] && [ ! -d ${OUT_FILE%/*} ]; then
_red 'Error: Folder do not exist: '${OUT_FILE%/*}'\n'
exit 1
fi
fi
fi
if [ $OUT_TYPE = 'DNSMASQ_RULES' ]; then
# Check DNS IP
IPV4_TEST=$(echo $DNS_IP | grep -E $IPV4_PATTERN)
IPV6_TEST=$(echo $DNS_IP | grep -E $IPV6_PATTERN)
if [ "$IPV4_TEST" != "$DNS_IP" -a "$IPV6_TEST" != "$DNS_IP" ]; then
_red 'Error: Please enter a valid DNS server IP address.\n'
exit 1
fi
# Check DNS port
if [ $DNS_PORT -lt 1 -o $DNS_PORT -gt 65535 ]; then
_red 'Error: Please enter a valid DNS server port.\n'
exit 1
fi
# Check ipset name
if [ -z $IPSET_NAME ]; then
WITH_IPSET=0
else
IPSET_TEST=$(echo $IPSET_NAME | grep -E '^\w+$')
if [ "$IPSET_TEST" != "$IPSET_NAME" ]; then
_red 'Error: Please enter a valid IP set name.\n'
exit 1
else
WITH_IPSET=1
fi
fi
fi
if [ ! -z $EXTRA_DOMAIN_FILE ] && [ ! -f $EXTRA_DOMAIN_FILE ]; then
_yellow 'WARNING:\nExtra domain file does not exist, ignored.\n\n'
EXTRA_DOMAIN_FILE=''
fi
if [ ! -z $EXCLUDE_DOMAIN_FILE ] && [ ! -f $EXCLUDE_DOMAIN_FILE ]; then
_yellow 'WARNING:\nExclude domain file does not exist, ignored.\n\n'
EXCLUDE_DOMAIN_FILE=''
fi
}
process(){
# Set Global Var
BASE_URL='https://github.com/gfwlist/gfwlist/raw/master/gfwlist.txt'
TMP_DIR=`mktemp -d /tmp/gfwlist2dnsmasq.XXXXXX`
BASE64_FILE="$TMP_DIR/base64.txt"
GFWLIST_FILE="$TMP_DIR/gfwlist.txt"
DOMAIN_TEMP_FILE="$TMP_DIR/gfwlist2domain.tmp"
DOMAIN_FILE="$TMP_DIR/gfwlist2domain.txt"
CONF_TMP_FILE="$TMP_DIR/gfwlist.conf.tmp"
OUT_TMP_FILE="$TMP_DIR/gfwlist.out.tmp"
# Fetch GfwList and decode it into plain text
printf 'Fetching GfwList... '
local tscurl='curl -L --connect-timeout 5 -m 300 --retry 3 --retry-delay 1'
$tscurl $CURL_EXTARG -o$BASE64_FILE $BASE_URL \
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://gitlab.com/gfwlist/gfwlist/raw/master/gfwlist.txt \
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://git.tuxfamily.org/gfwlist/gfwlist.git/plain/gfwlist.txt \
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://pagure.io/gfwlist/raw/master/f/gfwlist.txt \
|| $tscurl $CURL_EXTARG -o$BASE64_FILE http://repo.or.cz/gfwlist.git/blob_plain/HEAD:/gfwlist.txt \
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://bitbucket.org/gfwlist/gfwlist/raw/HEAD/gfwlist.txt \
|| $tscurl $CURL_EXTARG -o$BASE64_FILE $BASE_URL
if [ $? != 0 ]; then
_red '\nFailed to fetch gfwlist.txt. Please check your Internet connection.\n'
clean_and_exit 2
fi
$BASE64_DECODE $BASE64_FILE > $GFWLIST_FILE || ( _red 'Failed to decode gfwlist.txt. Quit.\n'; clean_and_exit 2 )
_green 'Done.\n\n'
# Convert
IGNORE_PATTERN='^\!|\[|^@@|(https?://){0,1}[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'
HEAD_FILTER_PATTERN='s#^(\|\|?)?(https?://)?##g'
TAIL_FILTER_PATTERN='s#/.*$|%2F.*$##g'
DOMAIN_PATTERN='([a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)+)'
HANDLE_WILDCARD_PATTERN='s#^(([a-zA-Z0-9]*\*[-a-zA-Z0-9]*)?(\.))?([a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)+)(\*)?#\4#g'
printf 'Converting GfwList to ' && _green $OUT_TYPE && printf ' ...\n'
_yellow '\nWARNING:\nThe following lines in GfwList contain regex, and might be ignored:\n\n'
cat $GFWLIST_FILE | grep -n '^/.*$'
_yellow "\nThis script will try to convert some of the regex rules. But you should know this may not be a equivalent conversion.\nIf there's regex rules which this script do not deal with, you should add the domain manually to the list.\n\n"
grep -vE $IGNORE_PATTERN $GFWLIST_FILE | $SED_ERES $HEAD_FILTER_PATTERN | $SED_ERES $TAIL_FILTER_PATTERN | grep -E $DOMAIN_PATTERN | $SED_ERES $HANDLE_WILDCARD_PATTERN > $DOMAIN_TEMP_FILE
printf 'google.com\ngoogle.ad\ngoogle.ae\ngoogle.com.af\ngoogle.com.ag\ngoogle.com.ai\ngoogle.al\ngoogle.am\ngoogle.co.ao\ngoogle.com.ar\ngoogle.as\ngoogle.at\ngoogle.com.au\ngoogle.az\ngoogle.ba\ngoogle.com.bd\ngoogle.be\ngoogle.bf\ngoogle.bg\ngoogle.com.bh\ngoogle.bi\ngoogle.bj\ngoogle.com.bn\ngoogle.com.bo\ngoogle.com.br\ngoogle.bs\ngoogle.bt\ngoogle.co.bw\ngoogle.by\ngoogle.com.bz\ngoogle.ca\ngoogle.cd\ngoogle.cf\ngoogle.cg\ngoogle.ch\ngoogle.ci\ngoogle.co.ck\ngoogle.cl\ngoogle.cm\ngoogle.cn\ngoogle.com.co\ngoogle.co.cr\ngoogle.com.cu\ngoogle.cv\ngoogle.com.cy\ngoogle.cz\ngoogle.de\ngoogle.dj\ngoogle.dk\ngoogle.dm\ngoogle.com.do\ngoogle.dz\ngoogle.com.ec\ngoogle.ee\ngoogle.com.eg\ngoogle.es\ngoogle.com.et\ngoogle.fi\ngoogle.com.fj\ngoogle.fm\ngoogle.fr\ngoogle.ga\ngoogle.ge\ngoogle.gg\ngoogle.com.gh\ngoogle.com.gi\ngoogle.gl\ngoogle.gm\ngoogle.gp\ngoogle.gr\ngoogle.com.gt\ngoogle.gy\ngoogle.com.hk\ngoogle.hn\ngoogle.hr\ngoogle.ht\ngoogle.hu\ngoogle.co.id\ngoogle.ie\ngoogle.co.il\ngoogle.im\ngoogle.co.in\ngoogle.iq\ngoogle.is\ngoogle.it\ngoogle.je\ngoogle.com.jm\ngoogle.jo\ngoogle.co.jp\ngoogle.co.ke\ngoogle.com.kh\ngoogle.ki\ngoogle.kg\ngoogle.co.kr\ngoogle.com.kw\ngoogle.kz\ngoogle.la\ngoogle.com.lb\ngoogle.li\ngoogle.lk\ngoogle.co.ls\ngoogle.lt\ngoogle.lu\ngoogle.lv\ngoogle.com.ly\ngoogle.co.ma\ngoogle.md\ngoogle.me\ngoogle.mg\ngoogle.mk\ngoogle.ml\ngoogle.com.mm\ngoogle.mn\ngoogle.ms\ngoogle.com.mt\ngoogle.mu\ngoogle.mv\ngoogle.mw\ngoogle.com.mx\ngoogle.com.my\ngoogle.co.mz\ngoogle.com.na\ngoogle.com.nf\ngoogle.com.ng\ngoogle.com.ni\ngoogle.ne\ngoogle.nl\ngoogle.no\ngoogle.com.np\ngoogle.nr\ngoogle.nu\ngoogle.co.nz\ngoogle.com.om\ngoogle.com.pa\ngoogle.com.pe\ngoogle.com.pg\ngoogle.com.ph\ngoogle.com.pk\ngoogle.pl\ngoogle.pn\ngoogle.com.pr\ngoogle.ps\ngoogle.pt\ngoogle.com.py\ngoogle.com.qa\ngoogle.ro\ngoogle.ru\ngoogle.rw\ngoogle.com.sa\ngoogle.com.sb\ngoogle.sc\ngoogle.se\ngoogle.com.sg\ngoogle.sh\ngoogle.si\ngoogle.sk\ngoogle.com.sl\ngoogle.sn\ngoogle.so\ngoogle.sm\ngoogle.sr\ngoogle.st\ngoogle.com.sv\ngoogle.td\ngoogle.tg\ngoogle.co.th\ngoogle.com.tj\ngoogle.tk\ngoogle.tl\ngoogle.tm\ngoogle.tn\ngoogle.to\ngoogle.com.tr\ngoogle.tt\ngoogle.com.tw\ngoogle.co.tz\ngoogle.com.ua\ngoogle.co.ug\ngoogle.co.uk\ngoogle.com.uy\ngoogle.co.uz\ngoogle.com.vc\ngoogle.co.ve\ngoogle.vg\ngoogle.co.vi\ngoogle.com.vn\ngoogle.vu\ngoogle.ws\ngoogle.rs\ngoogle.co.za\ngoogle.co.zm\ngoogle.co.zw\ngoogle.cat\n' >> $DOMAIN_TEMP_FILE
printf 'Google search domains... ' && _green 'Added\n'
# Add blogspot domains
printf 'blogspot.ca\nblogspot.co.uk\nblogspot.com\nblogspot.com.ar\nblogspot.com.au\nblogspot.com.br\nblogspot.com.by\nblogspot.com.co\nblogspot.com.cy\nblogspot.com.ee\nblogspot.com.eg\nblogspot.com.es\nblogspot.com.mt\nblogspot.com.ng\nblogspot.com.tr\nblogspot.com.uy\nblogspot.de\nblogspot.gr\nblogspot.in\nblogspot.mx\nblogspot.ch\nblogspot.fr\nblogspot.ie\nblogspot.it\nblogspot.pt\nblogspot.ro\nblogspot.sg\nblogspot.be\nblogspot.no\nblogspot.se\nblogspot.jp\nblogspot.in\nblogspot.ae\nblogspot.al\nblogspot.am\nblogspot.ba\nblogspot.bg\nblogspot.ch\nblogspot.cl\nblogspot.cz\nblogspot.dk\nblogspot.fi\nblogspot.gr\nblogspot.hk\nblogspot.hr\nblogspot.hu\nblogspot.ie\nblogspot.is\nblogspot.kr\nblogspot.li\nblogspot.lt\nblogspot.lu\nblogspot.md\nblogspot.mk\nblogspot.my\nblogspot.nl\nblogspot.no\nblogspot.pe\nblogspot.qa\nblogspot.ro\nblogspot.ru\nblogspot.se\nblogspot.sg\nblogspot.si\nblogspot.sk\nblogspot.sn\nblogspot.tw\nblogspot.ug\nblogspot.cat\n' >> $DOMAIN_TEMP_FILE
printf 'Blogspot domains... ' && _green 'Added\n'
# Add twimg.edgesuite.net
printf 'twimg.edgesuite.net\n' >> $DOMAIN_TEMP_FILE
printf 'twimg.edgesuite.net... ' && _green 'Added\n'
# Delete exclude domains
if [ ! -z $EXCLUDE_DOMAIN_FILE ]; then
for line in $(cat $EXCLUDE_DOMAIN_FILE)
do
cat $DOMAIN_TEMP_FILE | grep -vF -f $EXCLUDE_DOMAIN_FILE > $DOMAIN_FILE
done
printf 'Domains in exclude domain file '$EXCLUDE_DOMAIN_FILE'... ' && _green 'Deleted\n'
else
cat $DOMAIN_TEMP_FILE > $DOMAIN_FILE
fi
# Add extra domains
if [ ! -z $EXTRA_DOMAIN_FILE ]; then
cat $EXTRA_DOMAIN_FILE >> $DOMAIN_FILE
printf 'Extra domain file '$EXTRA_DOMAIN_FILE'... ' && _green 'Added\n'
fi
if [ $OUT_TYPE = 'DNSMASQ_RULES' ]; then
# Convert domains into dnsmasq rules
if [ $WITH_IPSET -eq 1 ]; then
_green 'Ipset rules included.'
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'\
ipset=/\1/'$IPSET_NAME'#g' > $CONF_TMP_FILE
else
_green 'Ipset rules not included.'
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'#g' > $CONF_TMP_FILE
fi
# Generate output file
echo '# dnsmasq rules generated by gfwlist' > $OUT_TMP_FILE
echo "# Last Updated on $(date "+%Y-%m-%d %H:%M:%S")" >> $OUT_TMP_FILE
echo '# ' >> $OUT_TMP_FILE
cat $CONF_TMP_FILE >> $OUT_TMP_FILE
cp $OUT_TMP_FILE $OUT_FILE
else
sort -u $DOMAIN_FILE > $OUT_TMP_FILE
fi
cp $OUT_TMP_FILE $OUT_FILE
printf '\nConverting GfwList to '$OUT_TYPE'... ' && _green 'Done\n\n'
# Clean up
clean_and_exit 0
}
main() {
if [ -z "$1" ]; then
usage 0
else
check_depends
get_args "$@"
_green '\nJob Started.\n\n'
process
fi
}
main "$@"

37
dpdk/Makefile Normal file
View File

@ -0,0 +1,37 @@
# SPDX-License-Identifier: GPL-2.0-only
#
include $(TOPDIR)/rules.mk
PKG_NAME := dpdk
PKG_VERSION := 21.05
PKG_SOURCE := dpdk-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL := http://static.dpdk.org/rel
PKG_HASH := 1e12499b4c5fcdb57c83e5fe184ea6becddf7cf092893c2c5ef2efb0eec12f0b
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/meson.mk
TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral
define Package/dpdk
SECTION := net
CATEGORY := Network
TITLE := Data Plane Development Kit (DPDK)
DEPENDS := @(x86_64||arm||aarch64) +librt +libpthread +libbpf +libpcap +libopenssl
endef
define Package/dpdk/description
DPDK consists of libraries to accelerate packet processing
workloads running on a wide variety of CPU architectures.
endef
define Package/dpdk/install
$(INSTALL_DIR) $(1)/usr/{bin,lib}
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{dpdk-testpmd,dpdk-proc-info,dpdk-test-flow-perf} $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,dpdk))

View File

@ -0,0 +1,40 @@
From afe64bae6d398fc9a194bce2763d6b2ab080f38f Mon Sep 17 00:00:00 2001
From: Chandrakant Sharpa <s.chandrakant@globaledgesoft.com>
Date: Mon, 14 Jun 2021 17:53:16 +0530
Subject: [PATCH] Handling backtrace and execinfo header file
Signed-off-by: Chandrakant Sharpa <s.chandrakant@globaledgesoft.com>
---
lib/eal/linux/eal_debug.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c
index 64dab4e0d..24b8b23dd 100644
--- a/lib/eal/linux/eal_debug.c
+++ b/lib/eal/linux/eal_debug.c
@@ -2,9 +2,11 @@
* Copyright(c) 2010-2014 Intel Corporation
*/
+#ifdef __GLIBC__
#ifdef RTE_BACKTRACE
#include <execinfo.h>
#endif
+#endif
#include <stdarg.h>
#include <signal.h>
#include <stdlib.h>
@@ -26,8 +28,10 @@ void rte_dump_stack(void)
char **symb = NULL;
int size;
+#ifdef __GLIBC__
size = backtrace(func, BACKTRACE_SIZE);
symb = backtrace_symbols(func, size);
+#endif
if (symb == NULL)
return;
--
2.17.1

42
dsmboot/Makefile Normal file
View File

@ -0,0 +1,42 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dsmboot
PKG_VERSION:=5.2
PKG_RELEASE:=
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Synology DSM pxeboot from TFTP
DEPENDS:=
endef
define Package/$(PKG_NAME)/description
DSM 5.2 boot from TFTP
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/root
$(INSTALL_DATA) ./files/* $(1)/root/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/dsmboot $(1)/etc/uci-defaults/yyy-dsmboot
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

BIN
dsmboot/files/dsm.iso Normal file

Binary file not shown.

10
dsmboot/files/dsmboot Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
set dhcp.@dnsmasq[0].enable_tftp='1'
set dhcp.@dnsmasq[0].dhcp_boot='pxelinux.0'
set dhcp.@dnsmasq[0].tftp_root='/root'
commit dhcp
EOF
exit 0

9
dsmboot/files/menu.lst Normal file
View File

@ -0,0 +1,9 @@
default 0
timeout 0
fallback 0
title Synology DSM
map --mem (pd)/dsm.iso (hd32)
map --hook
chainloader (hd32)

BIN
dsmboot/files/pxelinux.0 Normal file

Binary file not shown.

51
gmediarender/Makefile Normal file
View File

@ -0,0 +1,51 @@
#
# Copyright (C) 2020 coolsnowwolf@gmail.com
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=gmediarender
PKG_VERSION:=2021-03-15
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/hzeller/gmrender-resurrect.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=4ac7d8914dc089651ae9d6c421ecda8f4d0ab5e3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=08e8e60b8734131acd5d667c40a9a7e9d8bc7e86f59b4972d177e653608a1215
PKG_FIXUP:=autoreconf
PKG_INSTALL=1
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/gmediarender
SECTION:=multimedia
CATEGORY:=Multimedia
DEPENDS:= +gstreamer1 +libgstreamer1 +gstreamer1-libs +glib2 +libupnp
TITLE:=A Headless UPnP Renderer
endef
define Package/gmediarender/description
gmediarender implements the server component that provides UPnP
controllers a means to render media content (audio, video and images)
from a UPnP media server.
endef
CONFIGURE_ARGS+= \
CFLAGS="$(TARGET_CFLAGS) -std=gnu99" --with-build-cc="$(HOSTCC)" \
--prefix="\usr"
define Package/gmediarender/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,gmediarender))

View File

@ -0,0 +1,81 @@
# SPDX-Identifier-License: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=go-aliyundrive-webdav
PKG_VERSION:=1.1.1
PKG_RELEASE:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/LinkLeong/go-aliyundrive-webdav/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=967472971586bc9c62d1579a780e52431eaf37e54f2fe1b180c9a52db2304874
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_CONFIG_DEPENDS:= \
CONFIG_GO_ALIYUNDRIVE_WEBDAV_COMPRESS_GOPROXY \
CONFIG_GO_ALIYUNDRIVE_WEBDAV_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=go-aliyun-webdav
GO_PKG_LDFLAGS:=-s -w
GO_PKG_LDFLAGS_X:=main.Version=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/go-aliyundrive-webdav
SECTION:=net
CATEGORY:=Network
SUBMENU:=File Transfer
TITLE:=A WebDav server for AliyunDrive
URL:=https://github.com/LinkLeong/go-aliyundrive-webdav
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/go-aliyundrive-webdav/config
config GO_ALIYUNDRIVE_WEBDAV_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config GO_ALIYUNDRIVE_WEBDAV_COMPRESS_UPX
bool "Compress executable files with UPX"
default y
endef
ifeq ($(CONFIG_GO_ALIYUNDRIVE_WEBDAV_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.baidu.com
endif
define Package/go-aliyundrive-webdav/conffiles
/etc/config/go-aliyundrive-webdav
endef
define Build/Compile
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_GO_ALIYUNDRIVE_WEBDAV_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/go-aliyun-webdav
endif
endef
define Package/go-aliyundrive-webdav/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/go-aliyun-webdav $(1)/usr/bin/go-aliyundrive-webdav
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_CONF) $(CURDIR)/files/go-aliyundrive-webdav.config $(1)/etc/config/go-aliyundrive-webdav
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) $(CURDIR)/files/go-aliyundrive-webdav.init $(1)/etc/init.d/go-aliyundrive-webdav
endef
$(eval $(call GoBinPackage,go-aliyundrive-webdav))
$(eval $(call BuildPackage,go-aliyundrive-webdav))

View File

@ -0,0 +1,23 @@
config go-aliyundrive-webdav 'config'
option enabled '0'
# Listening port
option port '8085'
# Refresh token
option rt ''
# Mounting directory
option path '/'
# Webdav auth username, default: admin
option user 'admin'
# Webdav auth password, default: 123456
option pwd '123456'
# Enable detailed logging
option verbose '0'

View File

@ -0,0 +1,50 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2021 Tianling Shen <cnsztl@immortalwrt.org>
USE_PROCD=1
START=99
CONF="go-aliyundrive-webdav"
PROG="/usr/bin/go-aliyundrive-webdav"
start_service() {
config_load "$CONF"
local enabled
config_get_bool enabled "config" "enabled"
[ "$enabled" -eq "1" ] || return 1
local port rt path user pwd verbose
config_get port "config" "port"
config_get rt "config" "rt"
config_get path "config" "path"
config_get user "config" "user"
config_get pwd "config" "pwd"
config_get_bool verbose "config" "verbose"
procd_open_instance "$CONF"
procd_set_param command "$PROG"
procd_append_param command "-rt" "$rt"
procd_append_param command "-port" "$port"
procd_append_param command "-path" "$path"
procd_append_param command "-user" "$user"
procd_append_param command "-pwd" "$pwd"
[ "$verbose" -eq "0" ] || procd_append_param command "-v"
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "go-aliyundrive-webdav"
}

80
homeredirect/Makefile Normal file
View File

@ -0,0 +1,80 @@
#
# Copyright (c) 2020 xiaoqingfeng (xiaoqingfengatgm@gmail.com)
# Feed site - https://github.com/xiaoqingfengATGH/feeds-xiaoqingfeng
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=HomeRedirect
PKG_VERSION:=1.4
PKG_RELEASE:=
PKG_DATE:=20210226
PKG_MAINTAINER:=xiaoqingfeng <xiaoqingfengatgm@gmail.com>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Port forwarding utility for HomeLede.
DEPENDS:=+bash +coreutils-nohup +socat
PKGARCH:=all
URL:=https://github.com/xiaoqingfengATGH/feeds-xiaoqingfeng
endef
define Package/$(PKG_NAME)/config
help
$(PKG_NAME)
Version: $(PKG_VERSION)-$(PKG_RELEASE)
Port forwarding utility for HomeLede. Support TCP/UDP ipv4 & ipv6.
endef
define Package/$(PKG_NAME)/description
Port forwarding utility for HomeLede. Support TCP/UDP ipv4 & ipv6.
endef
define Package/$(PKG_NAME)/conffiles
/etc/config/homeredirect
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/homeredirect
$(INSTALL_BIN) files/etc/init.d/homeredirect $(1)/etc/init.d
$(INSTALL_CONF) files/etc/config/homeredirect $(1)/etc/config
$(INSTALL_DATA) files/etc/homeredirect/firewall.include $(1)/etc/homeredirect/
$(INSTALL_DATA) files/etc/homeredirect/script.sh $(1)/etc/homeredirect/
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
exit 0
endef
define Package/$(PKG_NAME)/prerm
#!/bin/sh
/etc/init.d/homeredirect stop
uci -q batch <<-EOF >/dev/null
delete ucitrack.@homeredirect[-1]
commit ucitrack
EOF
uci -q batch <<-EOF >/dev/null
delete firewall.homeredirect
EOF
exit 0
endef
define Build/Configure
endef
define Build/Prepare
endef
define Build/Compile
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,38 @@
config global
option enabled '1'
config redirect
option proto 'tcp4'
option src_ip '0.0.0.0'
option src_dport '60609'
option dest_ip '192.168.1.100'
option dest_port '3389'
option name 'TCP_REDIRECT_IPV4'
option enabled '0'
config redirect
option proto 'tcp6'
option src_ip '::'
option src_dport '60608'
option dest_ip 'fd5b:64cf:4ff4::1c4'
option dest_port '3389'
option name 'TCP_REDIRECT_IPV6'
option enabled '0'
config redirect
option proto 'udp4'
option src_ip '0.0.0.0'
option src_dport '64511'
option dest_ip '192.168.1.100'
option dest_port '500'
option name 'UDP_REDIRECT_IPV4'
option enabled '0'
config redirect
option proto 'udp6'
option src_ip '::'
option src_dport '64500'
option dest_ip 'fd5b:64cf:4ff4::1c4'
option dest_port '4500'
option name 'UDP_REDIRECT_IPV6'
option enabled '0'

View File

@ -0,0 +1 @@
bash /etc/homeredirect/script.sh

View File

@ -0,0 +1,45 @@
#!/bin/bash
del_rule() {
count=$(iptables -n -L INPUT 2>/dev/null | grep -c "HOME_REDIRECT")
if [ -n "$count" ]; then
until [ "$count" = 0 ]
do
rules=$(iptables -n -L INPUT --line-num 2>/dev/null | grep "HOME_REDIRECT" | awk '{print $1}')
for rule in $rules
do
iptables -D INPUT $rule 2>/dev/null
break
done
count=$(expr $count - 1)
done
fi
iptables -F HOME_REDIRECT 2>/dev/null
iptables -X HOME_REDIRECT 2>/dev/null
}
add_rule(){
iptables -N HOME_REDIRECT
iptables -I INPUT -j HOME_REDIRECT
maxRedirctCount=$(uci show homeredirect | grep @redirect | awk -F '[' '{print $2}' | awk -F ']' '{print $1}' | sort | tail -n 1)
for ((i=($maxRedirctCount);i>=0;i--));
do
enabled=$(uci get homeredirect.@redirect[$i].enabled)
if [ $enabled -eq 1 ]; then
protoAll=$(uci get homeredirect.@redirect[$i].proto)
proto=${protoAll:0:3}
port=$(uci get homeredirect.@redirect[$i].src_dport)
iptables -A HOME_REDIRECT -p $proto --dport $port -j ACCEPT
fi
done
}
del_rule
enable=$(uci get homeredirect.@global[0].enabled)
if [ $enable -eq 1 ]; then
add_rule
fi

View File

@ -0,0 +1,140 @@
#!/bin/sh /etc/rc.common
START=99
RUNLOG_DIR=/tmp/hr
PROCESSED_REDIRECT=0
log()
{
logger -t homeredirect $1
}
setupDefaultSrcIP() {
if [ -z $src_ip ];then
if [ "$1" = "ipv4" ]; then
src_ip="0.0.0.0"
else
src_ip="::"
fi
fi
}
setup() {
config_get enabled $1 enabled
id=$1
config_get proto $1 proto
config_get src_ip $1 src_ip
config_get src_dport $1 src_dport
config_get dest_ip $1 dest_ip
config_get dest_port $1 dest_port
config_get name $1 name
terminateRedirect $id
[ "$enabled" != "1" ] && return 0
PROCESSED_REDIRECT=1
if [ "$proto" = "tcp4" ]; then
src_addresstype="TCP4-LISTEN"
dest_addresstype="TCP4"
setupDefaultSrcIP "ipv4"
elif [ "$proto" = "tcp6" ]; then
src_addresstype="TCP6-LISTEN"
dest_addresstype="TCP6"
setupDefaultSrcIP "ipv6"
src_ip="[$src_ip]"
dest_ip="[$dest_ip]"
elif [ "$proto" = "udp4" ]; then
src_addresstype="UDP4-LISTEN"
dest_addresstype="UDP4"
setupDefaultSrcIP "ipv4"
elif [ "$proto" = "udp6" ]; then
src_addresstype="UDP6-LISTEN"
dest_addresstype="UDP6"
setupDefaultSrcIP "ipv6"
src_ip="[$src_ip]"
dest_ip="[$dest_ip]"
fi
#echo "nohup socat -lf $RUNLOG_DIR/$id.log $src_addresstype:$src_dport,bind=$src_ip,fork $dest_addresstype:$dest_ip:$dest_port > $RUNLOG_DIR/$id.log 2>&1 &"
nohup socat -lf $RUNLOG_DIR/$id.log $src_addresstype:$src_dport,bind=$src_ip,fork $dest_addresstype:$dest_ip:$dest_port > $RUNLOG_DIR/$id.log 2>&1 &
log "[HomeRedirect] Port redirect from $proto $src_ip:$src_dport==>$dest_addresstype:$dest_ip:$dest_port started."
}
# param $1 is port
showTcpPortState() {
local process=$(netstat -ltnp | awk -F ' ' '{if(NR>2) print $1"/"$4"/"$7}' | grep :$1)
if [ -n "$process" ]; then
echo $process
else
echo 'TCP Port $1 is Free.'
fi
}
# param $1 is port
showUdpPortState() {
local process=$(netstat -lunp | awk -F ' ' '{if(NR>2) print $1"/"$4"/"$6}'|grep :$1)
if [ -n "$process" ]; then
echo $process
else
echo 'UDP Port $1 is Free.'
fi
}
isRedirectRunning() {
local runningPID=$(ps | grep socat | grep $RUNLOG_DIR/$1 | sed '/grep/d' | awk -F ' ' '{print $1}')
if [ -n "$runningPID" ]; then
return 1
else
return 0
fi
}
# param $1 is redirect id
terminateRedirect() {
isRedirectRunning $1
[ "$?" = "1" ] && {
local runningPID=$(ps | grep socat | grep $RUNLOG_DIR/$1 | sed '/grep/d' | awk -F ' ' '{print $1}')
#echo "Going to kill process $runningPID"
kill $runningPID
}
}
terminateAll() {
local runningPIDs=$(ps | grep socat | grep $RUNLOG_DIR | sed '/grep/d' | awk -F ' ' '{print $1}')
[ -n "$runningPIDs" ] && {
kill $runningPIDs
log "Redirect process : $runningPIDs stopped."
}
}
start() {
local vt_enabled=$(uci -q get homeredirect.@global[0].enabled)
if [ "$vt_enabled" = 0 ]; then
terminateAll
fw3 reload
return 1
fi
rm -rf $RUNLOG_DIR
mkdir -p $RUNLOG_DIR
config_load homeredirect
PROCESSED_REDIRECT=0
config_foreach setup redirect
[ "$PROCESSED_REDIRECT" == "1" ] && {
fw3 reload
}
log 'HomeRedirect started.'
}
stop() {
terminateAll
fw3 reload
log 'HomeRedirect stopped.'
}

80
hysteria/Makefile Normal file
View File

@ -0,0 +1,80 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=hysteria
PKG_VERSION:=0.9.6
PKG_RELEASE:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/HyNetwork/hysteria/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=f543cfef69fc396c15248262d084aa3f6fef48a8cd98bdd8fda113fd4f5bf94c
PKG_LICENSE:=MIT
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_CONFIG_DEPENDS:= \
CONFIG_HYSTERIA_COMPRESS_GOPROXY \
CONFIG_HYSTERIA_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/tobyxdd/hysteria
GO_PKG_BUILD_PKG:=github.com/tobyxdd/hysteria/cmd
GO_PKG_LDFLAGS:=-s -w
GO_PKG_LDFLAGS_X:=main.appVersion=$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/hysteria
SECTION:=net
CATEGORY:=Network
TITLE:=A feature-packed network utility optimized for networks of poor quality
URL:=https://github.com/tobyxdd/hysteria
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
endef
define Package/hysteria/description
Hysteria is a feature-packed network utility optimized for networks
of poor quality (e.g. satellite connections, congested public Wi-Fi,
connecting from China to servers abroad) powered by a custom version
of QUIC protocol.
endef
define Package/hysteria/config
config HYSTERIA_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config HYSTERIA_COMPRESS_UPX
bool "Compress executable files with UPX"
depends on !mips64
default n
endef
ifeq ($(CONFIG_HYSTERIA_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.baidu.com
endif
define Build/Compile
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_HYSTERIA_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/cmd
endif
endef
define Package/hysteria/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cmd $(1)/usr/bin/hysteria
endef
$(eval $(call GoBinPackage,hysteria))
$(eval $(call BuildPackage,hysteria))

43
ipt2socks/Makefile Normal file
View File

@ -0,0 +1,43 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=ipt2socks
PKG_VERSION:=1.1.3
PKG_RELEASE:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/zfl9/ipt2socks/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=73a2498dc95934c225d358707e7f7d060b5ce81aa45260ada09cbd15207d27d1
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_LICENSE:=AGPL-3.0
PKG_LICENSE_FILE:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/ipt2socks
SECTION:=net
CATEGORY:=Network
TITLE:=Convert iptables to socks5
URL:=https://github.com/zfl9/ipt2socks
DEPENDS:=+libpthread +libuv
endef
define Package/ipt2socks/description
Utility for converting iptables (redirect/tproxy) to socks5.
endef
TARGET_CFLAGS += $(FPIC) -flto
TARGET_LDFLAGS += -flto
define Package/ipt2socks/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/ipt2socks $(1)/usr/bin
endef
$(eval $(call BuildPackage,ipt2socks))

76
kcptun/Makefile Normal file
View File

@ -0,0 +1,76 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=kcptun
PKG_VERSION:=20210922
PKG_RELEASE:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/xtaci/kcptun/tar.gz/v${PKG_VERSION}?
PKG_SOURCE_DATE:=2021-09-22
PKG_HASH:=f6a08f0fe75fa85d15f9c0c28182c69a5ad909229b4c230a8cbe38f91ba2d038
PKG_MAINTAINER:=Dengfeng Liu <liudf0716@gmail.com>, Chao Liu <expiron18@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE.md
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/xtaci/kcptun
GO_PKG_LDFLAGS_X:=main.VERSION=$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/kcptun-config
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=Kcptun Config Scripts
URL:=https://github.com/xtaci/kcptun
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/kcptun-config/conffiles
/etc/config/kcptun
endef
define Package/kcptun-config/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/kcptun.config $(1)/etc/config/kcptun
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/kcptun.init $(1)/etc/init.d/kcptun
endef
define Package/kcptun/Default
define Package/kcptun-$(1)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=KCP-based Secure Tunnel $(1)
URL:=https://github.com/xtaci/kcptun
DEPENDS:=+kcptun-config
endef
define Package/kcptun-$(1)/description
kcptun is a Stable & Secure Tunnel Based On KCP with N:M Multiplexing.
This package only contains kcptun $(1).
endef
define Package/kcptun-$(1)/install
$$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR))
$$(INSTALL_DIR) $$(1)/usr/bin
$$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/kcptun-$(1)
endef
endef
$(eval $(call BuildPackage,kcptun-config))
KCPTUN_COMPONENTS:=server client
$(foreach component,$(KCPTUN_COMPONENTS), \
$(eval $(call Package/kcptun/Default,$(component))) \
$(eval $(call GoBinPackage,kcptun-$(component))) \
$(eval $(call BuildPackage,kcptun-$(component))) \
)

View File

@ -0,0 +1,43 @@
config server
option disabled 1
option listen 29900
option target '127.0.0.1'
option target_port 12948
option crypt 'aes'
option key 'secret'
option mode 'fast'
option datashard 10
option parityshard 3
option dscp 46
option nocomp 1
option snmplog '/var/log/snmp.log'
option snmpperiod 60
option pprof 1
option quiet 1
option syslog 1
option user nobody
config client
option disabled 1
option bind_address '0.0.0.0'
option local_port 12948
option server 'vps'
option server_port 29900
option crypt 'aes'
option key 'secret'
option mode 'fast'
option conn 1
option autoexpire 0
option scavengettl 600
option mtu 1350
option sndwnd 128
option rcvwnd 512
option nocomp 1
option sockbuf 4194304
option smuxver 1
option smuxbuf 4194304
option streambuf 2097152
option keepalive 10
option quiet 1
option gogc 20
option user nobody

174
kcptun/files/kcptun.init Executable file
View File

@ -0,0 +1,174 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2019 Chao Liu <expiron18@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
USE_PROCD=1
START=99
confdir=/var/etc/kcptun
bindir=/usr/bin
mkjson_server_conf() {
[ "$disabled" = 0 ] || return 1
[ -n "$listen" ] || return 1
[ -n "$target" ] || return 1
[ -n "$target_port" ] || return 1
json_add_string listen ":$listen"
json_add_string target "$target:$target_port"
json_add_boolean pprof "$pprof"
}
mkjson_client_conf() {
[ "$disabled" = 0 ] || return 1
[ -n "$local_port" ] || return 1
[ -n "$server" ] || return 1
[ -n "$server_port" ] || return 1
json_add_string localaddr "$bind_address:$local_port"
json_add_string remoteaddr "$server:$server_port"
[ -z "$conn" ] || json_add_int conn "$conn"
[ -z "$autoexpire" ] || json_add_int autoexpire "$autoexpire"
[ -z "$scavengettl" ] || json_add_int scavengettl "$scavengettl"
}
kcptun() {
local cfg="$1"
local cfgtype="$2"
local bin="$bindir/kcptun-$cfgtype"
local confjson="$confdir/$cfgtype.$cfg.json"
[ -x "$bin" ] || return
eval "$("validate_${cfgtype}_section" "$cfg" validate_mklocal)"
"validate_${cfgtype}_section" "$cfg" || return
[ "$disabled" = 0 ] || return
json_init
mkjson_${cfgtype}_conf || return
[ -z "$crypt" ] || json_add_string crypt "$crypt"
[ -z "$key" ] || json_add_string key "$key"
[ -z "$mode" ] || json_add_string mode "$mode"
[ -z "$mtu" ] || json_add_int mtu "$mtu"
[ -z "$sndwnd" ] || json_add_int sndwnd "$sndwnd"
[ -z "$rcvwnd" ] || json_add_int rcvwnd "$rcvwnd"
[ -z "$datashard" ] || json_add_int datashard "$datashard"
[ -z "$parityshard" ] || json_add_int parityshard "$parityshard"
[ -z "$dscp" ] || json_add_int dscp "$dscp"
json_add_boolean nocomp "$nocomp"
[ -z "$sockbuf" ] || json_add_int sockbuf "$sockbuf"
[ -z "$smuxver" ] || json_add_int smuxver "$smuxver"
[ -z "$smuxbuf" ] || json_add_int smuxbuf "$smuxbuf"
[ -z "$streambuf" ] || json_add_int streambuf "$streambuf"
[ -z "$keepalive" ] || json_add_int keepalive "$keepalive"
[ -z "$snmplog" ] || json_add_string snmplog "$snmplog"
[ -z "$snmpperiod" ] || json_add_int snmpperiod "$snmpperiod"
json_add_boolean quiet "$quiet"
json_dump -i > "$confjson"
procd_open_instance "$cfgtype.$cfg"
procd_set_param command "$bin" -c "$confjson"
[ -z "$gogc" ] || procd_set_param env GOGC="$gogc"
[ -z "$syslog" ] || procd_set_param stderr 1
[ -z "$user" ] || procd_set_param user "$user"
procd_set_param file "$confjson"
procd_set_param respawn
procd_close_instance
}
start_service() {
local cfgtype
mkdir -p "$confdir"
config_load kcptun
for cfgtype in server client; do
config_foreach kcptun "$cfgtype" "$cfgtype"
done
}
stop_service() {
rm -rf "$confdir"
}
service_triggers() {
procd_add_reload_interface_trigger wan
procd_add_reload_trigger kcptun
procd_open_validate
validate_server_section
validate_client_section
procd_close_validate
}
validate_mklocal() {
local tuple opts
shift 2
for tuple in "$@"; do
opts="${tuple%%:*} $opts"
done
[ -z "$opts" ] || echo "local $opts"
}
validate() {
uci_validate_section kcptun "$@"
}
validate_common_options() {
local cfgtype="$1"; shift
local cfg="$1"; shift
local func="$1"; shift
local crypt_methods='"aes", "aes-128", "aes-192", "salsa20", "blowfish", "twofish", "cast5", "3des", "tea", "xtea", "xor", "sm4", "none"'
local mode_profiles='"fast3", "fast2", "fast", "normal", "manual"'
"${func:-validate}" "$cfgtype" "$cfg" "$@" \
'disabled:bool:0' \
'key:string' \
"crypt:or($crypt_methods)" \
"mode:or($mode_profiles)" \
'mtu:uinteger' \
'sndwnd:uinteger' \
'rcvwnd:uinteger' \
'datashard:uinteger' \
'parityshard:uinteger' \
'dscp:uinteger' \
'nocomp:bool' \
'sockbuf:uinteger' \
'smuxver:uinteger' \
'smuxbuf:uinteger' \
'streambuf:uinteger' \
'keepalive:uinteger' \
'snmplog:string' \
'snmpperiod:uinteger' \
'quiet:bool' \
'gogc:uinteger' \
'syslog:bool:1' \
'user:string:nobody'
}
validate_server_options() {
validate_common_options server "$@" \
'listen:port' \
'target:host' \
'target_port:port' \
'pprof:bool'
}
validate_client_options() {
validate_common_options client "$@" \
'bind_address:ipaddr' \
'local_port:port' \
'server:host' \
'server_port:port' \
'conn:uinteger' \
'autoexpire:uinteger' \
'scavengettl:uinteger'
}
validate_server_section() {
validate_server_options "$1" "$2"
}
validate_client_section() {
validate_client_options "$1" "$2"
}

70
libcryptopp/Makefile Normal file
View File

@ -0,0 +1,70 @@
#
# Copyright (C) 2009-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libcryptopp
PKG_VERSION:=5.6.4
PKG_RELEASE:=
PKG_SOURCE:=cryptopp$(subst .,,$(PKG_VERSION)).zip
PKG_SOURCE_URL:=http://www.cryptopp.com/
PKG_MD5SUM:=4ee7e5cdd4a45a14756c169eaf2a77fc
PKG_USE_NINJA:=0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libcryptopp
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libpthread +libstdcpp
TITLE:=Free C++ class library of cryptographic schemes
URL:=http://packages.debian.org/sid/libcrypto++-dev
endef
define Package/libcryptopp/description
Crypto++ is library for creating C++ programs which use cryptographic algorithms.
The library uses a Pipes & Filters architecture with heavy use of templates and
abstract base classes.
endef
#CONFIGURE_ARGS += \
# --enable-static \
# --enable-shared
#TARGET_LDFLAGS += \
# -lpthread
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS="$(FPIC)"
CMAKE_OPTIONS += -DBUILD_STATIC=ON
CMAKE_OPTIONS += -DBUILD_SHARED=ON
UNPACK_CMD=cd $(PKG_BUILD_DIR) && unzip "$(DL_DIR)/$(PKG_SOURCE)"
define Build/Prepare
$(Build/Prepare/Default)
cd $(PKG_BUILD_DIR) && rm -f GNUmakefile GNUmakefile-cross
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/cryptopp
$(CP) $(PKG_INSTALL_DIR)/usr/include/cryptopp/* $(1)/usr/include/cryptopp/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.{a,so*} $(1)/usr/lib/
endef
define Package/libcryptopp/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libcryptopp))

View File

@ -0,0 +1,18 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Access Control Configuration
LUCI_DEPENDS:=
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-accesscontrol
PKG_VERSION:=1
PKG_RELEASE:=
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,17 @@
module("luci.controller.mia",package.seeall)
function index()
if not nixio.fs.access("/etc/config/mia") then
return
end
entry({"admin", "services", "mia"}, cbi("mia"), _("Internet Access Schedule Control"), 30).dependent = true
entry({"admin", "services", "mia", "status"}, call("act_status")).leaf = true
end
function act_status()
local e = {}
e.running = luci.sys.call("iptables -L INPUT |grep MIA >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -0,0 +1,68 @@
a = Map("mia")
a.title = translate("Internet Access Schedule Control")
a.description = translate("Access Schedule Control Settins")
a:section(SimpleSection).template = "mia/mia_status"
t = a:section(TypedSection, "basic")
t.anonymous = true
e = t:option(Flag, "enable", translate("Enabled"))
e.rmempty = false
e = t:option(Flag, "strict", translate("Strict Mode"))
e.description = translate("Strict Mode will degrade CPU performance, but it can achieve better results")
e.rmempty = false
t = a:section(TypedSection, "macbind", translate("Client Rules"))
t.template = "cbi/tblsection"
t.anonymous = true
t.addremove = true
e = t:option(Flag, "enable", translate("Enabled"))
e.rmempty = false
e.default = "1"
e = t:option(Value, "macaddr", translate("MAC address (Computer Name)"))
e.rmempty = true
luci.sys.net.mac_hints(function(t,a)
e:value(t,"%s (%s)"%{t,a})
end)
e = t:option(Value, "timeon", translate("Start time"))
e.optional = false
e.default = "00:00"
e = t:option(Value, "timeoff", translate("End time"))
e.optional=false
e.default = "23:59"
e = t:option(Flag, "z1", translate("Mon"))
e.rmempty = true
e.default = 1
e = t:option(Flag, "z2", translate("Tue"))
e.rmempty = true
e.default=1
e = t:option(Flag, "z3", translate("Wed"))
e.rmempty = true
e.default = 1
e = t:option(Flag, "z4", translate("Thu"))
e.rmempty = true
e.default = 1
e = t:option(Flag, "z5", translate("Fri"))
e.rmempty = true
e.default = 1
e = t:option(Flag, "z6", translate("Sat"))
e.rmempty = true
e.default = 1
e = t:option(Flag, "z7", translate("Sun"))
e.rmempty = true
e.default = 1
return a

View File

@ -0,0 +1,22 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[services]], [[mia]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('mia_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green><%:Internet Access Schedule Control%> <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red><%:Internet Access Schedule Control%> <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="mia_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -0,0 +1,50 @@
msgid "Internet Access Schedule Control"
msgstr "上网时间控制"
msgid "Access Schedule Control Settins"
msgstr "设置客户端禁止访问互联网的时间"
msgid "General switch"
msgstr "开启/关闭"
msgid "Strict Mode"
msgstr "严格模式"
msgid "Strict Mode will degrade CPU performance, but it can achieve better results"
msgstr "严格模式会损耗部分CPU资源但可以按照时间规则立即拦截数据包效果更好"
msgid "Client Rules"
msgstr "客户端规则"
msgid "Description"
msgstr "描述"
msgid "MAC address (Computer Name)"
msgstr "MAC 地址 (主机名)"
msgid "Start time"
msgstr "开始时间"
msgid "End time"
msgstr "结束时间"
msgid "Mon"
msgstr "一"
msgid "Tue"
msgstr "二"
msgid "Wed"
msgstr "三"
msgid "Thu"
msgstr "四"
msgid "Fri"
msgstr "五"
msgid "Sat"
msgstr "六"
msgid "Sun"
msgstr "日"

View File

@ -0,0 +1 @@
zh-cn

View File

@ -0,0 +1,3 @@
config basic
option enable '0'

View File

@ -0,0 +1,88 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2015 OpenWrt-dist
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
START=30
CONFIG=mia
uci_get_by_type() {
local index=0
if [ -n $4 ]; then
index=$4
fi
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
echo ${ret:=$3}
}
add_rule(){
for i in $(seq 0 100)
do
local enable=$(uci_get_by_type macbind enable '' $i)
local macaddr=$(uci_get_by_type macbind macaddr '' $i)
local timeon=$(uci_get_by_type macbind timeon '' $i)
local timeoff=$(uci_get_by_type macbind timeoff '' $i)
local z1=$(uci_get_by_type macbind z1 '' $i)
local z2=$(uci_get_by_type macbind z2 '' $i)
local z3=$(uci_get_by_type macbind z3 '' $i)
local z4=$(uci_get_by_type macbind z4 '' $i)
local z5=$(uci_get_by_type macbind z5 '' $i)
local z6=$(uci_get_by_type macbind z6 '' $i)
local z7=$(uci_get_by_type macbind z7 '' $i)
[ "$z1" == "1" ] && Z1="Mon,"
[ "$z2" == "1" ] && Z2="Tue,"
[ "$z3" == "1" ] && Z3="Wed,"
[ "$z4" == "1" ] && Z4="Thu,"
[ "$z5" == "1" ] && Z5="Fri,"
[ "$z6" == "1" ] && Z6="Sat,"
[ "$z7" == "1" ] && Z7="Sun"
if [ -z $enable ] || [ -z $macaddr ] || [ -z $timeoff ] || [ -z $timeon ]; then
break
fi
if [ "$enable" == "1" ]; then
iptables -t filter -I MIA -m mac --mac-source $macaddr -m time --kerneltz --timestart $timeon --timestop $timeoff --weekdays $Z1$Z2$Z3$Z4$Z5$Z6$Z7 -j DROP
fi
for n in $(seq 1 7)
do
unset "Z$n"
done
done
}
del_rule(){
type=$1
blackMacAdd=$(iptables -t nat -L $type | grep -w RETURN | grep -w "MAC" | awk '{print $7}')
[ -n "$blackMacAdd" ] && {
for macaddrb in $blackMacAdd
do
iptables -t nat -D $type -m mac --mac-source $macaddrb -j RETURN
done
}
}
start(){
stop
enable=$(uci get mia.@basic[0].enable)
[ $enable -eq 0 ] && exit 0
iptables -t filter -N MIA
iptables -I INPUT -p udp --dport 53 -m comment --comment "Rule For Control" -j MIA
iptables -I INPUT -p tcp --dport 53 -m comment --comment "Rule For Control" -j MIA
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 -m comment --comment "Rule For Control"
iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 -m comment --comment "Rule For Control"
strict=$(uci get mia.@basic[0].strict)
[ $strict -eq 1 ] && iptables -t filter -I FORWARD -m comment --comment "Rule For Control" -j MIA
add_rule
}
stop(){
iptables -t filter -D FORWARD -m comment --comment "Rule For Control" -j MIA 2>/dev/null
iptables -D INPUT -p udp --dport 53 -m comment --comment "Rule For Control" -j MIA 2>/dev/null
iptables -D INPUT -p tcp --dport 53 -m comment --comment "Rule For Control" -j MIA 2>/dev/null
iptables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 -m comment --comment "Rule For Control" 2>/dev/null
iptables -t nat -D PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 -m comment --comment "Rule For Control" 2>/dev/null
iptables -t filter -F MIA 2>/dev/null
iptables -t filter -X MIA 2>/dev/null
}

View File

@ -0,0 +1 @@
/etc/init.d/mia restart

View File

@ -0,0 +1,17 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@mia[-1]
add ucitrack mia
set ucitrack.@mia[-1].init=mia
commit ucitrack
delete firewall.mia
set firewall.mia=include
set firewall.mia.type=script
set firewall.mia.path=/etc/mia.include
set firewall.mia.reload=1
commit firewall
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,11 @@
{
"luci-app-accesscontrol": {
"description": "Grant UCI access for luci-app-accesscontrol",
"read": {
"uci": [ "mia" ]
},
"write": {
"uci": [ "mia" ]
}
}
}

View File

@ -0,0 +1,17 @@
# Copyright (C) 2020 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Adbyby
LUCI_DEPENDS:=+adbyby +uclient-fetch +ipset +dnsmasq-full
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-adbyby-plus
PKG_VERSION:=2.0
PKG_RELEASE:=
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,86 @@
module("luci.controller.adbyby", package.seeall)
function index()
if not nixio.fs.access("/etc/config/adbyby") then
return
end
entry({"admin", "services", "adbyby"}, alias("admin", "services", "adbyby", "base"), _("ADBYBY Plus +"), 9).dependent = true
entry({"admin", "services", "adbyby", "base"}, cbi("adbyby/base"), _("Base Setting"), 10).leaf = true
entry({"admin", "services", "adbyby", "advanced"}, cbi("adbyby/advanced"), _("Advance Setting"), 20).leaf = true
entry({"admin", "services", "adbyby", "help"}, form("adbyby/help"), _("Plus+ Domain List"), 30).leaf = true
entry({"admin", "services", "adbyby", "esc"}, form("adbyby/esc"), _("Bypass Domain List"), 40).leaf = true
entry({"admin", "services", "adbyby", "black"}, form("adbyby/black"), _("Block Domain List"), 50).leaf = true
entry({"admin", "services", "adbyby", "block"}, form("adbyby/block"), _("Block IP List"), 60).leaf = true
entry({"admin", "services", "adbyby", "user"}, form("adbyby/user"), _("User-defined Rule"), 70).leaf = true
entry({"admin", "services", "adbyby", "refresh"}, call("refresh_data"))
entry({"admin", "services", "adbyby", "run"}, call("act_status")).leaf = true
end
function act_status()
local e = {}
e.running = luci.sys.call("pgrep adbyby >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function refresh_data()
local set = luci.http.formvalue("set")
local icount = 0
if set == "rule_data" then
luci.sys.exec("/usr/share/adbyby/rule-update")
icount = luci.sys.exec("/usr/share/adbyby/rule-count '/tmp/rules/'")
if tonumber(icount)>0 then
if nixio.fs.access("/usr/share/adbyby/rules/") then
oldcount = luci.sys.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'")
else
oldcount=0
end
else
retstring ="-1"
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("rm -f /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/* && cp -a /tmp/rules /usr/share/adbyby/")
luci.sys.exec("/etc/init.d/adbyby restart &")
retstring=tostring(math.ceil(tonumber(icount)))
else
retstring ="0"
end
else
refresh_cmd = "uclient-fetch -q --no-check-certificate -O - 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt' > /tmp/adnew.conf"
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/share/adbyby/ad-update")
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
if tonumber(icount)>0 then
if nixio.fs.access("/usr/share/adbyby/dnsmasq.adblock") then
oldcount = luci.sys.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
else
oldcount=0
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/ad.conf /usr/share/adbyby/dnsmasq.adblock")
luci.sys.exec("cp -f /tmp/ad.conf /tmp/etc/dnsmasq-adbyby.d/adblock")
luci.sys.exec("/etc/init.d/adbyby restart &")
retstring=tostring(math.ceil(tonumber(icount)))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/ad.conf")
else
retstring ="-1"
end
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring ,retcount=icount})
end

View File

@ -0,0 +1,57 @@
local SYS = require "luci.sys"
local ND = SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
local ad_count=0
if nixio.fs.access("/usr/share/adbyby/dnsmasq.adblock") then
ad_count=tonumber(SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l"))
end
local rule_count=0
if nixio.fs.access("/usr/share/adbyby/rules/") then
rule_count=tonumber(SYS.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'"))
end
m = Map("adbyby")
s = m:section(TypedSection, "adbyby")
s.anonymous = true
o = s:option(Flag, "block_ios")
o.title = translate("Block Apple iOS OTA update")
o.default = 0
o.rmempty = false
o = s:option(Flag, "block_cnshort")
o.title = translate("Block CNshort APP and Website")
o.default = 0
o.rmempty = false
o = s:option(Flag, "cron_mode")
o.title = translate("Update the rule at 6 a.m. every morning and restart adbyby")
o.default = 0
o.rmempty = false
o=s:option(DummyValue,"ad_data",translate("Adblock Plus Data"))
o.rawhtml = true
o.template = "adbyby/refresh"
o.value =ad_count .. " " .. translate("Records")
o=s:option(DummyValue,"rule_data",translate("Subscribe 3rd Rules Data"))
o.rawhtml = true
o.template = "adbyby/refresh"
o.value =rule_count .. " " .. translate("Records")
o.description = translate("AdGuardHome / Host / DNSMASQ rules auto-convert")
o = s:option(Button,"delete",translate("Delete All Subscribe Rules"))
o.inputstyle = "reset"
o.write = function()
SYS.exec("rm -f /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/*")
SYS.exec("/etc/init.d/adbyby restart 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adbyby", "advanced"))
end
o = s:option(DynamicList, "subscribe_url", translate("Anti-AD Rules Subscribe"))
o.rmempty = true
return m

View File

@ -0,0 +1,66 @@
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local DL = SYS.exec("head -1 /tmp/adbyby/data/lazy.txt | awk -F' ' '{print $3,$4}'") or ""
local DV = SYS.exec("head -1 /tmp/adbyby/data/video.txt | awk -F' ' '{print $3,$4}'") or ""
local NR = SYS.exec("grep -v '^!' /usr/share/adbyby/data/rules.txt | wc -l")
local NU = SYS.exec("cat /usr/share/adbyby/data/user.txt | wc -l")
local UD = NXFS.readfile("/tmp/adbyby.updated") or "1970-01-01 00:00:00"
m = Map("adbyby")
m.title = translate("Adbyby Plus + Settings")
m.description = translate("Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Host,filtering ads without losing bandwidth</font>")
m:section(SimpleSection).template = "adbyby/adbyby_status"
s = m:section(TypedSection, "adbyby")
s.anonymous = true
o = s:option(Flag, "enable", translate("Enable"))
o.default = 0
o.rmempty = false
o = s:option(ListValue, "wan_mode", translate("Running Mode"))
o:value("0", translate("Global Mode (The slowest and the best effects)"))
o:value("1", translate("Plus + Mode (Filter domain name list and blacklist website.Recommended)"))
o:value("2", translate("No filter Mode (Must set in Client Filter Mode Settings manually)"))
o.default = 1
o.rmempty = false
o = s:option(Button, "restart", translate("Adbyby and Rule state"))
o.inputtitle = translate("Update Adbyby Rules Manually")
o.description = string.format("<strong>"..translate("Last Update Checked")..":</strong> %s<br /><strong>"..translate("Lazy Rule")..":</strong>%s <br /><strong>"..translate("Video Rule")..":</strong>%s", UD, DL, DV)
o.inputstyle = "reload"
o.write = function()
SYS.call("rm -rf /tmp/adbyby.updated /tmp/adbyby/admd5.json && /usr/share/adbyby/adbybyupdate.sh > /tmp/adupdate.log 2>&1 &")
SYS.call("sleep 5")
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
t = m:section(TypedSection, "acl_rule", translate("<strong>Client Filter Mode Settings</strong>"))
t.description = translate("Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default.")
t.template = "cbi/tblsection"
t.sortable = true
t.anonymous = true
t.addremove = true
e = t:option(Value, "ipaddr", translate("IP Address"))
e.width = "40%"
e.datatype = "ip4addr"
e.placeholder = "0.0.0.0/0"
luci.ip.neighbors({ family = 4 }, function(entry)
if entry.reachable then
e:value(entry.dest:string())
end
end)
e = t:option(ListValue, "filter_mode", translate("Filter Mode"))
e.width = "40%"
e.default = "disable"
e.rmempty = false
e:value("disable", translate("No filter"))
e:value("global", translate("Global filter"))
return m

View File

@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/usr/share/adbyby/adblack.conf"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/adbyby restart")
end
end
return true
end
return f

View File

@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/usr/share/adbyby/blockip.conf"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/adbyby restart")
end
end
return true
end
return f

View File

@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/usr/share/adbyby/adesc.conf"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/adbyby restart")
end
end
return true
end
return f

View File

@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/usr/share/adbyby/adhost.conf"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/adbyby restart")
end
end
return true
end
return f

View File

@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/usr/share/adbyby/rules.txt"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/adbyby restart")
end
end
return true
end
return f

View File

@ -0,0 +1,22 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[services]], [[adbyby]], [[run]])%>', null,
function(x, data) {
var tb = document.getElementById('adbyby_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>Adbyby Plus+ <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>Adbyby Plus+ <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="adbyby_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -0,0 +1,35 @@
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
function refresh_data(btn,dataname)
{
btn.disabled = true;
btn.value = '<%:Refresh...%> ';
murl=dataname;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "adbyby","refresh")%>',
{ set:murl },
function(x,rv)
{
var s = document.getElementById(dataname+'-status');
if (s)
{
if (rv.ret=="0")
s.innerHTML ="<font color='green'>"+"<%:No new data!%> "+"</font>";
else if(rv.ret=="-1")
{
s.innerHTML ="<font color='red'>"+"<%:Refresh Error!%> "+"</font>";
}
else
{
s.innerHTML ="<font color='green'>"+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.ret+"</font>";
}
}
btn.disabled = false;
btn.value = '<%:Refresh Data %>';
}
);
return false;
}
//]]></script>
<input type="button" class="cbi-button cbi-input-reload" value="<%:Refresh Data%> " onclick="return refresh_data(this,'<%=self.option%>')" />
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
<%+cbi/valuefooter%>

View File

@ -0,0 +1,198 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: dingpengyu <dingpengyu06@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"X-Generator: Poedit 2.3.1\n"
msgid "ADBYBY Plus +"
msgstr "广告屏蔽大师 Plus+"
msgid "<strong><font color=\"green\">Adbyby Plus + is Running</font></strong>"
msgstr "<strong><font color=\"green\">广告屏蔽大师 Plus + 正在运行</font></strong>"
msgid "<strong><font color=\"red\">Adbyby Plus + is Not Running</font></strong>"
msgstr "<strong><font color=\"red\">广告屏蔽大师 Plus + 没有运行</font></strong>"
msgid "Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Host,filtering ads without losing bandwidth</font>"
msgstr "广告屏蔽大师 Plus + 可以全面过滤各种横幅、弹窗、视频广告,同时阻止跟踪、隐私窃取及各种恶意网站<br /><font color=\"red\">Plus + 版本可以和 Adblock Plus Host 结合方式运行,过滤广告不损失带宽</font>"
msgid "Adbyby Plus +"
msgstr "广告屏蔽大师 Plus+"
msgid "Adbyby Plus + Settings"
msgstr "广告屏蔽大师 Plus+(支持 AdGuardHome /Host / DNSMASQ 规则)"
msgid "Base Setting"
msgstr "基本设置"
msgid "Running Mode"
msgstr "运行模式"
msgid "Global Mode (The slowest and the best effects)"
msgstr "全局模式(最慢, 效果最好)"
msgid "Plus + Mode (Filter domain name list and blacklist website.Recommended)"
msgstr "Plus + 模式只过滤列表内域名结合ABP名单。推荐"
msgid "No filter Mode (Must set in Client Filter Mode Settings manually)"
msgstr "手动代理模式(必须手动设置浏览器代理,或者客户端过滤模式设置)"
msgid "Transparent proxy"
msgstr "透明代理"
msgid "Click to disable"
msgstr "点击关闭"
msgid "Click to enable"
msgstr "点击开启"
msgid "Adbyby and Rule state"
msgstr "规则状态"
msgid "Restart Adbyby"
msgstr "重启Adbyby"
msgid "Plus+ Domain List"
msgstr "Plus+ 模式过滤的域名"
msgid "Bypass Domain List"
msgstr "域名白名单"
msgid "Black Domain List"
msgstr "域名黑名单"
msgid "Black IP List"
msgstr "IP黑名单"
msgid "Advance Setting"
msgstr "高级设置"
msgid "Update the rule at 6 a.m. every morning and restart adbyby"
msgstr "每天凌晨6点更新规则并重启"
msgid "ADP Host List"
msgstr "Adblock Plus Hosts 记录数"
msgid "Adblock Plus Data"
msgstr "Adblock Plus 规则数据库"
msgid "Subscribe 3rd Rules Data"
msgstr "订阅第三方去广告规则"
msgid "Records"
msgstr "条记录"
msgid "Refresh Data"
msgstr "更新数据库"
msgid "Refresh..."
msgstr "正在更新,请稍候.."
msgid "Refresh OK!"
msgstr "更新成功!"
msgid "Refresh Error!"
msgstr "更新失败!"
msgid "No new data!"
msgstr "你已经是最新数据,无需更新!"
msgid "Total Records:"
msgstr "新的总纪录数:"
msgid "Delete All Subscribe Rules"
msgstr "清空所有订阅的规则库"
msgid "Anti-AD Rules Subscribe"
msgstr "广告过滤规则订阅URL"
msgid "AdGuardHome / Host / DNSMASQ rules auto-convert"
msgstr "AdGuardHome / Host / DNSMASQ 规则自动识别"
msgid "Manually force update<br />Adblock Plus Host List"
msgstr "手动强制更新<br />Adblock Plus Host List"
msgid "Update Adbyby Rules Manually"
msgstr "手动更新规则"
msgid "Block Apple iOS OTA update"
msgstr "拦截 Apple iOS 的OTA更新"
msgid "Block CNshort APP and Website"
msgstr "拦截 短视频 APP 和网站"
msgid "RAM Running Mode"
msgstr "内存运行模式"
msgid "Running Adbyby in RAM.More speed,less disk consumption"
msgstr "在内存中运行Adbyby。更快的速度更少的存储空间损耗"
msgid "User-defined Rule"
msgstr "用户自定义规则"
msgid "<strong>Client Filter Mode Settings</strong>"
msgstr "<strong>客户端过滤模式设置</strong>"
msgid "Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default."
msgstr "可以为局域网客户端分别设置不同的过滤模式 ( <font color=blue> 不过滤 , 全局过滤 </font> ) 。默认无需设置。"
msgid "IP Address"
msgstr "IP地址"
msgid "Filter Mode"
msgstr "过滤模式"
msgid "!Note that you should fill to the domain name ONLY. For example, http://www.baidu.com only needs to write to baidu.com. One line for each"
msgstr "这些域名在 Plus 模式中会被过滤。你需要要填写域名即可,例如 http://www.baidu.com你写 baidu.com 即可。每行一个域名"
msgid "!Will Never filter these Domain"
msgstr "永不过滤白名单内的域名(所有模式中生效)"
msgid "!Will Always block these Domain"
msgstr "拦截黑名单内的域名(所有模式中生效)"
msgid "!Will Always block these IP"
msgstr "拦截黑名单内的IP地址所有模式中生效"
msgid "Each line of the beginning exclamation mark is considered an annotation."
msgstr "每行一条规则,感叹号开头的被认为是注释。"
msgid "<strong><font color=blue>Adblock Plus Host List</font></strong>"
msgstr "<strong><font color=blue>Adblock Plus Host 列表:</font></strong>"
msgid "Note: It needs to download and convert the rules. The background process may takes 60-120 seconds to run. <br / > After completed it would automatically refresh, please do not duplicate click!"
msgstr "注意需要下载并转换规则。后台进程可能需要60-120秒运行。完成后会自动刷新请不要重复点击"
msgid "No filter"
msgstr "不过滤"
msgid "Global filter"
msgstr "全局过滤"
msgid "Update adbyby rules form official website first"
msgstr "优先从官方网站更新规则"
msgid "Last Update Checked"
msgstr "上一次检查规则更新"
msgid "Lazy Rule"
msgstr "正式版规则"
msgid "Video Rule"
msgstr "测试版规则"
msgid "Adblock Plus Host List"
msgstr "广告屏蔽大师 Plus 规则列表"
msgid "Block Domain List"
msgstr "域名黑名单"
msgid "Block IP List"
msgstr "IP黑名单"

View File

@ -0,0 +1 @@
zh-cn

Some files were not shown because too many files have changed in this diff Show More