🎉 Sync 2022-02-07 18:06:10

This commit is contained in:
github-actions[bot] 2022-02-07 18:06:10 +08:00
parent 607f515659
commit 7bfee8c26e
3239 changed files with 0 additions and 1680597 deletions

View File

@ -1,76 +0,0 @@
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

@ -1,14 +0,0 @@
-----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

@ -1,15 +0,0 @@
-----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

@ -1,9 +0,0 @@
-----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

@ -1,52 +0,0 @@
# 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))

View File

@ -1,76 +0,0 @@
#
# 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)))

View File

@ -1,16 +0,0 @@
#!/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

View File

@ -1,14 +0,0 @@
[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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,25 +0,0 @@
! -----¸üÐÂʱ¼ä: 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

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

View File

@ -1,30 +0,0 @@
! -----更新时间: 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

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +0,0 @@
;¸üйæÔò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

Binary file not shown.

View File

@ -1,58 +0,0 @@
#
# 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

@ -1,63 +0,0 @@
/**
* 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

@ -1,28 +0,0 @@
/*
* =====================================================================================
*
* 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;
}

View File

@ -1,16 +0,0 @@
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

File diff suppressed because it is too large Load Diff

View File

@ -1,161 +0,0 @@
#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

@ -1,25 +0,0 @@
//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

@ -1,54 +0,0 @@
#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

View File

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

View File

@ -1,44 +0,0 @@
# -*- 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

@ -1,61 +0,0 @@
--- 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

View File

@ -1,38 +0,0 @@
#
# 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))

View File

@ -1,27 +0,0 @@
#!/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

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

View File

@ -1,84 +0,0 @@
#
# 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

@ -1,21 +0,0 @@
--- 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

@ -1,61 +0,0 @@
#
# 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

@ -1,79 +0,0 @@
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

@ -1,260 +0,0 @@
#!/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

@ -1,313 +0,0 @@
#/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 "$@"

View File

@ -1,37 +0,0 @@
# 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

@ -1,40 +0,0 @@
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

View File

@ -1,42 +0,0 @@
#
# 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)))

Binary file not shown.

View File

@ -1,10 +0,0 @@
#!/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

View File

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

Binary file not shown.

View File

@ -1,51 +0,0 @@
#
# 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

@ -1,81 +0,0 @@
# 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

@ -1,23 +0,0 @@
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

@ -1,50 +0,0 @@
#!/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"
}

View File

@ -1,70 +0,0 @@
#
# 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

@ -1,18 +0,0 @@
# 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

@ -1,17 +0,0 @@
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

@ -1,68 +0,0 @@
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

@ -1,22 +0,0 @@
<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

@ -1,50 +0,0 @@
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

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

View File

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

View File

@ -1,88 +0,0 @@
#!/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

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

View File

@ -1,17 +0,0 @@
#!/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

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

View File

@ -1,17 +0,0 @@
# 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

@ -1,86 +0,0 @@
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

@ -1,57 +0,0 @@
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

@ -1,66 +0,0 @@
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

@ -1,23 +0,0 @@
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

@ -1,23 +0,0 @@
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

@ -1,23 +0,0 @@
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

@ -1,23 +0,0 @@
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

@ -1,23 +0,0 @@
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

@ -1,22 +0,0 @@
<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

@ -1,35 +0,0 @@
<%+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

@ -1,198 +0,0 @@
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

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

View File

@ -1,11 +0,0 @@
config adbyby
option daemon '2'
option lan_mode '0'
option cron_mode '1'
option block_ios '0'
option enable '0'
option wan_mode '1'
option mem_mode '1'
option update_source '1'

View File

@ -1,254 +0,0 @@
#!/bin/sh /etc/rc.common
START=96
STOP=10
EXTRA_COMMANDS="add_rule del_rule reload_rule"
PROG_PATH=/usr/share/adbyby
DATA_PATH=$PROG_PATH/data
WAN_FILE=/var/etc/dnsmasq-adbyby.d/03-adbyby-ipset.conf
CRON_FILE=/etc/crontabs/root
CONFIG=adbyby
ipt_n="iptables -t nat"
uci_get_by_name() {
local ret=$(uci get $CONFIG.$1.$2 2>/dev/null)
echo ${ret:=$3}
}
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}
}
get_config()
{
config_get_bool enable $1 enable 0
config_get_bool cron_mode $1 cron_mode 1
config_get wan_mode $1 wan_mode 1
config_get_bool block_ios $1 block_ios 0
config_get_bool mem_mode $1 mem_mode 1
config_get_bool block_cnshort $1 block_cnshort 0
}
add_rules()
{
rm -f $DATA_PATH/user.bin
grep -v ^! $PROG_PATH/rules.txt > $DATA_PATH/user.txt
cp $PROG_PATH/rules.txt $DATA_PATH/rules.txt
}
add_cron()
{
if [ $cron_mode -eq 1 ]; then
sed -i '/adblock.sh/d' $CRON_FILE
echo '0 6 * * * /usr/share/adbyby/adblock.sh > /tmp/adupdate.log 2>&1' >> $CRON_FILE
crontab $CRON_FILE
fi
}
del_cron()
{
sed -i '/adblock.sh/d' $CRON_FILE
/etc/init.d/cron restart
}
ip_rule()
{
ipset -N adbyby_esc hash:ip
$ipt_n -A ADBYBY -m set --match-set adbyby_esc dst -j RETURN
local icount=$(uci show adbyby | grep 'filter_mode' | wc -l)
let icount=icount-1
for i in $(seq 0 $icount)
do
local ip=$(uci_get_by_type acl_rule ipaddr '' $i)
local mode=$(uci_get_by_type acl_rule filter_mode '' $i)
case "$mode" in
disable)
$ipt_n -A ADBYBY -s $ip -j RETURN
;;
global)
$ipt_n -A ADBYBY -s $ip -p tcp -j REDIRECT --to-ports 8118
$ipt_n -A ADBYBY -s $ip -j RETURN
;;
esac
done
case $wan_mode in
0)
;;
1)
ipset -N adbyby_wan hash:ip
$ipt_n -A ADBYBY -m set ! --match-set adbyby_wan dst -j RETURN
;;
2)
$ipt_n -A ADBYBY -j RETURN
;;
esac
echo "create blockip hash:net family inet hashsize 1024 maxelem 65536" > /tmp/blockip.ipset
awk '!/^$/&&!/^#/{printf("add blockip %s'" "'\n",$0)}' /usr/share/adbyby/blockip.conf >> /tmp/blockip.ipset
ipset -! restore < /tmp/blockip.ipset 2>/dev/null
iptables -I FORWARD -m set --match-set blockip dst -j DROP
iptables -I OUTPUT -m set --match-set blockip dst -j DROP
}
add_dns()
{
mkdir -p /var/etc/dnsmasq-adbyby.d
mkdir -p /tmp/dnsmasq.d
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_esc"'\n",$0)}' $PROG_PATH/adesc.conf > /var/etc/dnsmasq-adbyby.d/06-dnsmasq.esc
awk '!/^$/&&!/^#/{printf("address=/%s/'"0.0.0.0"'\n",$0)}' $PROG_PATH/adblack.conf > /var/etc/dnsmasq-adbyby.d/07-dnsmasq.black
echo 'conf-dir=/var/etc/dnsmasq-adbyby.d' > /tmp/dnsmasq.d/dnsmasq-adbyby.conf
local var=1
if [ $wan_mode -eq 1 ]; then
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_wan"'\n",$0)}' $PROG_PATH/adhost.conf > $WAN_FILE
if ls /var/etc/dnsmasq-adbyby.d/* >/dev/null 2>&1; then
mkdir -p /tmp/dnsmasq.d
cp /usr/share/adbyby/dnsmasq.adblock /var/etc/dnsmasq-adbyby.d/04-dnsmasq.adblock
cp /usr/share/adbyby/dnsmasq.ads /var/etc/dnsmasq-adbyby.d/05-dnsmasq.ads
fi
fi
mkdir -p /tmp/adbyby/rules/data /tmp/adbyby/rules/host
rm -f /tmp/adbyby/rules/data/* /tmp/adbyby/rules/host/*
cp -a /usr/share/adbyby/rules/data/* /tmp/adbyby/rules/data 2>/dev/null
cp -a /usr/share/adbyby/rules/host/* /tmp/adbyby/rules/host 2>/dev/null
echo 'addn-hosts=/tmp/adbyby/rules/host/' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
echo 'conf-dir=/tmp/adbyby/rules/data' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
[ $block_ios -eq 1 ] && echo 'address=/mesu.apple.com/0.0.0.0' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
if [ $block_cnshort -eq 1 ]; then
cat <<-EOF >/tmp/etc/dnsmasq-adbyby.d/08-dnsmasq.cnshort
address=/api.amemv.com/0.0.0.0
address=/.amemv.com/0.0.0.0
address=/.tiktokv.com/0.0.0.0
address=/.snssdk.com/0.0.0.0
address=/.douyin.com/0.0.0.0
address=/.ixigua.com/0.0.0.0
address=/.pstatp.com/0.0.0.0
address=/.ixiguavideo.com/0.0.0.0
address=/.v.kandian.qq.com/0.0.0.0
address=/.yximgs.com/0.0.0.0
address=/.gifshow.com/0.0.0.0
address=/.ksapisrv.com/0.0.0.0
address=/.kuaishoupay.com/0.0.0.0
address=/.ksyun.com/0.0.0.0
address=/.live.xycdn.com/0.0.0.0
address=/.danuoyi.alicdn.com/0.0.0.0
address=/.v.weishi.qq.com/0.0.0.0
address=/.pearvideo.com/0.0.0.0
address=/.miaopai.com/0.0.0.0
address=/.kuaishou.com/0.0.0.0
address=/.qupai.me/0.0.0.0
address=/.meipai.com/0.0.0.0
address=/.huoshan.com/0.0.0.0
address=/.ergengtv.com/0.0.0.0
address=/.baijiahao.baidu.com/0.0.0.0
address=/.xiongzhang.baidu.com/0.0.0.0
EOF
fi
}
del_dns()
{
rm -f /tmp/dnsmasq.d/dnsmasq-adbyby.conf
rm -f /var/etc/dnsmasq-adbyby.d/*
rm -f /tmp/adbyby_host.conf
}
add_rule()
{
$ipt_n -N ADBYBY
$ipt_n -A ADBYBY -d 0.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 10.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 127.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 169.254.0.0/16 -j RETURN
$ipt_n -A ADBYBY -d 172.16.0.0/12 -j RETURN
$ipt_n -A ADBYBY -d 192.168.0.0/16 -j RETURN
$ipt_n -A ADBYBY -d 224.0.0.0/4 -j RETURN
$ipt_n -A ADBYBY -d 240.0.0.0/4 -j RETURN
ip_rule
if [ $(ipset list music -name -quiet | grep music) ]; then
$ipt_n -A ADBYBY -m set --match-set music dst -j RETURN 2>/dev/null
fi
$ipt_n -A ADBYBY -p tcp -j REDIRECT --to-ports 8118 2>/dev/null
$ipt_n -I PREROUTING -p tcp --dport 80 -j ADBYBY 2>/dev/null
mkdir -p /var/etc
echo -e "/etc/init.d/adbyby restart" > "/var/etc/adbyby.include"
}
del_rule()
{
$ipt_n -D PREROUTING -p tcp --dport 80 -j ADBYBY 2>/dev/null
$ipt_n -F ADBYBY 2>/dev/null
$ipt_n -X ADBYBY 2>/dev/null
iptables -D FORWARD -m set --match-set blockip dst -j DROP 2>/dev/null
iptables -D OUTPUT -m set --match-set blockip dst -j DROP 2>/dev/null
ipset -F adbyby_esc 2>/dev/null
ipset -X adbyby_esc 2>/dev/null
ipset -F adbyby_wan 2>/dev/null
ipset -X adbyby_wan 2>/dev/null
ipset -F blockip 2>/dev/null
ipset -X blockip 2>/dev/null
}
reload_rule()
{
config_load adbyby
config_foreach get_config adbyby
del_rule
[ $enable -eq 0 ] && exit 0
add_rule
}
start()
{
config_load adbyby
config_foreach get_config adbyby
if [ $enable -ne 0 ]; then
add_cron
[ ! -d "/tmp/adbyby/data" ] && cp -a /usr/share/adbyby /tmp/ && rm -f /tmp/adbyby.updated
add_rules
/tmp/adbyby/adbyby >/dev/null 2>&1 &
add_dns
add_rule
/etc/init.d/dnsmasq restart
fi
}
stop()
{
kill -9 $(busybox ps -w | grep "/tmp/adbyby/adbyby" | grep -v grep | grep -v update| grep -v adblock | awk '{print $1}') >/dev/null 2>&1
config_load adbyby
config_foreach get_config adbyby
del_rule
del_cron
del_dns
/etc/init.d/dnsmasq restart
}
boot()
{
mkdir -p /tmp/adbyby && cp -a /usr/share/adbyby /tmp/
start
}

View File

@ -1,30 +0,0 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@adbyby[-1]
add ucitrack adbyby
set ucitrack.@adbyby[-1].init=adbyby
commit ucitrack
delete firewall.adbyby
set firewall.adbyby=include
set firewall.adbyby.type=script
set firewall.adbyby.path=/var/etc/adbyby.include
set firewall.adbyby.reload=1
delete firewall.adblock
add firewall rule
rename firewall.@rule[-1]="adblock"
set firewall.@rule[-1].name="adblock"
set firewall.@rule[-1].target="DROP"
set firewall.@rule[-1].src="wan"
set firewall.@rule[-1].proto="tcp"
set firewall.@rule[-1].dest_port="8118"
commit firewall
EOF
mkdir -p /etc/dnsmasq.d
/etc/init.d/adbyby stop
/etc/init.d/adbyby enable
rm -f /tmp/luci-indexcache
exit 0

View File

@ -1,6 +0,0 @@
/usr/share/adbyby/adhost.conf
/usr/share/adbyby/adblack.conf
/usr/share/adbyby/blockip.conf
/usr/share/adbyby/adesc.conf
/usr/share/adbyby/rules.txt
/usr/share/adbyby/dnsmasq.adblock

View File

@ -1,11 +0,0 @@
#!/bin/sh -e
if [ -f /tmp/adnew.conf ]; then
if (grep -wq "address=" /tmp/adnew.conf) ; then
cp /tmp/adnew.conf /tmp/ad.conf
elif (grep -wq "0.0.0.0" /tmp/adnew.conf) ; then
cp /tmp/adnew.conf /tmp/ad.conf
else
cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/ad.conf
fi
fi
rm -f /tmp/adnew.conf

View File

@ -1,14 +0,0 @@
gvod.aiseejapp.atianqi.com
stat.pandora.xiaomi.com
upgrade.mishop.pandora.xiaomi.com
logonext.tv.kuyun.com
config.kuyun.com
mishop.pandora.xiaomi.com
dvb.pandora.xiaomi.com
api.ad.xiaomi.com
de.pandora.xiaomi.com
data.mistat.xiaomi.com
jellyfish.pandora.xiaomi.com
gallery.pandora.xiaomi.com
o2o.api.xiaomi.com
bss.pandora.xiaomi.com

View File

@ -1,10 +0,0 @@
#!/bin/sh
uclient-fetch --no-check-certificate -O - 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt' > /tmp/adnew.conf
if [ -s "/tmp/adnew.conf" ];then
/usr/share/adbyby/ad-update
fi
rm -f /tmp/adbyby.updated
sleep 10
/etc/init.d/adbyby restart

View File

@ -1,4 +0,0 @@
#!/bin/sh
PROG_PATH=$(pwd)
$PROG_PATH/adbybyupdate.sh

View File

@ -1,49 +0,0 @@
#!/bin/sh
if [ ! -f "/tmp/adbyby.updated" ];then
wget_ok="0"
while [ "$wget_ok" = "0" ]
do
uclient-fetch --spider --quiet --timeout=3 http://www.baidu.com
if [ "$?" == "0" ]; then
wget_ok="1"
touch /tmp/md5.json && uclient-fetch --no-check-certificate -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
adm5=$(md5sum /tmp/md5.json | awk -F' ' '{print $1}')
touch /tmp/adbyby/admd5.json && bmd5=$(md5sum /tmp/adbyby/admd5.json | awk -F' ' '{print $1}')
if [ "$adm5" == "$bmd5" ];then
echo "Rules MD5 are the same!"
echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
exit 0
elif [ -s /tmp/md5.json ];then
touch /tmp/lazy.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
touch /tmp/video.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
lazy_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '2p')
video_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '4p')
if [ "$lazy_online"x == "$lazy_local"x -a "$video_online"x == "$video_local"x ]; then
echo "adbyby rules MD5 OK!"
mv /tmp/lazy.txt /tmp/adbyby/data/lazy.txt
mv /tmp/video.txt /tmp/adbyby/data/video.txt
mv /tmp/md5.json /tmp/adbyby/admd5.json
echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
fi
fi
else
sleep 10
fi
done
rm -f /tmp/adbyby/data/*.bak
kill -9 $(busybox ps -w | grep "/tmp/adbyby/adbyby" | grep -v grep | grep -v update| grep -v adblock | awk '{print $1}') >/dev/null 2>&1
/tmp/adbyby/adbyby >/dev/null 2>&1 &
fi

View File

@ -1,3 +0,0 @@
weixin.qq.com
qpic.cn
imtt.qq.com

View File

@ -1,68 +0,0 @@
cbjs.baidu.com
list.video.baidu.com
nsclick.baidu.com
play.baidu.com
sclick.baidu.com
tieba.baidu.com
baidustatic.com
bdimg.com
bdstatic.com
share.baidu.com
hm.baidu.com
v.baidu.com
cpro.baidu.com
1000fr.net
atianqi.com
56.com
v-56.com
acfun.com
acfun.tv
baofeng.com
baofeng.net
cntv.cn
hoopchina.com.cn
funshion.com
fun.tv
hitvs.cn
hljtv.com
iqiyi.com
qiyi.com
agn.aty.sohu.com
itc.cn
kankan.com
ku6.com
letv.com
letvcloud.com
letvimg.com
pplive.cn
pps.tv
ppsimg.com
pptv.com
www.qq.com
l.qq.com
v.qq.com
video.sina.com.cn
tudou.com
wasu.cn
analytics-union.xunlei.com
kankan.xunlei.com
youku.com
hunantv.com
ifeng.com
renren.com
mediav.com
cnbeta.com
mydrivers.com
168f.info
doubleclick.net
126.net
sohu.com
right.com.cn
50bang.org
you85.cn
jiuzhilan.com
googles.com
cnbetacdn.com
ptqy.gitv.tv
admaster.com.cn
serving-sys.com

View File

@ -1,46 +0,0 @@
#!/bin/sh
if [ ! -f "/tmp/adbyby.updated" ];then
touch /tmp/adbyby.mem
wget_ok="0"
while [ "$wget_ok" = "0" ]
do
uclient-fetch --spider --quiet --tries=1 --timeout=3 www.baidu.com
if [ "$?" == "0" ]; then
wget_ok="1"
touch /tmp/md5.json && uclient-fetch --no-check-certificate -t 1 -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
adm5=$(md5sum /tmp/md5.json | awk -F' ' '{print $1}')
touch /tmp/adbyby/admd5.json && bmd5=$(md5sum /tmp/adbyby/admd5.json | awk -F' ' '{print $1}')
if [ "$adm5" == "$bmd5" ];then
echo "Rules MD5 are the same!"
echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
exit 0
else
touch /tmp/lazy.txt && uclient-fetch --no-check-certificate -t 1 -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
touch /tmp/video.txt && uclient-fetch --no-check-certificate -t 1 -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
lazy_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '2p')
video_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '4p')
if [ "$lazy_online"x == "$lazy_local"x -a "$video_online"x == "$video_local"x ]; then
echo "adbyby rules MD5 OK!"
mv /tmp/lazy.txt /tmp/adbyby/data/lazy.txt
mv /tmp/video.txt /tmp/adbyby/data/video.txt
mv /tmp/md5.json /tmp/adbyby/admd5.json
echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
fi
fi
else
sleep 10
fi
done
sleep 10 && /etc/init.d/adbyby restart
fi

View File

@ -1,30 +0,0 @@
#!/bin/sh
rm -f /usr/share/adbyby/data/*.bak
touch /tmp/local-md5.json && md5sum /usr/share/adbyby/data/lazy.txt /usr/share/adbyby/data/video.txt > /tmp/local-md5.json
touch /tmp/md5.json && uclient-fetch --no-check-certificate -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
lazy_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '2p')
video_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '4p')
if [ "$lazy_online"x != "$lazy_local"x -o "$video_online"x != "$video_local"x ]; then
echo "MD5 not match! Need update!"
touch /tmp/lazy.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
touch /tmp/video.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
if [ "$lazy_online"x == "$lazy_local"x -a "$video_online"x == "$video_local"x ]; then
echo "New rules MD5 match!"
mv /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt
mv /tmp/video.txt /usr/share/adbyby/data/video.txt
echo $(date +"%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
fi
else
echo "MD5 match! No need to update!"
fi
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/local-md5.json /tmp/md5.json

View File

@ -1,4 +0,0 @@
address=/p.tanx.com/0.0.0.0
address=/googlesyndication.com/0.0.0.0
address=/linkvans.com/0.0.0.0
server=/valf.atm.youku.com/114.114.114.114

View File

@ -1,3 +0,0 @@
ipset=/weixin.qq.com/adbyby_wan
ipset=/qpic.cn/adbyby_wan
ipset=/imtt.qq.com/adbyby_wan

View File

@ -1,16 +0,0 @@
#!/bin/sh
if [ -f /tmp/blockip.ipset ];then
adbyby_enable=$(uci get adbyby.@adbyby[0].enable)
if [ $adbyby_enable -eq 1 ]; then
if pidof adbyby>/dev/null; then
/etc/init.d/adbyby reload_rule
else
/etc/init.d/adbyby restart
fi
fi
fi

View File

@ -1,3 +0,0 @@
#!/bin/sh
find $1 -type f -exec cat {} \; | wc -l

View File

@ -1,36 +0,0 @@
#!/bin/sh -e
url_md5() {
echo -n $1|md5sum|cut -d ' ' -f1
}
convert_rules() {
mkdir -p /tmp/rules/data
mkdir -p /tmp/rules/host
uclient-fetch -q --no-check-certificate $1 -O /tmp/adnew.conf
rulename=$(url_md5 $1)
if [ -f /tmp/adnew.conf ]; then
if (grep -wq "address=" /tmp/adnew.conf) ; then
cp /tmp/adnew.conf /tmp/rules/data/$rulename.conf
elif (grep -wq -e"0.0.0.0" -e"127.0.0.1" /tmp/adnew.conf) ; then
cp /tmp/adnew.conf /tmp/rules/host/$rulename.txt
else
cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/rules/data/$rulename.conf
fi
fi
rm -rf /tmp/adnew.conf
}
ARRAY=$(uci get adbyby.@adbyby[0].subscribe_url 2> /dev/null)
rm -rf /tmp/rules
i=1
for j in $ARRAY
do
convert_rules $j
i=`expr $i + 1`
done

View File

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

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