add lean's package

This commit is contained in:
coolsnowwolf 2017-09-06 20:18:34 +08:00
parent 97a4ffcc12
commit 0e285c3037
370 changed files with 43824 additions and 0 deletions

View File

@ -0,0 +1,70 @@
#
# 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:=20170823
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Powerful adblock module to block ad.
DEPENDS:=
URL:=http://www.adbyby.com/
endef
define Package/$(PKG_NAME)/description
Adbyby is a powerful adblock module to block ad,just like adblock.
endef
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_BIN) ./files/adbybyfirst.sh $(1)/usr/share/adbyby/
$(INSTALL_BIN) ./files/adbybyupdate.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/
ifeq ($(ARCH),mipsel)
$(INSTALL_BIN) ./files/7620n/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),mips)
$(INSTALL_BIN) ./files/ar71xx/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),i386)
$(INSTALL_BIN) ./files/x86/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),x86_64)
$(INSTALL_BIN) ./files/x86_64/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),arm)
$(INSTALL_BIN) ./files/arm/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),aarch64)
$(INSTALL_BIN) ./files/armv7/adbyby $(1)/usr/share/adbyby/
endif
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

Binary file not shown.

View File

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

View File

@ -0,0 +1,11 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
if [ -z "$(dnsmasq --version | grep no-ipset)" ]; then
[ $(uci get adbyby.@adbyby[-1].wan_mode) -ne 2 ] && \
[ $(awk -F= '/^ipset/{print $2}' $PROG_PATH/adhook.ini) -eq 1 ] && \
{
sed -i 's/adbyby_list/adbyby_wan/' /tmp/adbyby_host.conf
echo conf-file=/tmp/adbyby_host.conf >> /etc/dnsmasq.conf
/etc/init.d/dnsmasq restart
}
fi

View File

@ -0,0 +1,11 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
if [ -z "$(dnsmasq --version | grep no-ipset)" ]; then
[ $(uci get adbyby.@adbyby[-1].wan_mode) -ne 2 ] && \
[ $(awk -F= '/^ipset/{print $2}' $PROG_PATH/adhook.ini) -eq 1 ] && \
{
sed -i 's/adbyby_list/adbyby_wan/' /tmp/adbyby_host.conf
ipset -F adbyby_wan 2>/dev/null
/etc/init.d/dnsmasq restart
}
fi

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,121 @@
//IE6、7、8、9, from adsafe
%USERPROFILE%\Local Settings\Temporary Internet Files\*.html
%USERPROFILE%\Local Settings\Temporary Internet Files\*.js
%USERPROFILE%\Local Settings\Temporary Internet Files\*.htm
%USERPROFILE%\Local Settings\Temporary Internet Files\*.xml
%USERPROFILE%\Local Settings\Temporary Internet Files\*.css
%USERPROFILE%\Local Settings\Temporary Internet Files\*.swf
%USERPROFILE%\Local Settings\Temporary Internet Files\*.flv
%USERPROFILE%\Local Settings\Temporary Internet Files\*.mp4
%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5\*.*
%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*
%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\*.*
//360安全浏览器
%USERPROFILE%\Application Data\360se\ie8data\Temporary Internet Files\*.*
//chrome
%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Cache\*.*
//360极速浏览器
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\CacheIE\*.*
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Cache\*.*
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\CacheIE\Content.IE5\*.*
//搜狗浏览器
%USERPROFILE%\Application Data\SogouExplorer\Webkit\Default\Cache\*.*
%USERPROFILE%\AppData\Roaming\SogouExplorer\Webkit\Default\Cache\*.*
//opera浏览器
%USERPROFILE%\AppData\Local\Opera\Opera\cache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\cache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\application_cache\mcache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\application_cache\cache_groups.xml
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\opcache\*.*
//淘宝浏览器
%USERPROFILE%\AppData\Local\TaoBrowser\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\TaoBrowser\User Data\Default\JumpListIcons\*.*
%USERPROFILE%\Local Settings\Application Data\TaoBrowser\User Data\Default\Cache\*.*
//百度浏览器
%USERPROFILE%\Application Data\Baidu\browser\DiskCache\*.*
%USERPROFILE%\AppData\Roaming\Baidu\browser\DiskCache\*.*
//猎豹浏览器
%USERPROFILE%\Local Settings\Application Data\liebao\User Data\Default\Cache\*.*
%USERPROFILE%\Local Settings\Application Data\liebao\User Data\iecache\Content.IE5\*.*
%USERPROFILE%\AppData\Local\liebao\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\liebao\User Data\Default\JumpListIcons\*.*
//Letv
%USERPROFILE%\Application Data\Letv\Logg\*.log
//PPSStream
%APPDATA%\PPStream\adsys\*.*
%APPDATA%\PPStream\banner\*.*
%APPDATA%\PPStream\notice\*.*
%APPDATA%\PPStream\CLCache\*.pld
%APPDATA%\PPStream\FDSCache\*.blf
//PPTV
%APPDATA%\PPLive\PPTV\cache\*.*
//风行
%USERPROFILE%\funshion\cache\*.*
//youku
-s%appdata%\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//letv
-s%appdata%\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//iqiyi
-s%appdata%\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//chrome YOUKU
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//chrome LeTv
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//chrome iqiyi
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//360 youku
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//360 letv
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//360 iqiyi
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//暴风影音5
%ALLUSERSPROFILE%\Baofeng\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Baofeng\StormPlayer\Profiles\vod\*.*
%ALLUSERSPROFILE%\Application Data\Baofeng\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Application Data\Baofeng\StormPlayer\Profiles\vod\*.*
%ALLUSERSPROFILE%\Baofeng\Application Data\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Baofeng\Application Data\StormPlayer\Profiles\vod\*.*
//pptv
%ALLUSERSPROFILE%\PPLive\PPTV\Cache\pluginad\*.*
%ALLUSERSPROFILE%\Application Data\PPLive\PPTV\Cache\pluginad\*.*
%ALLUSERSPROFILE%\Application Data\PPLive\PPTV\screensaver\*.*
//多米
C:\Program Files\DuoMi\dmdeskinfo.exe
//UUSEE
%TEMP%\UUFile\*.*
//iqiyi
%ALLUSERSPROFILE%\Application Data\Qiyi\qiyiclient\cache\*.*

View File

@ -0,0 +1,43 @@
//youku
-y%appdata%\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//youku win7
-y%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//chrome YOUKU
-y%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//360 youku
-y%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//sougou youku
-y%appdata%\SogouExplorer\Webkit\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\UCBrowser\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//qq
%appdata%\Tencent\QQ\Misc\com.tencent.advertisement\*.*
%appdata%\Tencent\QQ\Misc\com.tencent.advertisement\GDT_0\*.*
//letv
-s%appdata%\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//letv1
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//iqiyi
-s%appdata%\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//iqiyi1
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//chrome LeTv
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//chrome iqiyi
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//360 letv
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//360 iqiyi
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol

Binary file not shown.

View File

@ -0,0 +1 @@
! -----更新时间: 2017-1-2 00:12:25 by:xwhyc-----

View File

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

View File

View File

@ -0,0 +1,17 @@
! -----更新时间: 2016-12-31 23:40:12 by:xwhyc-----------------------------------------------
! -----广告反馈:http://www.adbyby.com/help.htm QQ群: 79547134(满), 364066294(满)470705224534897434,438394572--------------
!-------------------------------------------
!-----------------------
!---------adbyby---------
!|http://bbs.kafan.cn/$s@</head>@</head><script>document.cookie="r6pb_69df_widthauto=1;domain=kafan.cn";</script>@
thegreatdaily.com/cat##.col-lg-8.col-md-8{width:1190px;}
!www.baidu.com,news.baidu.com###content_right,[srcid="6835"],[class="result-op xpath-log"]
!www.baidu.com,news.baidu.com###content_left,.c-container,.result{width:860px}.c-span-last{width:720px}

File diff suppressed because one or more lines are too long

View File

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

View File

@ -0,0 +1,9 @@
{+fast-redirects{s@&plid=\d+&uid=@&plid=7038006&uid=@} }
hot.vrs.sohu.com/vrs_flash.action\?vid=
{+fast-redirects{s@/Main.swf\?(?!plid)@/Main.swf?plid=7038006&@} }
tv.sohu.com/upload/swf/201.*?/Main.swf\?
{+fast-redirects{s@http://tv.sohu.com/upload/swf/.*?/PlayerShell.swf@http://update.adbyby.com/swf/sohu_livezb.swf@} }
tv.sohu.com/upload/swf/.*?/PlayerShell.swf\?
{+fast-redirects{s@pl.youku.com/playlist/m3u8\?keyframe=0&.*@update.adbyby.com/youku.m3u8@} }
pl.youku.com/playlist/m3u8\?keyframe=0&

Binary file not shown.

Binary file not shown.

108
package/lean/amule/Makefile Normal file
View File

@ -0,0 +1,108 @@
#
# 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:=aMule
PKG_VERSION:=2.3.2
PKG_RELEASE:=2
PKG_REV=4b87b20
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REV).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_URL:=https://github.com/amule-project/amule.git
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=libgd libcryptopp
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/amule/config
config AMULE_CRYPTOPP_STATIC_LINKING
bool "Link libcryptopp statically"
default y
endef
define Package/amule
SUBMENU:=P2P
SECTION:=net
CATEGORY:=Network
TITLE:=A multi-platform eMule-like ed2k client
URL:=http://www.amule.org/
DEPENDS:=+libpng +libpthread +libncurses +libreadline +libwxbase +libupnp \
$(ICONV_DEPENDS) $(INTL_DEPENDS) +!AMULE_CRYPTOPP_STATIC_LINKING:libcryptopp
endef
CONFIGURE_ARGS+= \
--disable-static \
--disable-rpath \
--with-gnu-ld \
--disable-ccache \
--disable-optimize \
--disable-profile \
--disable-monolithic \
--enable-amule-daemon \
--enable-amulecmd \
--enable-webserver \
--disable-amule-gui \
--disable-cas \
--disable-wxcas \
--disable-ed2k \
--disable-alc \
--disable-alcc \
--disable-fileview \
--disable-plasmamule \
--without-wxdebug \
--enable-dlp \
--enable-upnp \
--with-zlib="$(STAGING_DIR)/usr" \
--with-gdlib-prefix="$(STAGING_DIR)/usr" \
--with-libpng-prefix="$(STAGING_DIR)/usr" \
--with-wx-prefix="$(STAGING_DIR)/usr" \
--with-crypto-prefix="$(STAGING_DIR)/usr" \
--with-libiconv-prefix="$(ICONV_PREFIX)" \
--with-libintl-prefix="$(INTL_PREFIX)" \
--with-libupnp-prefix="$(STAGING_DIR)/usr" \
--without-x \
--disable-debug
TARGET_LDFLAGS += -liconv
define Build/Configure
cd $(PKG_BUILD_DIR) && sh ./autogen.sh
$(call Build/Configure/Default)
endef
ifeq ($(CONFIG_AMULE_CRYPTOPP_STATIC_LINKING),y)
SED_CMD:=sed
else
SED_CMD:=true
endif
define Build/Compile
$(SED_CMD) -i 's;^CRYPTOPP_LIBS.*;CRYPTOPP_LIBS \= "$(STAGING_DIR)/usr/lib/libcryptopp.a";g' \
$(PKG_BUILD_DIR)/src/Makefile
$(MAKE) -C $(PKG_BUILD_DIR) \
HOSTCC="$(HOSTCC)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
all
endef
define Package/amule/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/share/amule/webserver
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/amule{cmd,d} $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/webserver/src/amuleweb $(1)/usr/bin/
$(CP) $(PKG_BUILD_DIR)/src/webserver/default $(1)/usr/share/amule/webserver
endef
$(eval $(call BuildPackage,amule))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
diff -Naur a/m4/libupnp.m4 b/m4/libupnp.m4
--- a/m4/libupnp.m4 2016-10-06 19:01:54.000000000 +0800
+++ b/m4/libupnp.m4 2016-10-11 07:36:39.198318574 +0800
@@ -52,7 +52,6 @@
[export PKG_CONFIG_PATH=$withval/lib/pkgconfig])
dnl Check for libupnp >= MIN_LIBUPNP_VERSION
- AS_IF([test $cross_compiling = no], [
AC_MSG_CHECKING([for libupnp version >= MIN_LIBUPNP_VERSION])
AS_IF([test -n "$PKG_CONFIG"], [
AS_IF([$PKG_CONFIG libupnp --exists], [
@@ -79,11 +78,6 @@
])
AC_MSG_RESULT([$result$resultstr])
libupnp_error="libupnp >= MIN_LIBUPNP_VERSION not found$resultstr"
- ], [
-dnl Currently cross-compilation with libupnp is not supported.
- result=no
- libupnp_error="cross compiling"
- ])
dnl Execute the right action.
AS_IF([test ${result:-no} = yes], [$2], [$3])

View File

@ -0,0 +1,78 @@
diff --git a/src/amule.h b/src/amule.h
index f25702f..240c02d 100644
--- a/src/amule.h
+++ b/src/amule.h
@@ -553,6 +553,13 @@ class CamuleDaemonApp : public CamuleApp
int OnExit();
virtual int InitGui(bool geometry_enable, wxString &geometry_string);
+ // The GTK wxApps sets its file name conversion properly
+ // in wxApp::Initialize(), while wxAppConsole::Initialize()
+ // does not, leaving wxConvFile being set to wxConvLibc. File
+ // name conversion should be set otherwise amuled will abort to
+ // handle non-ASCII file names which monolithic amule can handle.
+ // This function are overrided to perform this.
+ virtual bool Initialize(int& argc_, wxChar **argv_);
#ifdef AMULED_APPTRAITS
struct sigaction m_oldSignalChildAction;
diff --git a/src/amuled.cpp b/src/amuled.cpp
index 486da59..86e1ff8 100644
--- a/src/amuled.cpp
+++ b/src/amuled.cpp
@@ -704,6 +704,41 @@ int CamuleDaemonApp::InitGui(bool ,wxString &)
return 0;
}
+bool CamuleDaemonApp::Initialize(int& argc_, wxChar **argv_)
+{
+ if ( !wxAppConsole::Initialize(argc_, argv_) ) {
+ return false;
+ }
+
+#ifdef __UNIX__
+ wxString encName;
+#if wxUSE_INTL
+ // if a non default locale is set,
+ // assume that the user wants his
+ // filenames in this locale too
+ encName = wxLocale::GetSystemEncodingName().Upper();
+
+ // But don't consider ASCII in this case.
+ if ( !encName.empty() ) {
+ if ( encName == wxT("US-ASCII") ) {
+ // This means US-ASCII when returned
+ // from GetEncodingFromName().
+ encName.clear();
+ }
+ }
+#endif // wxUSE_INTL
+
+ // in this case, UTF-8 is used by default.
+ if ( encName.empty() ) {
+ encName = wxT("UTF-8");
+ }
+
+ static wxConvBrokenFileNames fileconv(encName);
+ wxConvFileName = &fileconv;
+#endif // __UNIX__
+
+ return true;
+}
int CamuleDaemonApp::OnExit()
{
diff --git a/src/libs/common/Path.cpp b/src/libs/common/Path.cpp
index 28152a2..5efefd0 100644
--- a/src/libs/common/Path.cpp
+++ b/src/libs/common/Path.cpp
@@ -229,7 +229,8 @@ CPath::CPath(const wxString& filename)
}
wxCharBuffer fn = filename2char(filename);
- if (fn.data()) {
+ // add fn.length() for wx 3.x
+ if (fn.data()) {
// Filename is valid in the current locale. This means that
// it either originated from a (wx)system-call, or from a
// user with a properly setup system.

View File

@ -0,0 +1,174 @@
diff --git a/src/SearchList.cpp b/src/SearchList.cpp
index 32b28e9..342a18f 100644
--- a/src/SearchList.cpp
+++ b/src/SearchList.cpp
@@ -75,7 +75,7 @@ void ParsedSearchExpression(const CSearchExpr* pexpr)
int iOpNot = 0;
for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
- wxString str(pexpr->m_aExpr[i]);
+ const wxString& str = pexpr->m_aExpr[i];
if (str == SEARCHOPTOK_AND) {
iOpAnd++;
} else if (str == SEARCHOPTOK_OR) {
@@ -108,6 +108,25 @@ void ParsedSearchExpression(const CSearchExpr* pexpr)
// optimize search expression, if no OR nor NOT specified
if (iOpAnd > 0 && iOpOr == 0 && iOpNot == 0) {
+ // figure out if we can use a better keyword than the one the user selected
+ // for example most user will search like this "The oxymoronaccelerator 2", which would ask the node which indexes "the"
+ // This causes higher traffic for such nodes and makes them a viable target to attackers, while the kad result should be
+ // the same or even better if we ask the node which indexes the rare keyword "oxymoronaccelerator", so we try to rearrange
+ // keywords and generally assume that the longer keywords are rarer
+ if (/*thePrefs::GetRearrangeKadSearchKeywords() &&*/ !s_strCurKadKeyword.IsEmpty()) {
+ for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
+ if (pexpr->m_aExpr[i] != SEARCHOPTOK_AND) {
+ if (pexpr->m_aExpr[i] != s_strCurKadKeyword
+ && pexpr->m_aExpr[i].find_first_of(Kademlia::CSearchManager::GetInvalidKeywordChars()) == wxString::npos
+ && pexpr->m_aExpr[i].Find('"') != 0 // no quoted expressions as keyword
+ && pexpr->m_aExpr[i].length() >= 3
+ && s_strCurKadKeyword.length() < pexpr->m_aExpr[i].length())
+ {
+ s_strCurKadKeyword = pexpr->m_aExpr[i];
+ }
+ }
+ }
+ }
wxString strAndTerms;
for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
if (pexpr->m_aExpr[i] != SEARCHOPTOK_AND) {
@@ -285,7 +304,7 @@ void CSearchList::RemoveResults(long searchID)
}
-wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CSearchParams& params)
+wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, CSearchParams& params)
{
// Check that we can actually perform the specified desired search.
if ((type == KadSearch) && !Kademlia::CKademlia::IsRunning()) {
@@ -306,6 +325,16 @@ wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CS
m_resultType.Clear();
}
+ if (type == KadSearch) {
+ Kademlia::WordList words;
+ Kademlia::CSearchManager::GetWords(params.searchString, &words);
+ if (!words.empty()) {
+ params.strKeyword = words.front();
+ } else {
+ return _("No keyword for Kad search - aborting");
+ }
+ }
+
bool supports64bit = type == KadSearch ? true : theApp->serverconnect->GetCurrentServer() != NULL && (theApp->serverconnect->GetCurrentServer()->GetTCPFlags() & SRV_TCPFLG_LARGEFILES);
bool packetUsing64bit;
@@ -332,8 +361,7 @@ wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CS
// searchstring will get tokenized there
// The tab must be created with the Kad search ID, so searchID is updated.
- Kademlia::CSearch* search = Kademlia::CSearchManager::PrepareFindKeywords(
- params.searchString, data->GetLength(), data->GetRawBuffer(), *searchID);
+ Kademlia::CSearch* search = Kademlia::CSearchManager::PrepareFindKeywords(params.strKeyword, data->GetLength(), data->GetRawBuffer(), *searchID);
*searchID = search->GetSearchID();
m_currentSearch = *searchID;
@@ -632,7 +660,7 @@ void CSearchList::StopSearch(bool globalOnly)
}
-CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& params, SearchType WXUNUSED(type), bool supports64bit, bool& packetUsing64bit)
+CSearchList::CMemFilePtr CSearchList::CreateSearchData(CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit)
{
// Count the number of used parameters
unsigned int parametercount = 0;
@@ -659,14 +687,16 @@ CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& para
_astrParserErrors.Empty();
_SearchExpr.m_aExpr.Empty();
+ s_strCurKadKeyword.Clear();
+ if (type == KadSearch) {
+ wxASSERT( !params.strKeyword.IsEmpty() );
+ s_strCurKadKeyword = params.strKeyword;
+ }
+
LexInit(params.searchString);
int iParseResult = yyparse();
LexFree();
-#ifdef __DEBUG__
- AddLogLineNS(CFormat(wxT("Search parsing result for \"%s\": %i"))
- % params.searchString % iParseResult);
-#endif
if (_astrParserErrors.GetCount() > 0) {
for (unsigned int i=0; i < _astrParserErrors.GetCount(); ++i) {
AddLogLineNS(CFormat(wxT("Error %u: %s\n")) % i % _astrParserErrors[i]);
@@ -681,21 +711,13 @@ CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& para
return CMemFilePtr(NULL);
}
- #ifdef __DEBUG__
- wxString mes(wxT("Search expression:"));
- for (unsigned int i = 0; i < _SearchExpr.m_aExpr.GetCount(); i++) {
- mes << wxT(" ") << _SearchExpr.m_aExpr[i];
+ if (type == KadSearch && s_strCurKadKeyword != params.strKeyword) {
+ AddDebugLogLineN(logSearch, CFormat(wxT("Keyword was rearranged, using '%s' instead of '%s'")) % s_strCurKadKeyword % params.strKeyword);
+ params.strKeyword = s_strCurKadKeyword;
}
- AddLogLineNS(mes);
- AddLogLineNS(CFormat(wxT("Expression count: %i")) % _SearchExpr.m_aExpr.GetCount());
- #endif
parametercount += _SearchExpr.m_aExpr.GetCount();
- #ifdef __DEBUG__
- AddLogLineNS(CFormat(wxT("Parameters: %i")) % parametercount);
- #endif
-
/* Leave the unicode comment there, please... */
CSearchExprTarget target(data.get(), true /*I assume everyone is unicoded */ ? utf8strRaw : utf8strNone, supports64bit, packetUsing64bit);
diff --git a/src/SearchList.h b/src/SearchList.h
index 35b0fc6..6db7508 100644
--- a/src/SearchList.h
+++ b/src/SearchList.h
@@ -64,6 +64,8 @@ class CSearchList : public wxEvtHandler
//! The actual string to search for.
wxString searchString;
+ //! The keyword selected for Kad search
+ wxString strKeyword;
//! The type of files to search for (may be empty), one of ED2KFTSTR_*
wxString typeText;
//! The filename extension. May be empty.
@@ -90,7 +92,7 @@ class CSearchList : public wxEvtHandler
* @param params The search parameters, see CSearchParams.
* @return An empty string on success, otherwise an error-message.
*/
- wxString StartNewSearch(uint32* searchID, SearchType type, const CSearchParams& params);
+ wxString StartNewSearch(uint32* searchID, SearchType type, CSearchParams& params);
/** Stops the current search (global or Kad), if any is in progress. */
void StopSearch(bool globalOnly = false);
@@ -189,7 +191,7 @@ class CSearchList : public wxEvtHandler
typedef std::auto_ptr<CMemFile> CMemFilePtr;
/** Create a basic search-packet for the given search-type. */
- CMemFilePtr CreateSearchData(const CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
+ CMemFilePtr CreateSearchData(CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
//! Timer used for global search intervals.
diff --git a/src/kademlia/kademlia/SearchManager.cpp b/src/kademlia/kademlia/SearchManager.cpp
index e7f25d4..f9ee924 100644
--- a/src/kademlia/kademlia/SearchManager.cpp
+++ b/src/kademlia/kademlia/SearchManager.cpp
@@ -127,7 +127,7 @@ CSearch* CSearchManager::PrepareFindKeywords(const wxString& keyword, uint32_t s
wxString wstrKeyword = s->m_words.front();
- AddLogLineNS(CFormat(_("Keyword for search: %s")) % wstrKeyword);
+ AddDebugLogLineN(logSearch, CFormat(wxT("Keyword for search: %s")) % wstrKeyword);
// Kry - I just decided to assume everyone is unicoded
// GonoszTopi - seconded

View File

@ -0,0 +1,37 @@
#
# 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:=13
PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/automount
SECTION:=net
CATEGORY:=Network
TITLE:=Mount autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-ext4 +kmod-fs-vfat +kmod-fs-exfat +ntfs-3g
endef
define Package/automount/description
A usb autoconfig hotplug script.
endef
define Build/Compile
endef
define Package/automount/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/10-automount $(1)/etc/hotplug.d/block/10-automount
endef
$(eval $(call BuildPackage,automount))

View File

@ -0,0 +1,26 @@
#!/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
# Try to be gentle on solid state devices
mount -o rw,noatime,discard /dev/$device /mnt/$mntpnt
;;
remove)
# Once the device is removed, the /dev entry disappear. We need mountpoint
mountpoint=`mount |grep /dev/$device | sed 's/.* on \(.*\) type.*/\1/'`
umount -l $mountpoint
;;
esac
fi

View File

@ -0,0 +1,37 @@
#
# 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:=autosamba
PKG_VERSION:=1
PKG_RELEASE:=8
PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/autosamba
SECTION:=net
CATEGORY:=Network
TITLE:=Samba autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=+luci-app-samba
endef
define Package/autosamba/description
A hotplug script to config Samba share automatically.
endef
define Build/Compile
endef
define Package/autosamba/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/20-smb $(1)/etc/hotplug.d/block/20-smb
endef
$(eval $(call BuildPackage,autosamba))

View File

@ -0,0 +1,105 @@
#!/bin/sh
#
# D-Team Technology Co.,Ltd. ShenZhen
# 作者:Vic
#
#
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
#
. /lib/functions.sh
. /lib/functions/service.sh
global=0
config_file="/etc/config/samba"
wait_for_init() {
for i in `seq 30`
do
[ -e /tmp/procd.done ] || {
sleep 1; continue;
}
return
done
}
smb_handle() {
config_get path $1 path
if [ "$path" = "$2" ] ;then
global=1
fi
}
chk_en() {
config_get_bool autoshare $1 autoshare 1
[ $autoshare -eq 0 ] && exit
}
config_load samba
config_foreach chk_en samba
device=`basename $DEVPATH`
case "$ACTION" in
add)
case "$device" in
sd*) ;;
md*) ;;
hd*);;
mmcblk*);;
*) return;;
esac
path="/dev/$device"
wait_for_init
cat /proc/mounts | while read j
do
str=${j%% *}
if [ "$str" == $path ];then
strr=${j#* }
target=${strr%% *}
global=0
config_foreach smb_handle sambashare $target
name=${target#*/mnt/}
if [ $global -eq 0 ] ;then
echo -e "\n\nconfig sambashare" >> $config_file
echo -e "\toption auto '1'" >> $config_file
echo -e "\toption name '$name'" >> $config_file
echo -e "\toption path '$target'" >> $config_file
echo -e "\toption read_only 'no'" >> $config_file
echo -e "\toption guest_ok 'yes'" >> $config_file
echo -e "\toption create_mask '0666'" >> $config_file
echo -e "\toption dir_mask '0777'" >> $config_file
echo -e "\toption device '$device'" >> $config_file
/etc/init.d/samba reload
return
fi
fi
done
;;
remove)
i=0
while true
do
dev=`uci get samba.@sambashare[$i].device`
[ $? -ne 0 ] && break
[ "$dev" = "$device" ] && {
auto=`uci get samba.@sambashare[$i].auto`
[ $auto = "1" ] && {
mount_dir=`uci get samba.@sambashare[$i].name`
rm -rf /mnt/$device /mnt/$mount_dir
uci delete samba.@sambashare[$i]
uci commit
/etc/init.d/samba reload
return
}
}
let i+=1
done
;;
esac

View File

@ -0,0 +1,48 @@
#
# Copyright (C) 2016-2017 GitHub
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=default-settings
PKG_VERSION:=1.0
PKG_RELEASE:=20
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/default-settings
SECTION:=luci
CATEGORY:=LuCI
TITLE:=LuCI support for Default Settings
PKGARCH:=all
endef
define Package/default-settings/description
Language Support Packages.
endef
define Build/Prepare
$(foreach po,$(wildcard ${CURDIR}/i18n/*.po), \
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/default-settings/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.lmo $(1)/usr/lib/lua/luci/i18n/
$(INSTALL_BIN) ./files/zzz-default-settings $(1)/etc/uci-defaults/99-default-settings
endef
$(eval $(call BuildPackage,default-settings))

View File

@ -0,0 +1,52 @@
#!/bin/sh
uci set luci.main.lang=zh_cn
uci commit luci
uci set system.@system[0].hostname=LEDE
uci set system.@system[0].timezone=CST-8
uci set system.@system[0].zonename=Asia/Shanghai
uci commit system
uci set fstab.@global[0].anon_mount=1
uci commit fstab
rm -f /usr/lib/lua/luci/view/admin_status/index/mwan.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/upnp.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/ddns.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/minidlna.htm
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/aria2.lua
sed -i 's/services/nas/g' /usr/lib/lua/luci/view/aria2/overview_status.htm
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/hd_idle.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/samba.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/minidlna.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/transmission.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/mjpg-streamer.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/p910nd.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/usb_printer.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/xunlei.lua
[ ! -f /usr/bin/ip ] && ln -sf /sbin/ip /usr/bin/ip
(opkg list-installed | grep ip-full >/dev/null 2>&1) && ln -sf /usr/sbin/ip /usr/bin/ip
rm -rf /tmp/luci-modulecache/
rm -f /tmp/luci-indexcache
sed -i 's/downloads.openwrt.org/openwrt.proxy.ustclug.org/g' /etc/opkg/distfeeds.conf
sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
sed -i "s/# //g" /etc/opkg/distfeeds.conf
sed -i '/REDIRECT --to-ports 53/d' /etc/firewall.user
echo "iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53" >> /etc/firewall.user
echo "iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53" >> /etc/firewall.user
sed -i '/option disabled/d' /etc/config/wireless
sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh
wifi up
exit 0

View File

@ -0,0 +1,102 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Action"
msgstr "动作"
msgid "Advanced Reboot"
msgstr "双分区启动切换"
msgid "Alternative"
msgstr "备选"
msgid "Cancel"
msgstr "取消"
msgid "Confirm"
msgstr "确定"
msgid "Current"
msgstr "当前"
msgid "Firmware/OS (Kernel)"
msgstr "固件/系统 (内核)"
msgid "Partition"
msgstr "分区"
msgid "Partitions"
msgstr "分区"
msgid "Perform power off..."
msgstr "点击关机..."
msgid "Power Off Device"
msgstr "关闭设备"
msgid "Proceed"
msgstr "处理"
msgid "Reboot Device to an Alternative Partition"
msgstr "重启设备到备选分区"
msgid "Reboot to alternative partition..."
msgstr "重启到备选分区"
msgid "Reboot to current partition"
msgstr "重启到当前分区"
msgid "Rebooting..."
msgstr "正在重启..."
msgid "Shutting down..."
msgstr "正在关闭..."
msgid "Status"
msgstr "状态"
msgid ""
"The system is rebooting now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a "
"few minutes before you try to reconnect. It might be necessary to renew the "
"address of your computer to reach the device again, depending on your "
"settings."
msgstr ""
msgid ""
"The system is rebooting to an alternative partition now.<br /> DO NOT POWER "
"OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It "
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
msgid ""
"The system is shutting down now.<br /> DO NOT POWER OFF THE DEVICE!<br /> It "
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
msgid ""
"WARNING: An alternative partition might have its own settings and completely "
"different firmware.<br /><br /> As your network configuration and WiFi SSID/"
"password on alternative partition might be different, you might have to "
"adjust your computer settings to be able to access your device once it "
"reboots.<br /><br /> Please also be aware that alternative partition "
"firmware might not provide an easy way to switch active partition and boot "
"back to the currently active partition.<br /><br /> Click \"Proceed\" below "
"to reboot device to an alternative partition."
msgstr ""
msgid ""
"WARNING: Power off might result in a reboot on a device which doesn't "
"support power off.<br /><br /> Click \"Proceed\" below to power off your "
"device."
msgstr ""
msgid "Warning: There are unsaved changes that will get lost on reboot!"
msgstr "警告:某些设置没有保存,重启将导致丢失这些配置!"
msgid "Warning: This system does not have two partitions!"
msgstr "警告:当前系统没有包括两个分区!"
msgid "Warning: This system does not support powering off!"
msgstr "警告:本系统不支持软关机!"

View File

@ -0,0 +1,10 @@
msgid "Processor"
msgstr "处理器"
msgid "Architecture"
msgstr "架构"
msgid "CPU Temperature"
msgstr "CPU温度"

View File

@ -0,0 +1,563 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Last-Translator: Hsing-Wang Liao <kuoruan@gmail.com>\n"
msgid "%d hour"
msgstr "%d 小时"
msgid "%d minute"
msgstr "%d 分钟"
msgid "%d minutes"
msgstr "%d 分钟"
msgid "%d second"
msgstr "%d 秒"
msgid "%d seconds"
msgstr "%d 秒"
msgid ""
"Acceptable values: 1-100. This many Tracking IP addresses must respond for "
"the link to be deemed up"
msgstr ""
"取值范围: 1-100。这个设置项指定了当多少个 IP 地址能够连通时接口会被认为在线"
msgid "Acceptable values: 1-1000. Defaults to 1 if not set"
msgstr "取值范围: 1-100。如果不填写默认值为 1"
msgid "Advanced"
msgstr "高级"
msgid "Check IP rules"
msgstr "检查 IP 规则"
msgid "Check routing table"
msgstr "检查路由表"
msgid "Collecting data..."
msgstr "正在收集数据..."
msgid "Configuration"
msgstr "配置"
msgid "Currently Configured Interfaces"
msgstr "当前配置的接口"
msgid "Currently Configured Members"
msgstr "当前配置的成员"
msgid "Currently Configured Policies"
msgstr "当前配置的策略"
msgid "Destination address"
msgstr "目标地址"
msgid "Destination port"
msgstr "目标端口"
msgid "Detailed Status"
msgstr "详细状态"
msgid "Diagnostic Results"
msgstr "诊断结果"
msgid "Diagnostics"
msgstr "诊断"
msgid "Disabled"
msgstr "禁用"
msgid ""
"Downed interface will be deemed up after this many successful ping tests"
msgstr "当 Ping 成功次数达到这个数值后,已经被认为离线的接口将会重新上线"
msgid "Enabled"
msgstr "启用"
msgid "Error collecting troubleshooting information"
msgstr "收集故障排除信息时出错"
msgid "Errors"
msgstr "错误"
msgid "Failure interval"
msgstr "故障检测间隔"
msgid "Flush conntrack table"
msgstr "刷新连接跟踪表"
msgid "Flush global firewall conntrack table on interface events"
msgstr "在接口事件触发时刷新全局防火墙连接跟踪表"
msgid "Hotplug Script"
msgstr "Hotplug 脚本"
msgid "Hotplug ifdown"
msgstr "Hotplug ifdown"
msgid "Hotplug ifup"
msgstr "Hotplug ifup"
msgid "IPset"
msgstr "IPset"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Interface"
msgstr "接口"
msgid "Interface Status"
msgstr "接口状态"
msgid "Interface down"
msgstr "接口离线"
msgid "Interface up"
msgstr "接口上线"
msgid "Interface will be deemed down after this many failed ping tests"
msgstr "当 Ping 失败次数达到这个数值后接口会被认为离线"
msgid "Interfaces"
msgstr "接口"
msgid "Internet Protocol"
msgstr "互联网协议"
msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :"
msgstr "最近 50 条 MWAN 系统日志,最新条目排在顶部:"
msgid "Last resort"
msgstr "备用成员"
msgid "Load Balancing"
msgstr "负载均衡"
msgid "Loading"
msgstr "载入中"
msgid "MWAN Config"
msgstr "MWAN 配置文件"
msgid "MWAN Detailed Status"
msgstr "MWAN 详细状态"
msgid "MWAN Interface Configuration"
msgstr "MWAN 接口配置"
msgid "MWAN Interface Configuration - %s"
msgstr "MWAN 接口配置 - %s"
msgid "MWAN Interface Diagnostics"
msgstr "MWAN 接口诊断"
msgid "MWAN Interface Live Status"
msgstr "MWAN 接口实时状态"
msgid "MWAN Interface Systemlog"
msgstr "MWAN 接口系统日志"
msgid "MWAN Member Configuration"
msgstr "MWAN 成员配置"
msgid "MWAN Member Configuration - %s"
msgstr "MWAN 成员配置 - %s"
msgid "MWAN Policy Configuration"
msgstr "MWAN 策略配置"
msgid "MWAN Policy Configuration - %s"
msgstr "MWAN 策略配置 - %s"
msgid "MWAN Rule Configuration"
msgstr "MWAN 规则配置"
msgid "MWAN Rule Configuration - %s"
msgstr "MWAN 规则配置 - %s"
msgid "MWAN Service Control"
msgstr "MWAN 服务控制"
msgid ""
"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN "
"requires that all interfaces have a unique metric configured in /etc/config/"
"network<br />Names must match the interface name found in /etc/config/"
"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, "
"_ and no spaces<br />Interfaces may not share the same name as configured "
"members, policies or rules"
msgstr ""
"MWAN 支持最多 250 个物理或逻辑接口。<br />MWAN 要求所有接口必须在 /etc/"
"config/network 中设定唯一的网关跃点。<br />名称必须与 /etc/config/network 中"
"的接口名称匹配。(可查看“高级”选项卡)<br />名称允许包括A-Z、a-z、0-9、_ 但是"
"不能有空格。<br />接口不应该与成员、策略、规则中的任意一个设置项使用相同的名"
"称"
msgid ""
"May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or "
"as a portrange (eg \"1024:2048\") without quotes"
msgstr ""
"可以输入一个或多个端口(例如 \"22\" 或者 \"80,443\")或者是一个端口范围(例"
"如 \"1024:2048\")不含引号"
msgid "Member"
msgstr "成员"
msgid "Member used"
msgstr "使用的成员"
msgid "Members"
msgstr "成员"
msgid ""
"Members are profiles attaching a metric and weight to an MWAN interface<br /"
">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Members "
"may not share the same name as configured interfaces, policies or rules"
msgstr ""
"“成员”用来设置每一个 MWAN 接口的跃点数(即接口优先级)和所占比重。<br />名称"
"允许包括 A-Z、 a-、0-9、_ 但是不能有空格。<br />成员不应该与接口、策略、规则"
"中的任意一个设置项使用相同的名称"
msgid "Members assigned"
msgstr "分配的成员"
msgid "Metric"
msgstr "跃点数"
msgid ""
"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/"
"youtube.com/youtube\")"
msgstr ""
"匹配 IPset 规则列表名称。需要先配置 /etc/dnsmasq.conf 中的 IPset 规则 (例如: "
"\"ipset=/youtube.com/youtube\")"
msgid "Network Config"
msgstr "网络配置文件"
msgid "No"
msgstr "否"
msgid "No MWAN interfaces found"
msgstr "没有找到 MWAN 接口"
msgid "No MWAN systemlog history found"
msgstr "没有在系统日志中找到 MWAN 历史信息"
msgid "No detailed status information available"
msgstr "没有状态详细信息可用"
msgid "No diagnostic results returned"
msgstr "没有返回诊断结果"
msgid "No protocol specified"
msgstr "未指定协议"
msgid "Offline"
msgstr "离线"
msgid "Online (tracking active)"
msgstr "在线(追踪启用中)"
msgid "Online (tracking off)"
msgstr "在线(追踪已关闭)"
msgid "Overview"
msgstr "概况"
msgid "Ping count"
msgstr "Ping 计数"
msgid "Ping default gateway"
msgstr "Ping 默认网关"
msgid "Ping interval"
msgstr "Ping 间隔"
msgid "Ping interval during failure detection"
msgstr "故障检测期间的 Ping 间隔"
msgid "Ping interval during failure recovering"
msgstr "故障恢复期间的 Ping 间隔"
msgid "Ping size"
msgstr "Ping 大小"
msgid "Ping timeout"
msgstr "Ping 超时"
msgid "Ping tracking IP"
msgstr "Ping 跟踪 IP"
msgid "Policies"
msgstr "策略"
msgid ""
"Policies are profiles grouping one or more members controlling how MWAN "
"distributes traffic<br />Member interfaces with lower metrics are used "
"first. Interfaces with the same metric load-balance<br />Load-balanced "
"member interfaces distribute more traffic out those with higher weights<br /"
">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be "
"15 characters or less<br />Policies may not share the same name as "
"configured interfaces, members or rules"
msgstr ""
"“策略”把成员进行分组,告诉 MWAN 如何分配“规则”中使用这一策略的流量<br />拥有"
"较低跃点数的成员将会被优先使用。拥有相同跃点数的成员把流量进行负载均衡。<br /"
">进行负载均衡的成员之间拥有较高比重的成员将会被分配到更多流量。<br />名称允许"
"包括A-Z、a-z、0-9、_ 但是不能有空格。名称应该在 15 个字符以内<br />策略不应该"
"与接口、成员、规则中的任意一个设置项使用相同的名称"
msgid "Policy"
msgstr "策略"
msgid "Policy assigned"
msgstr "分配的策略"
msgid "Protocol"
msgstr "通信协议"
msgid "Recovery interval"
msgstr "故障恢复间隔"
msgid "Restart MWAN"
msgstr "重启 MWAN"
msgid "Restore default hotplug script"
msgstr "恢复默认的 hotplug 脚本"
msgid "Restore..."
msgstr "恢复..."
msgid "Rule"
msgstr "规则"
msgid "Rules"
msgstr "规则"
msgid ""
"Rules specify which traffic will use a particular MWAN policy based on IP "
"address, port or protocol<br />Rules are matched from top to bottom. Rules "
"below a matching rule are ignored. Traffic not matching any rule is routed "
"using the main routing table<br />Traffic destined for known (other than "
"default) networks is handled by the main routing table. Traffic matching a "
"rule, but all WAN interfaces for that policy are down will be blackholed<br /"
">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Rules may "
"not share the same name as configured interfaces, members or policies"
msgstr ""
"“规则”基于 IP 地址、协议、端口把流量划分到指定的“策略”中。<br />规则按照从上"
"到下的顺序进行匹配。除了第一条能够匹配一次通信的规则以外,其它规则将被忽略。"
"不匹配任何规则的通信将会由系统默认路由表进行。<br />来自已知的网络的转发流量"
"由系统默认路由表接手,然后 MWAN 从中匹配出相应的流量并转移到 MWAN 自己的路由"
"表。但是所有被划分到一个无法使用的策略的流量将会无法正常进行路由。<br />名称"
"允许包括A-Z、a-z、0-9、_ 但是不能有空格。<br />规则不应该与接口、成员、策略中"
"的任意一个设置项使用相同的名称"
msgid "Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set"
msgstr "单位为秒。接受的值: 1-1000000。留空则使用默认值 600 秒"
msgid "Source address"
msgstr "源地址"
msgid "Source port"
msgstr "源端口"
msgid "Start MWAN"
msgstr "启动 MWAN"
msgid "Sticky"
msgstr "粘滞模式"
msgid "Sticky timeout"
msgstr "粘滞超时"
msgid "Stop MWAN"
msgstr "停止 MWAN"
msgid "Supports CIDR notation (eg \"192.168.100.0/24\") without quotes"
msgstr "支持 CIDR 记法(例如: \"192.168.100.0/24\")不含引号"
msgid "There are currently %d of 250 supported interfaces configured"
msgstr "当前已配置 %d 个接口,最大支持 250 个"
msgid ""
"This displays the metric assigned to this interface in /etc/config/network"
msgstr "这里显示了这个接口在 /etc/config/network 中配置的跃点数"
msgid ""
"This hostname or IP address will be pinged to determine if the link is up or "
"down. Leave blank to assume interface is always online"
msgstr "通过 ping 此主机或 IP 地址来确定链路是否在线。留空则认为接口始终在线"
msgid "This section allows you to modify the contents of /etc/config/mwan3"
msgstr "这里允许你修改 /etc/config/mwan3 的内容"
msgid "This section allows you to modify the contents of /etc/config/network"
msgstr "这里允许你修改 /etc/config/network 的内容"
msgid "This section allows you to modify the contents of /etc/config/wireless"
msgstr "这里允许你修改 /etc/config/wireless 的内容"
msgid ""
"This section allows you to modify the contents of /etc/hotplug.d/iface/16-"
"mwancustom<br />This is useful for running system commands and/or scripts "
"based on interface ifup or ifdown hotplug events<br /><br />Notes:<br />The "
"first line of the script must be &#34;#!/bin/sh&#34; without quotes<br /"
">Lines beginning with # are comments and are not executed<br /><br /"
">Available variables:<br />$ACTION is the hotplug event (ifup, ifdown)<br />"
"$INTERFACE is the interface name (wan1, wan2, etc.)<br />$DEVICE is the "
"device name attached to the interface (eth0.1, eth1, etc.)"
msgstr ""
"这里允许你修改 /etc/hotplug.d/iface/16-mwancustom 的内容<br />这可以在接口 "
"ifup 或 ifdown Hotplug 事件时运行系统命令或脚本<br /><br />注意:<br />脚本的"
"第一行必须是 &#34;#!/bin/sh&#34; 不含引号<br />以#开头的行是注释,不会执行"
"<br /><br />可用变量:<br />$ACTION 是 Hotplug 事件ifup, ifdown<br />"
"$INTERFACE 是接口名称wan1、wan2 等)<br />$DEVICE 是连接到接口的设备名称 "
"eth0.1、eth1 等)"
msgid "Tracking IP"
msgstr "追踪的 IP"
msgid "Tracking hostname or IP address"
msgstr "追踪的主机或 IP 地址"
msgid "Tracking reliability"
msgstr "追踪可靠性"
msgid "Traffic Rules"
msgstr "流量规则"
msgid ""
"Traffic from the same source IP address that previously matched this rule "
"within the sticky timeout period will use the same WAN interface"
msgstr ""
"来自相同源 IP 的流量,如果已经匹配过此规则并且在粘滞超时时间内,将会使用相同"
"的 WAN 接口"
msgid "Troubleshooting"
msgstr "故障排除"
msgid "Troubleshooting Data"
msgstr "故障排除数据"
msgid "View the contents of /etc/protocols for protocol descriptions"
msgstr "请查看 /etc/protocols 获取可选协议详情"
msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!"
msgstr "警告: 已配置 %d 个接口,超过最大值 250"
msgid ""
"WARNING: Some policies have names exceeding the maximum of 15 characters!"
msgstr "警告: 某些策略的名称超过了 15 个字符!"
msgid ""
"WARNING: some interfaces are configured incorrectly or not at all in /etc/"
"config/network!"
msgstr "警告: 某些接口配置不正确或未配置到 /etc/config/network"
msgid ""
"WARNING: some interfaces have a higher reliability requirement than there "
"are tracking IP addresses!"
msgstr "警告: 某些接口的追踪可靠性要求大于了追踪 IP 地址总数!"
msgid ""
"WARNING: some interfaces have duplicate metrics configured in /etc/config/"
"network!"
msgstr "警告: 某些接口在 /etc/config/network 中配置了相同的跃点数!"
msgid ""
"WARNING: some interfaces have no default route in the main routing table!"
msgstr "警告: 某些接口在主路由表中没有默认路由!"
msgid ""
"WARNING: some interfaces have no metric configured in /etc/config/network!"
msgstr "警告: 某些接口没有在 /etc/config/network 中配置跃点数!"
msgid ""
"WARNING: some rules have a port configured with no or improper protocol "
"specified! Please configure a specific protocol!"
msgstr ""
"警告: 某些规则指定了端口却没有配置或配置了不正确的协议,请重新指定协议!"
msgid ""
"WARNING: this and other interfaces have duplicate metrics configured in /etc/"
"config/network!"
msgstr "警告: 此接口和其他接口在 /etc/config/network 中配置了相同的跃点数!"
msgid ""
"WARNING: this interface has a higher reliability requirement than there are "
"tracking IP addresses!"
msgstr "警告: 此接口的追踪可靠性要求大于了追踪 IP 地址总数!"
msgid "WARNING: this interface has no default route in the main routing table!"
msgstr "警告: 此接口在主路由表中没有默认路由!"
msgid ""
"WARNING: this interface has no metric configured in /etc/config/network!"
msgstr "警告: 此接口没有在 /etc/config/network 中配置跃点数!"
msgid ""
"WARNING: this interface is configured incorrectly or not at all in /etc/"
"config/network!"
msgstr "警告: 此接口配置不正确或未配置到 /etc/config/network"
msgid ""
"WARNING: this policy's name is %d characters exceeding the maximum of 15!"
msgstr "警告: 此策略的名称具有 %d 个字符,超过了 15 个字符!"
msgid ""
"WARNING: this rule is incorrectly configured with no or improper protocol "
"specified! Please configure a specific protocol!"
msgstr "警告: 此规则没有配置或配置了不正确的协议,请重新指定协议!"
msgid "Waiting for MWAN to %s..."
msgstr "等待 MWAN %s..."
msgid "Waiting for diagnostic results..."
msgstr "等待诊断结果..."
msgid "Weight"
msgstr "比重"
msgid ""
"When all policy members are offline use this behavior for matched traffic"
msgstr "当所有策略成员都无法使用的时候,对使用该策略的流量使用这个操作"
msgid "Wireless Config"
msgstr "无线配置"
msgid "Yes"
msgstr "是"
msgid "always"
msgstr "总是"
msgid "blackhole (drop)"
msgstr "黑洞(丢弃)"
msgid "default (use main routing table)"
msgstr "默认(使用主路由表)"
msgid "ifdown"
msgstr "ifdown"
msgid "ifup"
msgstr "ifup"
msgid "never"
msgstr "从不"
msgid "restart"
msgstr ""
msgid "start"
msgstr ""
msgid "stop"
msgstr ""
msgid "unreachable (reject)"
msgstr "不可达(拒绝)"

View File

@ -0,0 +1,203 @@
msgid ""
msgstr ""
"Project-Id-Version: luci-i18n-sqm\n"
"POT-Creation-Date: 2017-03-28 04:14+0800\n"
"PO-Revision-Date: 2017-03-28 04:15+0800\n"
"Last-Translator: \n"
"Language-Team: player131 <player1311@gmail.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.10\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-SearchPath-0: .\n"
#: usr/lib/lua/luci/controller/sqm.lua:24
msgid "SQM QoS"
msgstr "SQM QoS"
#: usr/lib/lua/luci/model/cbi/sqm.lua:25
msgid "Smart Queue Management"
msgstr "智能队列管理"
#: usr/lib/lua/luci/model/cbi/sqm.lua:26
msgid ""
"With <abbr title=\"Smart Queue Management\">SQM</abbr> you can enable "
"traffic shaping, better mixing (Fair Queueing), active queue length "
"management (AQM) and prioritisation on one network interface."
msgstr ""
"使用 <abbr title=\"智能列队管理\">SQM</abbr> 你可以启用流量整形,更好的混合"
"(公平列队)主动列队管理(AQM) 并设置网络接口优先级。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:32
msgid "Queues"
msgstr "队列"
#: usr/lib/lua/luci/model/cbi/sqm.lua:33
msgid "Basic Settings"
msgstr "基本设置"
#: usr/lib/lua/luci/model/cbi/sqm.lua:34
msgid "Queue Discipline"
msgstr "列队规则"
#: usr/lib/lua/luci/model/cbi/sqm.lua:35
msgid "Link Layer Adaptation"
msgstr "链路层适配"
#: usr/lib/lua/luci/model/cbi/sqm.lua:40
msgid "Enable this SQM instance."
msgstr "启用此SQM实例"
#: usr/lib/lua/luci/model/cbi/sqm.lua:54
msgid ""
"The SQM GUI has just enabled the sqm initscript on your behalf. Remember to "
"disable the sqm initscript manually under System Startup menu in case this "
"change was not wished for."
msgstr ""
"你刚刚开启了SQM随机启动功能如果你不希望SQM随机启动可以在系统启动菜单下手"
"动禁用。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:60
msgid "Interface name"
msgstr "接口名称"
#: usr/lib/lua/luci/model/cbi/sqm.lua:70
msgid ""
"Download speed (kbit/s) (ingress) set to 0 to selectively disable ingress "
"shaping:"
msgstr "下载速度(kbit/s)(入口)<br />设置为0关闭入口控制"
#: usr/lib/lua/luci/model/cbi/sqm.lua:74
msgid ""
"Upload speed (kbit/s) (egress) set to 0 to selectively disable egress "
"shaping:"
msgstr "上传速度(kbit/s)(出口)<br />设置为0关闭出口控制"
#: usr/lib/lua/luci/model/cbi/sqm.lua:78
msgid ""
"Create log file for this SQM instance under /var/run/sqm/${Inerface_name}."
"debug.log. Make sure to delete log files manually."
msgstr ""
"创建日志文件到/var/run/sqm/<br />${Inerface_name}.debug.log。<br />请务必手动"
"删除日志文件。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:82
msgid "Verbosity of SQM's output into the system log."
msgstr "SQM输出到系统日志的详细程度。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:86 usr/lib/lua/luci/model/cbi/sqm.lua:99
#: usr/lib/lua/luci/model/cbi/sqm.lua:148
#: usr/lib/lua/luci/model/cbi/sqm.lua:155
#: usr/lib/lua/luci/model/cbi/sqm.lua:202
#: usr/lib/lua/luci/model/cbi/sqm.lua:243
msgid "default"
msgstr "默认"
#: usr/lib/lua/luci/model/cbi/sqm.lua:98
msgid ""
"Queuing disciplines useable on this system. After installing a new qdisc, "
"you need to restart the router to see updates!"
msgstr "系统上可用的列队规则。安装新的队列规则后,重新启动路由器才会看到更新!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:112
msgid "Queue setup script"
msgstr "队列脚本设置"
#: usr/lib/lua/luci/model/cbi/sqm.lua:129
msgid ""
"Show and Use Advanced Configuration. Advanced options will only be used as "
"long as this box is checked."
msgstr "选中该复选框显示高级配置。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:133
msgid "Squash DSCP on inbound packets (ingress):"
msgstr "入站数据包压缩DSCP:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:140
msgid "Ignore DSCP on ingress:"
msgstr "忽略入站DSCP"
#: usr/lib/lua/luci/model/cbi/sqm.lua:147
msgid ""
"Explicit congestion notification (ECN) status on inbound packets (ingress):"
msgstr "入站数据包的显式拥塞通知ECN状态"
#: usr/lib/lua/luci/model/cbi/sqm.lua:154
msgid ""
"Explicit congestion notification (ECN) status on outbound packets (egress)."
msgstr "出站数据包的显式拥塞通知ECN状态"
#: usr/lib/lua/luci/model/cbi/sqm.lua:161
msgid ""
"Show and Use Dangerous Configuration. Dangerous options will only be used as "
"long as this box is checked."
msgstr "选中该复选框显示危险配置。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:166
msgid "Hard limit on ingress queues; leave empty for default."
msgstr "入站队列严格限制;留空为默认。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:173
msgid "Hard limit on egress queues; leave empty for default."
msgstr "出站队列严格限制;留空为默认。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:180
msgid "Latency target for ingress, e.g 5ms [units: s, ms, or us]; leave empty for automatic selection, put in the word default for the qdisc's default."
msgstr "入站延迟目标,例如 5ms [单位: s, ms, 或 us]留空为自动选择default为列队规则默认值。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:185
msgid "Latency target for egress, e.g. 5ms [units: s, ms, or us]; leave empty for automatic selection, put in the word default for the qdisc's default."
msgstr "出站延迟目标,例如 5ms [单位: s, ms, 或 us]留空为自动选择default为列队规则默认值。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:192
msgid ""
"Advanced option string to pass to the ingress queueing disciplines; no error "
"checking, use very carefully."
msgstr "传递到入站队列规则的高级选项字符串;没有错误检查。请谨慎使用!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:196
msgid ""
"Advanced option string to pass to the egress queueing disciplines; no error "
"checking, use very carefully."
msgstr "传递到出站队列规则的高级选项字符串;没有错误检查。请谨慎使用!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:201
msgid "Which link layer to account for:"
msgstr "对哪个链路层生效:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:207
msgid "Per Packet Overhead (byte):"
msgstr "每个数据包开销"
#: usr/lib/lua/luci/model/cbi/sqm.lua:216
msgid ""
"Show Advanced Linklayer Options, (only needed if MTU > 1500). Advanced "
"options will only be used as long as this box is checked."
msgstr ""
"显示高级链路选项仅在MTU> 1500时才需要。 只有选中此框时,才会使用高级选"
"项。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:221
msgid ""
"Maximal Size for size and rate calculations, tcMTU (byte); needs to be >= "
"interface MTU + overhead:"
msgstr "大小和速率计算的最大尺寸tcMTUbyte; 需要> =接口MTU +开销:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:228
msgid ""
"Number of entries in size/rate tables, TSIZE; for ATM choose TSIZE = (tcMTU "
"+ 1) / 16:"
msgstr "大小/速率表中的条目数TSIZE; 对于ATM选择TSIZE =tcMTU + 1/ 16"
#: usr/lib/lua/luci/model/cbi/sqm.lua:235
msgid ""
"Minimal packet size, MPU (byte); needs to be > 0 for ethernet size tables:"
msgstr "最小数据包大小MPUbyte; 在以太网中需要>0"
#: usr/lib/lua/luci/model/cbi/sqm.lua:242
msgid "Which linklayer adaptation mechanism to use; for testing only"
msgstr "使用哪个链路适应机制; 仅用于测试"

View File

@ -0,0 +1,12 @@
INSTALL = install
PREFIX = /usr/bin
po2lmo: src/po2lmo.o src/template_lmo.o
$(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o
install:
$(INSTALL) -m 755 src/po2lmo $(PREFIX)
clean:
$(RM) src/po2lmo src/*.o

Binary file not shown.

View File

@ -0,0 +1,247 @@
/*
* lmo - Lua Machine Objects - PO to LMO conversion tool
*
* Copyright (C) 2009-2012 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "template_lmo.h"
static void die(const char *msg)
{
fprintf(stderr, "Error: %s\n", msg);
exit(1);
}
static void usage(const char *name)
{
fprintf(stderr, "Usage: %s input.po output.lmo\n", name);
exit(1);
}
static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
if( fwrite(ptr, size, nmemb, stream) == 0 )
die("Failed to write stdout");
}
static int extract_string(const char *src, char *dest, int len)
{
int pos = 0;
int esc = 0;
int off = -1;
for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ )
{
if( (off == -1) && (src[pos] == '"') )
{
off = pos + 1;
}
else if( off >= 0 )
{
if( esc == 1 )
{
switch (src[pos])
{
case '"':
case '\\':
off++;
break;
}
dest[pos-off] = src[pos];
esc = 0;
}
else if( src[pos] == '\\' )
{
dest[pos-off] = src[pos];
esc = 1;
}
else if( src[pos] != '"' )
{
dest[pos-off] = src[pos];
}
else
{
dest[pos-off] = '\0';
break;
}
}
}
return (off > -1) ? strlen(dest) : -1;
}
static int cmp_index(const void *a, const void *b)
{
uint32_t x = ((const lmo_entry_t *)a)->key_id;
uint32_t y = ((const lmo_entry_t *)b)->key_id;
if (x < y)
return -1;
else if (x > y)
return 1;
return 0;
}
static void print_uint32(uint32_t x, FILE *out)
{
uint32_t y = htonl(x);
print(&y, sizeof(uint32_t), 1, out);
}
static void print_index(void *array, int n, FILE *out)
{
lmo_entry_t *e;
qsort(array, n, sizeof(*e), cmp_index);
for (e = array; n > 0; n--, e++)
{
print_uint32(e->key_id, out);
print_uint32(e->val_id, out);
print_uint32(e->offset, out);
print_uint32(e->length, out);
}
}
int main(int argc, char *argv[])
{
char line[4096];
char key[4096];
char val[4096];
char tmp[4096];
int state = 0;
int offset = 0;
int length = 0;
int n_entries = 0;
void *array = NULL;
lmo_entry_t *entry = NULL;
uint32_t key_id, val_id;
FILE *in;
FILE *out;
if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) )
usage(argv[0]);
memset(line, 0, sizeof(key));
memset(key, 0, sizeof(val));
memset(val, 0, sizeof(val));
while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) )
{
if( state == 0 && strstr(line, "msgid \"") == line )
{
switch(extract_string(line, key, sizeof(key)))
{
case -1:
die("Syntax error in msgid");
case 0:
state = 1;
break;
default:
state = 2;
}
}
else if( state == 1 || state == 2 )
{
if( strstr(line, "msgstr \"") == line || state == 2 )
{
switch(extract_string(line, val, sizeof(val)))
{
case -1:
state = 4;
break;
default:
state = 3;
}
}
else
{
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
state = 2;
break;
default:
strcat(key, tmp);
}
}
}
else if( state == 3 )
{
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
state = 4;
break;
default:
strcat(val, tmp);
}
}
if( state == 4 )
{
if( strlen(key) > 0 && strlen(val) > 0 )
{
key_id = sfh_hash(key, strlen(key));
val_id = sfh_hash(val, strlen(val));
if( key_id != val_id )
{
n_entries++;
array = realloc(array, n_entries * sizeof(lmo_entry_t));
entry = (lmo_entry_t *)array + n_entries - 1;
if (!array)
die("Out of memory");
entry->key_id = key_id;
entry->val_id = val_id;
entry->offset = offset;
entry->length = strlen(val);
length = strlen(val) + ((4 - (strlen(val) % 4)) % 4);
print(val, length, 1, out);
offset += length;
}
}
state = 0;
memset(key, 0, sizeof(key));
memset(val, 0, sizeof(val));
}
memset(line, 0, sizeof(line));
}
print_index(array, n_entries, out);
if( offset > 0 )
{
print_uint32(offset, out);
fsync(fileno(out));
fclose(out);
}
else
{
fclose(out);
unlink(argv[2]);
}
fclose(in);
return(0);
}

View File

@ -0,0 +1,328 @@
/*
* lmo - Lua Machine Objects - Base functions
*
* Copyright (C) 2009-2010 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "template_lmo.h"
/*
* Hash function from http://www.azillionmonkeys.com/qed/hash.html
* Copyright (C) 2004-2008 by Paul Hsieh
*/
uint32_t sfh_hash(const char *data, int len)
{
uint32_t hash = len, tmp;
int rem;
if (len <= 0 || data == NULL) return 0;
rem = len & 3;
len >>= 2;
/* Main loop */
for (;len > 0; len--) {
hash += sfh_get16(data);
tmp = (sfh_get16(data+2) << 11) ^ hash;
hash = (hash << 16) ^ tmp;
data += 2*sizeof(uint16_t);
hash += hash >> 11;
}
/* Handle end cases */
switch (rem) {
case 3: hash += sfh_get16(data);
hash ^= hash << 16;
hash ^= data[sizeof(uint16_t)] << 18;
hash += hash >> 11;
break;
case 2: hash += sfh_get16(data);
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1: hash += *data;
hash ^= hash << 10;
hash += hash >> 1;
}
/* Force "avalanching" of final 127 bits */
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;
return hash;
}
uint32_t lmo_canon_hash(const char *str, int len)
{
char res[4096];
char *ptr, prev;
int off;
if (!str || len >= sizeof(res))
return 0;
for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++)
{
if (isspace(*str))
{
if (!isspace(prev))
*ptr++ = ' ';
}
else
{
*ptr++ = *str;
}
}
if ((ptr > res) && isspace(*(ptr-1)))
ptr--;
return sfh_hash(res, ptr - res);
}
lmo_archive_t * lmo_open(const char *file)
{
int in = -1;
uint32_t idx_offset = 0;
struct stat s;
lmo_archive_t *ar = NULL;
if (stat(file, &s) == -1)
goto err;
if ((in = open(file, O_RDONLY)) == -1)
goto err;
if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL)
{
memset(ar, 0, sizeof(*ar));
ar->fd = in;
ar->size = s.st_size;
fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC);
if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED)
goto err;
idx_offset = ntohl(*((const uint32_t *)
(ar->mmap + ar->size - sizeof(uint32_t))));
if (idx_offset >= ar->size)
goto err;
ar->index = (lmo_entry_t *)(ar->mmap + idx_offset);
ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t);
ar->end = ar->mmap + ar->size;
return ar;
}
err:
if (in > -1)
close(in);
if (ar != NULL)
{
if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED))
munmap(ar->mmap, ar->size);
free(ar);
}
return NULL;
}
void lmo_close(lmo_archive_t *ar)
{
if (ar != NULL)
{
if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED))
munmap(ar->mmap, ar->size);
close(ar->fd);
free(ar);
ar = NULL;
}
}
lmo_catalog_t *_lmo_catalogs = NULL;
lmo_catalog_t *_lmo_active_catalog = NULL;
int lmo_load_catalog(const char *lang, const char *dir)
{
DIR *dh = NULL;
char pattern[16];
char path[PATH_MAX];
struct dirent *de = NULL;
lmo_archive_t *ar = NULL;
lmo_catalog_t *cat = NULL;
if (!lmo_change_catalog(lang))
return 0;
if (!dir || !(dh = opendir(dir)))
goto err;
if (!(cat = malloc(sizeof(*cat))))
goto err;
memset(cat, 0, sizeof(*cat));
snprintf(cat->lang, sizeof(cat->lang), "%s", lang);
snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang);
while ((de = readdir(dh)) != NULL)
{
if (!fnmatch(pattern, de->d_name, 0))
{
snprintf(path, sizeof(path), "%s/%s", dir, de->d_name);
ar = lmo_open(path);
if (ar)
{
ar->next = cat->archives;
cat->archives = ar;
}
}
}
closedir(dh);
cat->next = _lmo_catalogs;
_lmo_catalogs = cat;
if (!_lmo_active_catalog)
_lmo_active_catalog = cat;
return 0;
err:
if (dh) closedir(dh);
if (cat) free(cat);
return -1;
}
int lmo_change_catalog(const char *lang)
{
lmo_catalog_t *cat;
for (cat = _lmo_catalogs; cat; cat = cat->next)
{
if (!strncmp(cat->lang, lang, sizeof(cat->lang)))
{
_lmo_active_catalog = cat;
return 0;
}
}
return -1;
}
static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash)
{
unsigned int m, l, r;
uint32_t k;
l = 0;
r = ar->length - 1;
while (1)
{
m = l + ((r - l) / 2);
if (r < l)
break;
k = ntohl(ar->index[m].key_id);
if (k == hash)
return &ar->index[m];
if (k > hash)
{
if (!m)
break;
r = m - 1;
}
else
{
l = m + 1;
}
}
return NULL;
}
int lmo_translate(const char *key, int keylen, char **out, int *outlen)
{
uint32_t hash;
lmo_entry_t *e;
lmo_archive_t *ar;
if (!key || !_lmo_active_catalog)
return -2;
hash = lmo_canon_hash(key, keylen);
for (ar = _lmo_active_catalog->archives; ar; ar = ar->next)
{
if ((e = lmo_find_entry(ar, hash)) != NULL)
{
*out = ar->mmap + ntohl(e->offset);
*outlen = ntohl(e->length);
return 0;
}
}
return -1;
}
void lmo_close_catalog(const char *lang)
{
lmo_archive_t *ar, *next;
lmo_catalog_t *cat, *prev;
for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next)
{
if (!strncmp(cat->lang, lang, sizeof(cat->lang)))
{
if (prev)
prev->next = cat->next;
else
_lmo_catalogs = cat->next;
for (ar = cat->archives; ar; ar = next)
{
next = ar->next;
lmo_close(ar);
}
free(cat);
break;
}
}
}

View File

@ -0,0 +1,92 @@
/*
* lmo - Lua Machine Objects - General header
*
* Copyright (C) 2009-2012 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _TEMPLATE_LMO_H_
#define _TEMPLATE_LMO_H_
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <fnmatch.h>
#include <dirent.h>
#include <ctype.h>
#include <limits.h>
#if (defined(__GNUC__) && defined(__i386__))
#define sfh_get16(d) (*((const uint16_t *) (d)))
#else
#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
+(uint32_t)(((const uint8_t *)(d))[0]) )
#endif
struct lmo_entry {
uint32_t key_id;
uint32_t val_id;
uint32_t offset;
uint32_t length;
} __attribute__((packed));
typedef struct lmo_entry lmo_entry_t;
struct lmo_archive {
int fd;
int length;
uint32_t size;
lmo_entry_t *index;
char *mmap;
char *end;
struct lmo_archive *next;
};
typedef struct lmo_archive lmo_archive_t;
struct lmo_catalog {
char lang[6];
struct lmo_archive *archives;
struct lmo_catalog *next;
};
typedef struct lmo_catalog lmo_catalog_t;
uint32_t sfh_hash(const char *data, int len);
uint32_t lmo_canon_hash(const char *data, int len);
lmo_archive_t * lmo_open(const char *file);
void lmo_close(lmo_archive_t *ar);
extern lmo_catalog_t *_lmo_catalogs;
extern lmo_catalog_t *_lmo_active_catalog;
int lmo_load_catalog(const char *lang, const char *dir);
int lmo_change_catalog(const char *lang);
int lmo_translate(const char *key, int keylen, char **out, int *outlen);
void lmo_close_catalog(const char *lang);
#endif

View File

@ -0,0 +1,48 @@
#
# Copyright (c) 2015 Justin Liu
# Author: Justin Liu <rssnsj@gmail.com>
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ipset-lists
PKG_VERSION:=20161112
PKG_RELEASE:=
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/ipset-lists
CATEGORY:=Network
TITLE:=Service for IPSET address tables
MAINTAINER:=Justin Liu <rssnsj@gmail.com>
DEPENDS:=+ipset +luci
endef
define Package/ipset-lists/conffiles
/etc/gfwlist/china-banned
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Compile/Default
endef
Build/Compile = $(Build/Compile/Default)
define Package/ipset-lists/install
$(CP) -a files/* $(1)/
endef
define Package/ipset-lists/postinst
#!/bin/sh
if [ -e /etc/openwrt_release ]; then
/etc/init.d/ipset.sh restart
/etc/init.d/ipset.sh enable || :
fi
endef
$(eval $(call BuildPackage,ipset-lists))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,95 @@
v.youku.com
api.youku.com
v2.tudou.com
www.tudou.com
s.plcloud.music.qq.com
i.y.qq.com
hot.vrs.sohu.com
live.tv.sohu.com
pad.tv.sohu.com
my.tv.sohu.com
hot.vrs.letv.com
data.video.qiyi.com
cache.video.qiyi.com
cache.vip.qiyi.com
vv.video.qq.com
tt.video.qq.com
ice.video.qq.com
tjsa.video.qq.com
a10.video.qq.com
xyy.video.qq.com
vcq.video.qq.com
vsh.video.qq.com
vbj.video.qq.com
bobo.video.qq.com
flvs.video.qq.com
bkvv.video.qq.com
info.zb.qq.com
geo.js.kankan.xunlei.com
web-play.pptv.com
web-play.pplive.cn
dyn.ugc.pps.tv
v.pps.tv
inner.kandian.com
ipservice.163.com
so.open.163.com
zb.s.qq.com
ip.kankan.xunlei.com
vxml.56.com
music.sina.com.cn
play.baidu.com
v.iask.com
tv.weibo.com
wtv.v.iask.com
video.sina.com.cn
www.yinyuetai.com
api.letv.com
live.gslb.letv.com
static.itv.letv.com
ip.apps.cntv.cn
vdn.apps.cntv.cn
vdn.live.cntv.cn
vip.sports.cntv.cn
a.play.api.3g.youku.com
i.play.api.3g.youku.com
api.3g.youku.com
tv.api.3g.youku.com
play.api.3g.youku.com
play.api.3g.tudou.com
tv.api.3g.tudou.com
api.3g.tudou.com
api.tv.sohu.com
access.tv.sohu.com
iface.iqiyi.com
iface2.iqiyi.com
cache.m.iqiyi.com
dynamic.app.m.letv.com
dynamic.meizi.app.m.letv.com
dynamic.search.app.m.letv.com
dynamic.live.app.m.letv.com
listso.m.areainfo.ppstream.com
epg.api.pptv.com
play.api.pptv.com
m.letv.com
interface.bilibili.com
3g.music.qq.com
mqqplayer.3g.qq.com
proxy.music.qq.com
proxymc.qq.com
ip2.kugou.com
ip.kugou.com
client.api.ttpod.com
mobi.kuwo.cn
mobilefeedback.kugou.com
tingapi.ting.baidu.com
music.baidu.com
serviceinfo.sdk.duomi.com
music.163.com
www.xiami.com
spark.api.xiami.com
iplocation.geo.qiyi.com
sns.video.qq.com
v5.pc.duomi.com
tms.is.ysten.com
internal.check.duokanbox.com
openapi.youku.com

View File

@ -0,0 +1,29 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2014 Justin Liu <rssnsj@gmail.com>
START=21
start()
{
local file
for file in /etc/ipset/*; do
[ -f $file ] || continue
ipset restore < $file
done
}
stop()
{
local file
for file in /etc/ipset/*; do
[ -f $file ] || continue
ipset destroy `basename $file`
done
}
restart()
{
stop >/dev/null 2>&1
start
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
create local hash:net family inet hashsize 1024 maxelem 65536
add local 10.0.0.0/8
add local 127.0.0.0/8
add local 172.16.0.0/12
add local 192.168.0.0/16
add local 224.0.0.0/3

View File

@ -0,0 +1,14 @@
--[[
Customize /etc/gfwlist.list content
Copyright (c) 2015 Justin Liu
Author: Justin Liu <rssnsj@gmail.com>
https://github.com/rssnsj/network-feeds
]]--
module("luci.controller.gfwlist", package.seeall)
function index()
local page
page = entry({"admin", "services", "gfwlist"}, cbi("gfwlist"), _("Domain Lists"))
page.dependent = true
end

View File

@ -0,0 +1,33 @@
--[[
Customize firewall-banned domain lists - /etc/gfwlist/
Copyright (c) 2015 Justin Liu
Author: Justin Liu <rssnsj@gmail.com>
https://github.com/rssnsj/network-feeds
]]--
local fs = require "nixio.fs"
function sync_value_to_file(value, file)
value = value:gsub("\r\n?", "\n")
local old_value = nixio.fs.readfile(file)
if value ~= old_value then
nixio.fs.writefile(file, value)
end
end
m = SimpleForm("gfwlist", translate("Domain Lists Settings"))
for e in fs.dir("/etc/gfwlist") do
glist = m:field(TextValue, e, e, nil)
glist.rmempty = false
glist.rows = 12
function glist.cfgvalue()
return nixio.fs.readfile("/etc/gfwlist/" .. e) or ""
end
function glist.write(self, section, value)
sync_value_to_file(value, "/etc/gfwlist/" .. e)
end
end
return m

View File

@ -0,0 +1,9 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Domain Lists Settings"
msgstr "域名列表设置"
msgid "Domain Lists"
msgstr "域名列表"

View File

@ -0,0 +1,3 @@
update:
./gen-china-routes.sh > ../files/etc/ipset/china
./gen-gfwlist.sh > ../files/etc/gfwlist/china-banned

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,85 @@
#!/bin/bash -e
#
# Script for generating China IPv4 route table by merging APNIC.net data and IPIP.net data
#
china_routes_ipip()
{
[ -f ipip.txt ] || wget -4 https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt -O ipip.txt >&2 || exit 1
cat ipip.txt | xargs netmask | awk '{print $1}'
}
china_routes_apnic()
{
[ -f apnic.txt ] || wget -4 http://ftp.apnic.net/stats/apnic/delegated-apnic-latest -O apnic.txt >&2 || exit 1
cat apnic.txt | awk -F'|' -vc=CN '
function tobits(c) { for(n=0; c>=2; c/=2) n++; return 32-n; }
$2==c&&$3=="ipv4" { printf("%s/%d\n", $4, tobits($5)) }' |
xargs netmask | awk '{print $1}'
}
china_routes_merged()
{
[ -x ./ipv4-merger ] || gcc ipv4_merger.c -o ipv4-merger >&2
china_routes_apnic > china.apnic
china_routes_ipip > china.ipip
# Merge them together
cat china.apnic china.ipip | ./ipv4-merger | sed 's/\-/:/g' |
xargs netmask | awk '{print $1}' | awk -F/ '$2<=24' > china.merged
cat china.merged
}
# $1: ipset name
convert_routes_to_ipset()
{
local ipset_name="$1"
echo "create $ipset_name hash:net family inet hashsize 1024 maxelem 65536"
awk -vt="$ipset_name" '{ printf("add %s %s\n", t, $0) }'
}
generate_china_ipset()
{
china_routes_merged | convert_routes_to_ipset china
}
generate_inverted_china_routes()
{
(
china_routes_merged
echo 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 172.16.0.0/12 192.168.0.0/16 224.0.0.0/3
) |
xargs netmask -r | awk '{print $1}' |
awk -F- '
function iptoint(ip) { split(ip,arr,"."); n=0; for(i=1;i<=4;i++) n=n*256+arr[i]; return n; }
function inttoip(n) { a=int(n/16777216); b=int(n%16777216/65536); c=int(n%65536/256); d=n%256; return a "." b "." c "." d; }
BEGIN { st=0 }
{ x=st; y=iptoint($1); st=iptoint($2)+1; if(y>x) { print inttoip(x) ":" inttoip(y-1); } }' |
xargs netmask | awk '{print $1}'
}
##
case "$1" in
"")
generate_china_ipset
;;
-c)
china_routes_merged
;;
-r)
generate_inverted_china_routes
;;
*)
echo "Usage:"
echo " $0 generate China routes in ipset format"
echo " $0 -c generate China routes in IP/prefix format"
echo " $0 -r generate invert China routes"
;;
*)
esac

View File

@ -0,0 +1,29 @@
#!/bin/sh -e
generate_china_banned()
{
if [ ! -f gfwlist.txt ]; then
wget https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt -O gfwlist.b64 >&2
cat gfwlist.b64 | base64 -d > gfwlist.txt
rm -f gfwlist.b64
fi
cat gfwlist.txt base-gfwlist.txt | sort -u |
sed 's#!.\+##; s#|##g; s#@##g; s#http:\/\/##; s#https:\/\/##;' |
sed '/\*/d; /apple\.com/d; /sina\.cn/d; /sina\.com\.cn/d; /baidu\.com/d; /qq\.com/d' |
sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' |
grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | rev | sort -u |
awk '
BEGIN { prev = "________"; } {
cur = $0;
if (index(cur, prev) == 1 && substr(cur, 1 + length(prev) ,1) == ".") {
} else {
print cur;
prev = cur;
}
}' | rev | sort -u
}
generate_china_banned

View File

@ -0,0 +1,339 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
typedef u_int32_t u32;
typedef int bool;
#define true 1
#define false 0
typedef unsigned gfp_t;
static inline char *ipv4_hltos(u32 u, char *s)
{
static char ss[20];
if (!s)
s = ss;
sprintf(s, "%d.%d.%d.%d",
(int)(u >> 24) & 0xff, (int)(u >> 16) & 0xff,
(int)(u >> 8) & 0xff, (int)u & 0xff );
return s;
}
static inline u32 ipv4_stohl(const char *s)
{
int u[4];
if (sscanf(s, "%d.%d.%d.%d", &u[0], &u[1], &u[2], &u[3]) == 4) {
return (((u32)u[0] & 0xff) << 24) |
(((u32)u[1] & 0xff) << 16) |
(((u32)u[2] & 0xff) << 8) |
(((u32)u[3] & 0xff));
} else
return 0xffffffff;
}
static inline bool is_ipv4_addr(const char *s)
{
int u[4];
if (sscanf(s, "%d.%d.%d.%d", &u[0], &u[1], &u[2], &u[3]) == 4)
return true;
else
return false;
}
struct ipv4_range {
u32 start;
u32 end;
};
struct sa_open_data {
struct ipv4_range *tmp_base;
size_t tmp_size;
size_t tmp_length;
int errors;
};
static int __touch_tmp_base(struct sa_open_data *od, gfp_t gfp)
{
if (!od->tmp_base) {
/**
* Allocate a temporary table with twice the size of the previous
* table or at least 100, on which new entries can be inserted.
*/
if (od->tmp_size < 100)
od->tmp_size = 100;
od->tmp_base = (struct ipv4_range *)malloc(
sizeof(struct ipv4_range) * od->tmp_size /*, gfp*/ );
if (!od->tmp_base) {
fprintf(stderr,
"salist: cannot allocate the temporary list for enlarging it.\n");
return -ENOMEM;
}
od->tmp_length = 0;
}
return 0;
}
static int ipv4_list_add_range(struct sa_open_data *od, u32 start,
u32 end, gfp_t gfp)
{
struct ipv4_range *cur;
int ret;
/* Ignore a new range if it or a larger range already exists */
//if (salist_check_ipv4(od->table, start, end))
// return 0;
if ((ret = __touch_tmp_base(od, gfp)) < 0)
return ret;
/* Check if the size is efficient. Enlarge it if needed. */
if (od->tmp_length + 1 >= od->tmp_size) {
size_t old_size = od->tmp_size;
struct ipv4_range *old_base = od->tmp_base;
od->tmp_size *= 2;
od->tmp_base = (struct ipv4_range *)realloc(od->tmp_base,
sizeof(struct ipv4_range) * od->tmp_size);
if (!od->tmp_base) {
od->tmp_size = old_size;
od->tmp_base = old_base;
return -ENOMEM;
}
}
cur = &od->tmp_base[od->tmp_length++];
cur->start = start;
cur->end = end;
return 0;
}
static inline int ipv4_list_add_netmask(struct sa_open_data *od,
u32 net, u32 net_mask, gfp_t gfp)
{
u32 start = net & net_mask;
u32 end = net | ~net_mask;
return ipv4_list_add_range(od, start, end, gfp);
}
static int ipv4_list_add_net(struct sa_open_data *od, u32 net,
int net_bits, gfp_t gfp)
{
u32 net_mask;
if(net_bits == 0)
net_mask = 0x00000000;
else
net_mask = ~(((u32)1 << (32 - net_bits)) - 1);
//printf("%d: %08x, %08x\n", net_bits, net_mask, net_size);
return ipv4_list_add_netmask(od, net, net_mask, gfp);
}
static int salist_cmd_parse(struct sa_open_data *od, char *cmd, gfp_t gfp)
{
char *a1 = NULL, *a2 = NULL;
char *sep;
char sc;
int n = 32;
/* Case 3: Append an item */
/* Check IP description part: network segment or range? */
if ((sep = strchr(cmd, '/'))) { }
else if ((sep = strchr(cmd, '-'))) { }
else if ((sep = strchr(cmd, ':'))) { }
if (sep) {
/* Describes a subnet or range. */
sc = *sep;
*sep = '\0';
a1 = cmd;
a2 = sep + 1;
if (*a2 == '\0') {
fprintf(stderr, "Nothing after '%c'.\n", sc);
return -EINVAL;
}
} else {
/* Describes a single IP. */
sc = '\0';
a1 = cmd;
}
switch (sc) {
case '/':
/* 10.10.20.0/24 */
/* ------------------------------------ */
if (is_ipv4_addr(a2)) {
ipv4_list_add_netmask(od, ipv4_stohl(a1), ipv4_stohl(a2), gfp);
} else {
sscanf(a2, "%d", &n);
ipv4_list_add_net(od, ipv4_stohl(a1), n, gfp);
}
/* ------------------------------------ */
break;
case ':':
case '-':
/* 10.10.20.0-10.20.0.255 */
/* ------------------------------------ */
ipv4_list_add_range(od, ipv4_stohl(a1), ipv4_stohl(a2), gfp);
/* ------------------------------------ */
break;
default:
if (is_ipv4_addr(a1)) {
/* Single IP address. */
u32 ip = ipv4_stohl(a1);
/* ------------------------------------ */
ipv4_list_add_range(od, ip, ip, gfp);
/* ------------------------------------ */
} else {
fprintf(stderr, "Invalid IP address '%s'.\n", a1);
return -EINVAL;
}
break;
}
return 0;
}
static int ipv4_range_sort_cmp(const void *a, const void *b)
{
struct ipv4_range *ra = (struct ipv4_range *)a;
struct ipv4_range *rb = (struct ipv4_range *)b;
if (ra->start > rb->start) {
return 1;
} else if (ra->start < rb->start) {
return -1;
} else if (ra->end > rb->end) {
return 1;
} else if (ra->end < rb->end) {
return -1;
} else {
return 0;
}
}
static void ipv4_range_swap(void *a, void *b, int size)
{
struct ipv4_range *ra = (struct ipv4_range *)a;
struct ipv4_range *rb = (struct ipv4_range *)b;
struct ipv4_range tmp;
tmp = *ra;
*ra = *rb;
*rb = tmp;
}
static struct sa_open_data *salist_open(void)
{
struct sa_open_data *od = NULL;
od = (struct sa_open_data *)malloc(sizeof(*od));
if (!od) {
fprintf(stderr, "salist: cannot allocate sa_open_data.\n");
return NULL;
}
memset(od, 0, sizeof(*od));
od->errors = 0;
return od;
}
static int salist_close(struct sa_open_data *od)
{
size_t ri, wi;
struct ipv4_range *old_base;
/* Flush the table if any modification has been done */
if (od->tmp_base) {
/* Sort the table and merge entries as many as possible. */
if (od->tmp_length >= 2) {
qsort(od->tmp_base, od->tmp_length, sizeof(struct ipv4_range),
ipv4_range_sort_cmp);
for (wi = 0, ri = 1; ri < od->tmp_length; ri++) {
/* NOTICE: 0xffffffff + 1 ? */
if (od->tmp_base[wi].end == (u32)(-1)) {
/* Nothing */
} else if (od->tmp_base[ri].start <= od->tmp_base[wi].end + 1) {
/* The two ranges overlap, so merge the 2nd to the 1st one */
if (od->tmp_base[ri].end > od->tmp_base[wi].end)
od->tmp_base[wi].end = od->tmp_base[ri].end;
} else {
wi++;
if (wi < ri)
od->tmp_base[wi] = od->tmp_base[ri];
}
}
od->tmp_length = wi + 1;
}
/* Reduce the size */
if (od->tmp_length < od->tmp_size) {
struct ipv4_range *__tmp = od->tmp_base;
od->tmp_base = (struct ipv4_range *)malloc(
sizeof(struct ipv4_range) * (od->tmp_length ? od->tmp_length : 1));
if (od->tmp_base) {
memcpy(od->tmp_base, __tmp,
sizeof(struct ipv4_range) * od->tmp_length);
free(__tmp);
} else {
fprintf(stderr, "[%s:%d] Failed to allocate temporary table.\n",
__FUNCTION__, __LINE__);
/* If failed to allocate new memory, do not reduce it. */
od->tmp_base = __tmp;
}
}
/* Dump the table instead */
}
if (od->errors) {
fprintf(stderr, "[%s] %d errors detected during table operation.\n",
__FUNCTION__, od->errors);
}
return 0;
}
static void sa_open_data_dump(struct sa_open_data *od)
{
size_t i;
char s1[20], s2[20];
for (i = 0; i < od->tmp_length; i++) {
printf("%s-%s\n", ipv4_hltos(od->tmp_base[i].start, s1),
ipv4_hltos(od->tmp_base[i].end, s2));
}
}
int main(int argc, char *argv[])
{
struct sa_open_data *od;
char lbuf[128];
od = salist_open();
while (fgets(lbuf, sizeof(lbuf), stdin)) {
size_t llen = strlen(lbuf);
if (llen > 0 && lbuf[llen - 1] == '\n')
lbuf[--llen] = '\0';
if (llen > 0 && lbuf[llen - 1] == '\r')
lbuf[--llen] = '\0';
if (llen == 0)
continue;
salist_cmd_parse(od, lbuf, 0);
}
salist_close(od);
sa_open_data_dump(od);
return 0;
}

View File

@ -0,0 +1,42 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=k3wifi
PKG_VERSION:=1
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
TITLE:=k3wifi
DEPENDS:=
URL:=http://www.k3wifi.com/
endef
define Package/$(PKG_NAME)/description
k3wifi fw
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DIR) $(1)/lib/firmware/brcm
$(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

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

View File

@ -0,0 +1,10 @@
module("luci.controller.adbyby", package.seeall)
function index()
if not nixio.fs.access("/etc/config/adbyby") then
return
end
entry({"admin", "services", "adbyby"}, cbi("adbyby"), _("ADBYBY Plus +"), 10).dependent = true
end

View File

@ -0,0 +1,203 @@
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local m,s,o
local Status
if SYS.call("pidof adbyby >/dev/null") == 0 then
Status = translate("<strong><font color=\"green\">Adbyby Plus + is Running</font></strong>")
else
Status = translate("<strong><font color=\"red\">Adbyby Plus + is Not Running</font></strong>")
end
m = Map("adbyby")
m.title = translate("Adbyby Plus +")
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 Hostfiltering ads without losing bandwidth</font>")
s = m:section(TypedSection, "adbyby")
s.anonymous = true
s.description = translate(string.format("%s<br /><br />", Status))
s:tab("basic", translate("Base Setting"))
o = s:taboption("basic", Flag, "enable")
o.title = translate("Enable")
o.default = 0
o.rmempty = false
o = s:taboption("basic", ListValue, "wan_mode")
o.title = translate("Running Mode")
o:value("0", translate("Global ModeThe slowest, the best effects"))
o:value("1", translate("Plus + ModeFilter 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:taboption("basic", Button, "proxy")
o.title = translate("Transparent proxy")
if SYS.call("iptables-save | grep ADBYBY >/dev/null") == 0 then
o.inputtitle = translate("Click to disable")
o.inputstyle = "reset"
o.write = function()
SYS.call("/etc/init.d/adbyby del_rule")
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
else
o.inputtitle = translate("Click to enable")
o.inputstyle = "apply"
o.write = function()
SYS.call('[ -n "$(pgrep adbyby)" ] && /etc/init.d/adbyby add_rule')
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
end
local DL = SYS.exec("head -1 /usr/share/adbyby/data/lazy.txt | awk -F' ' '{print $3,$4}'")
local DV = SYS.exec("head -1 /usr/share/adbyby/data/video.txt | awk -F' ' '{print $3,$4}'")
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 NW = SYS.exec("uci get adbyby.@adbyby[-1].domain 2>/dev/null | wc -l")
local ND = SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
o = s:taboption("basic", Button, "restart")
o.title = translate("Adbyby and Rule state")
o.inputtitle = translate("Restart Adbyby")
o.description = translate(string.format("%s<br /><br />", Status))
o.description = translate(string.format("<strong>Lazy Rule</strong>%s <strong>&nbsp;&nbsp;Video Rule</strong>%s<br /><strong>Third Party Subscription Rule</strong>%d lines&nbsp;&nbsp;<strong>User-defined Rule</strong>%d lines", DL, DV, math.abs(NR-NU), NR))
o.inputstyle = "reload"
o.write = function()
SYS.call("/etc/init.d/adbyby restart")
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
s:tab("advanced", translate("Advance Setting"))
o = s:taboption("advanced", 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.description = translate(string.format("<strong><font color=blue>Adblock Plus Host List</font></strong> %s Lines<br /><br />", ND))
updatead = s:taboption("advanced", Button, "updatead", translate("Manually force update<br />Adblock Plus Host List"), translate("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!"))
updatead.inputtitle = translate("Manually force update")
updatead.inputstyle = "apply"
updatead.write = function()
SYS.call("nohup sh /usr/share/adbyby/adblock.sh > /tmp/adupdate.log 2>&1 &")
end
o = s:taboption("advanced", Flag, "block_ios")
o.title = translate("Block Apple iOS OTA update")
o.default = 0
o.rmempty = false
mem = s:taboption("advanced", Flag, "mem_mode")
mem.title = translate("RAM Running Mode")
mem.default = 1
mem.rmempty = false
mem.description = translate("Running Adbyby in RAM.More speed,less disk consumption")
s:tab("help", translate("Plus+ Domain List"))
local conf = "/usr/share/adbyby/adhost.conf"
o = s:taboption("help", TextValue, "conf")
o.description = translate("!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")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(conf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(conf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("esc", translate("Bypass Domain List"))
local escconf = "/usr/share/adbyby/adesc.conf"
o = s:taboption("esc", TextValue, "escconf")
o.description = translate("!Will Never filter these Domain")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(escconf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(escconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("black", translate("Black Domain List"))
local blackconf = "/usr/share/adbyby/adblack.conf"
o = s:taboption("black", TextValue, "blackconf")
o.description = translate("!Will Always block these Domain")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(blackconf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(blackconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("block", translate("Black IP List"))
local blockconf = "/usr/share/adbyby/blockip.conf"
o = s:taboption("block", TextValue, "blockconf")
o.description = translate("!Will Always block these IP")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(blockconf) or " "
end
o.write = function(self, section, value)
NXFS.writefile(blockconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("user", translate("User-defined Rule"))
local file = "/usr/share/adbyby/rules.txt"
o = s:taboption("user", TextValue, "rules")
o.description = translate("Each line of the beginning exclamation mark is considered an annotation.")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(file) or ""
end
o.write = function(self, section, value)
NXFS.writefile(file, value:gsub("\r\n", "\n"))
end
t=m:section(TypedSection,"acl_rule",translate("<strong>Client Filter Mode Settings</strong>"),
translate("Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default."))
t.template="cbi/tblsection"
t.sortable=true
t.anonymous=true
t.addremove=true
e=t:option(Value,"ipaddr",translate("IP Address"))
e.width="40%"
e.datatype="ip4addr"
e.placeholder="0.0.0.0/0"
luci.ip.neighbors({ family = 4 }, function(entry)
if entry.reachable then
e:value(entry.dest:string())
end
end)
e=t:option(ListValue,"filter_mode",translate("Filter Mode"))
e.width="40%"
e.default="disable"
e.rmempty=false
e:value("disable",translate("No filter"))
e:value("global",translate("Global filter"))
return m

View File

@ -0,0 +1,118 @@
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 Hostfiltering ads without losing bandwidth</font>"
msgstr "广告屏蔽大师 Plus + 可以全面过滤各种横幅、弹窗、视频广告,同时阻止跟踪、隐私窃取及各种恶意网站<br /><font color=\"red\">Plus + 版本可以和 Adblock Plus Host 结合方式运行,过滤广告不损失带宽</font>"
msgid "Adbyby Plus +"
msgstr "广告屏蔽大师 Plus+"
msgid "Base Setting"
msgstr "基本设置"
msgid "Running Mode"
msgstr "运行模式"
msgid "Global ModeThe slowest, the best effects"
msgstr "全局模式(最慢, 效果最好)"
msgid "Plus + ModeFilter 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 "Manually force update<br />Adblock Plus Host List"
msgstr "手动强制更新<br />Adblock Plus Host List"
msgid "Manually force update"
msgstr "手动强制更新"
msgid "Block Apple iOS OTA update"
msgstr "拦截 Apple iOS 的OTA更新"
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秒运行。完成后会自动刷新请不要重复点击"

View File

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

View File

@ -0,0 +1,217 @@
#!/bin/sh /etc/rc.common
START=99
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"
get_config()
{
config_get_bool enable $1 enable
config_get_bool cron_mode $1 cron_mode
config_get wan_mode $1 wan_mode
config_get_bool block_ios $1 block_ios 0
config_get_bool mem_mode $1 mem_mode 1
}
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
for i in $(seq 0 100)
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 -I 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
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
cat > /tmp/dnsmasq.d/dnsmasq-adbyby.conf <<EOF
conf-dir=/var/etc/dnsmasq-adbyby.d
EOF
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
sed -i '/mesu.apple.com/d' /etc/dnsmasq.conf && [ $block_ios -eq 1 ] && echo 'address=/mesu.apple.com/0.0.0.0' >> /etc/dnsmasq.conf
}
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
$ipt_n -A ADBYBY -p tcp -j REDIRECT --to-ports 8118
$ipt_n -I PREROUTING -p tcp --dport 80 -j ADBYBY
}
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
iptables-save | grep ADBYBY >/dev/null || \
add_rule
}
start()
{
config_load adbyby
config_foreach get_config adbyby
[ $enable -eq 0 ] && exit 0
add_cron
if [ $mem_mode -eq 1 ]; then
echo "start mem mode"
if mount | grep adbyby >/dev/null 2>&1; then
echo "has mount"
else
echo "mount adbyby"
[ ! -d "/tmp/adbyby" ] && mkdir -p /tmp/adbyby && cp -a $PROG_PATH/data /tmp/adbyby/
mount --bind /tmp/adbyby/data $PROG_PATH/data
fi
fi
add_rules
$PROG_PATH/adbyby &>/dev/null &
add_dns
iptables-save | grep ADBYBY >/dev/null || \
add_rule
/etc/init.d/dnsmasq restart
}
stop()
{
config_load adbyby
config_foreach get_config adbyby
del_rule
del_cron
del_dns
killall -q adbyby
if [ $mem_mode -eq 1 ]; then
echo "stop mem mode"
if mount | grep adbyby >/dev/null 2>&1; then
echo "umount adbyby"
umount /usr/share/adbyby/data
fi
fi
/etc/init.d/dnsmasq restart
}
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}
}

View File

@ -0,0 +1,21 @@
#!/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=/usr/share/adbyby/firewall.include
set firewall.adbyby.reload=1
commit firewall
EOF
mkdir -p /etc/dnsmasq.d
/etc/init.d/adbyby enable
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,15 @@
stat.pandora.xiaomi.com
upgrade.mishop.pandora.xiaomi.com
logonext.tv.kuyun.com
config.kuyun.com
api.io.mi.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
gvod.aiseejapp.atianqi.com

View File

@ -0,0 +1,17 @@
#!/bin/sh
rm -f /tmp/dnsmasq.adblock
wget-ssl --no-check-certificate -O- https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/dnsmasq.adblock
if [ -s "/tmp/dnsmasq.adblock" ];then
sed -i '/youku.com/d' /tmp/dnsmasq.adblock
if ( ! cmp -s /tmp/dnsmasq.adblock /usr/share/adbyby/dnsmasq.adblock );then
mv /tmp/dnsmasq.adblock /usr/share/adbyby/dnsmasq.adblock
fi
fi
sh /usr/share/adbyby/adupdate.sh

View File

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

View File

@ -0,0 +1,69 @@
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
163.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

@ -0,0 +1,16 @@
#!/bin/sh
wget -t 1 -T 10 -O /tmp/lazy.txt http://update.adbyby.com/rule3/lazy.jpg
wget -t 1 -T 10 -O /tmp/video.txt http://update.adbyby.com/rule3/video.jpg
wget -t 1 -T 10 -O /tmp/user.action http://update.adbyby.com/rule3/user.action
[ ! -s "/tmp/lazy.txt" ] && wget --no-check-certificate -O /tmp/lazy.txt https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt
[ ! -s "/tmp/video.txt" ] && wget --no-check-certificate -O /tmp/video.txt https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/video.txt
[ -s "/tmp/lazy.txt" ] && ( ! cmp -s /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt ) && mv /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt
[ -s "/tmp/video.txt" ] && ( ! cmp -s /tmp/video.txt /usr/share/adbyby/data/video.txt ) && mv /tmp/video.txt /usr/share/adbyby/data/video.txt
[ -s "/tmp/user.action" ] && ( ! cmp -s /tmp/user.action /usr/share/adbyby/user.action ) && mv /tmp/user.action /usr/share/adbyby/user.action
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/user.action
/etc/init.d/adbyby restart

View File

@ -0,0 +1 @@
1.1.1.1

View File

@ -0,0 +1,940 @@
address=/a.youdao.com/0.0.0.0
address=/adrs.sdo.com/0.0.0.0
address=/hiad.myweb.hinet.net/0.0.0.0
address=/log.interest.mix.sina.com.cn/0.0.0.0
address=/tuiguang.178.com/0.0.0.0
address=/0xxd.com/0.0.0.0
address=/104.195.62.12/0.0.0.0
address=/111.175.219.7/0.0.0.0
address=/111111qb.com/0.0.0.0
address=/112.124.98.75/0.0.0.0
address=/116.55.227.242/0.0.0.0
address=/122.227.254.195/0.0.0.0
address=/123hala.com/0.0.0.0
address=/139.159.32.82/0.0.0.0
address=/182.92.81.104/0.0.0.0
address=/1l1.cc/0.0.0.0
address=/201071.com/0.0.0.0
address=/2012ui.com/0.0.0.0
address=/211.167.105.131/0.0.0.0
address=/220.115.251.25/0.0.0.0
address=/221.204.213.222/0.0.0.0
address=/2m2n.com/0.0.0.0
address=/360baidus.com/0.0.0.0
address=/365bibi.com/0.0.0.0
address=/365safego.com/0.0.0.0
address=/366safego.com/0.0.0.0
address=/36pn.com/0.0.0.0
address=/3g.990.net/0.0.0.0
address=/52kmk.com/0.0.0.0
address=/58.215.179.159/0.0.0.0
address=/61.152.223.15/0.0.0.0
address=/68665565.com/0.0.0.0
address=/6dvip.com/0.0.0.0
address=/71sem.com/0.0.0.0
address=/77power.com/0.0.0.0
address=/7wen.cn/0.0.0.0
address=/7xz3.com/0.0.0.0
address=/81c.cn/0.0.0.0
address=/85tgw.com/0.0.0.0
address=/88rpg.net/0.0.0.0
address=/892155.com/0.0.0.0
address=/91ysa.com/0.0.0.0
address=/91zgm.com/0.0.0.0
address=/9377co.com/0.0.0.0
address=/9377os.com/0.0.0.0
address=/a907907.com/0.0.0.0
address=/ad000000.com/0.0.0.0
address=/adm-cnzz.net/0.0.0.0
address=/ads.uc.cn/0.0.0.0
address=/ajaxcdn.org/0.0.0.0
address=/aliyuncss.com/0.0.0.0
address=/aliyunxin.com/0.0.0.0
address=/amazingmagics.com/0.0.0.0
address=/aralego.com/0.0.0.0
address=/at98.com/0.0.0.0
address=/cangnews.com/0.0.0.0
address=/caob5.info/0.0.0.0
address=/cb.baidu.com/0.0.0.0
address=/cbjs.baidu.com/0.0.0.0
address=/cnxad.net/0.0.0.0
address=/cnzz.com.so/0.0.0.0
address=/code668.com/0.0.0.0
address=/cpcv.cc/0.0.0.0
address=/cpms.cc/0.0.0.0
address=/cpro.baidu.com/0.0.0.0
address=/cpro.baidustatic.com/0.0.0.0
address=/cpv6.com/0.0.0.0
address=/cpva.cc/0.0.0.0
address=/crdrjs.info/0.0.0.0
address=/csqiulong.com/0.0.0.0
address=/ctsywy.com/0.0.0.0
address=/cyacc.com/0.0.0.0
address=/czpush.com/0.0.0.0
address=/dashet.com/0.0.0.0
address=/datafastguru.info/0.0.0.0
address=/dou777.com/0.0.0.0
address=/drmcmm.baidu.com/0.0.0.0
address=/duiwai.baidu.com/0.0.0.0
address=/dvr8.com/0.0.0.0
address=/dw998.com/0.0.0.0
address=/dxssiyi.com/0.0.0.0
address=/e701.net/0.0.0.0
address=/e70123.com/0.0.0.0
address=/e708.net/0.0.0.0
address=/e719.net/0.0.0.0
address=/ecuc123.net/0.0.0.0
address=/eiv.baidu.com/0.0.0.0
address=/f1190.com/0.0.0.0
address=/f6ce.com/0.0.0.0
address=/f70123.com/0.0.0.0
address=/fd7c.com/0.0.0.0
address=/fjmeyer.com/0.0.0.0
address=/fu68.com/0.0.0.0
address=/fv99.com/0.0.0.0
address=/gf108.com/0.0.0.0
address=/gf1352.com/0.0.0.0
address=/gm682.com/0.0.0.0
address=/guduopu.com/0.0.0.0
address=/gzmjnx.cn/0.0.0.0
address=/gzqudou.com/0.0.0.0
address=/hao123rt.com/0.0.0.0
address=/haohaowan8.com/0.0.0.0
address=/haolew.com/0.0.0.0
address=/hfjuki.com/0.0.0.0
address=/hmp33.com/0.0.0.0
address=/hr44.com/0.0.0.0
address=/humanding.com/0.0.0.0
address=/i3818.com/0.0.0.0
address=/ihualun.com/0.0.0.0
address=/img80.net/0.0.0.0
address=/jczzjx.com/0.0.0.0
address=/jdlhg.com/0.0.0.0
address=/jhzl001.com/0.0.0.0
address=/jiyou2014.com/0.0.0.0
address=/jk939.com/0.0.0.0
address=/jlssbz.com/0.0.0.0
address=/jnrsjm.com/0.0.0.0
address=/johtzj.com/0.0.0.0
address=/jwqj.net/0.0.0.0
address=/jxjzny.com/0.0.0.0
address=/keyyou.net/0.0.0.0
address=/kingwam.com/0.0.0.0
address=/kmadou.com/0.0.0.0
address=/ku9377.com/0.0.0.0
address=/lajizhan.org/0.0.0.0
address=/le4le.com/0.0.0.0
address=/lishuanghao.com/0.0.0.0
address=/lzmm8.com/0.0.0.0
address=/mainbx.com/0.0.0.0
address=/mathads.com/0.0.0.0
address=/mlt01.com/0.0.0.0
address=/moodoocrv.com.cn/0.0.0.0
address=/mscimg.com/0.0.0.0
address=/nextcps.com/0.0.0.0
address=/niuxgame77.com/0.0.0.0
address=/notice.uchome.manyou.com/0.0.0.0
address=/oikxlcv.wang/0.0.0.0
address=/okm918.com/0.0.0.0
address=/p3tt.com/0.0.0.0
address=/pdsjycm.com/0.0.0.0
address=/pos.baidu.com/0.0.0.0
address=/qiqiww.com/0.0.0.0
address=/qucaigg.com/0.0.0.0
address=/re.taotaosou.com/0.0.0.0
address=/ruxianke.com/0.0.0.0
address=/rwjfs.com/0.0.0.0
address=/sgbfjs.info/0.0.0.0
address=/sharedaddomain.com/0.0.0.0
address=/show.kc.taotaosou.com/0.0.0.0
address=/si9377.com/0.0.0.0
address=/socdm.com/0.0.0.0
address=/spcode.baidu.com/0.0.0.0
address=/sstc360.com/0.0.0.0
address=/t70123.com/0.0.0.0
address=/taat00889.com/0.0.0.0
address=/tad.suning.com/0.0.0.0
address=/tc600.com/0.0.0.0
address=/tdayi.com/0.0.0.0
address=/tg.1155t.cn/0.0.0.0
address=/toourbb.com/0.0.0.0
address=/ubmcmm.baidustatic.com/0.0.0.0
address=/uoyrsd.com/0.0.0.0
address=/v707070.com/0.0.0.0
address=/victorjx.com/0.0.0.0
address=/w65p.com/0.0.0.0
address=/wdzsb.com.cn/0.0.0.0
address=/winvestern.com.cn/0.0.0.0
address=/wqsph.net/0.0.0.0
address=/ws341.com/0.0.0.0
address=/xa9t.com/0.0.0.0
address=/xabaitai.com/0.0.0.0
address=/xchgx.com/0.0.0.0
address=/xcy8.com/0.0.0.0
address=/xtxa.net/0.0.0.0
address=/xxad.cc/0.0.0.0
address=/xzyituo.com/0.0.0.0
address=/yk0712.com/0.0.0.0
address=/ymcqb.com/0.0.0.0
address=/yqw88.com/0.0.0.0
address=/yule8.net/0.0.0.0
address=/yyp17.com/0.0.0.0
address=/zgksb.com/0.0.0.0
address=/zgunion.cn/0.0.0.0
address=/zp22938576.com/0.0.0.0
address=/120.27.34.156/0.0.0.0
address=/122.228.236.165/0.0.0.0
address=/125.46.61.28/0.0.0.0
address=/192.184.10.171/0.0.0.0
address=/218.65.30.232/0.0.0.0
address=/27.255.67.120/0.0.0.0
address=/32345sf.com/0.0.0.0
address=/360safego.com/0.0.0.0
address=/3dm.huya.com/0.0.0.0
address=/5y9nfpes.52pk.com/0.0.0.0
address=/654mmm.com/0.0.0.0
address=/6d245gxt.52pk.com/0.0.0.0
address=/7mad.7m.cn/0.0.0.0
address=/801.tianyaui.com/0.0.0.0
address=/86file.megajoy.com/0.0.0.0
address=/8jkx.com/0.0.0.0
address=/96.43.97.243/0.0.0.0
address=/a-m-s.poco.cn/0.0.0.0
address=/a.baomihua.com/0.0.0.0
address=/a.xizi.com/0.0.0.0
address=/a2.b310.com/0.0.0.0
address=/a4.yeshj.com/0.0.0.0
address=/a5.yeshj.com/0.0.0.0
address=/a6.hujiang.com/0.0.0.0
address=/abc.hkepc.com/0.0.0.0
address=/acsystem.wasu.cn/0.0.0.0
address=/ad.17173.com/0.0.0.0
address=/ad.bjmama.net/0.0.0.0
address=/adadmin.house365.com/0.0.0.0
address=/add.dz19.net/0.0.0.0
address=/adf.dahe.cn/0.0.0.0
address=/adhome.1fangchan.com/0.0.0.0
address=/adk.funshion.com/0.0.0.0
address=/adm.265g.com/0.0.0.0
address=/adm.72zx.com/0.0.0.0
address=/adm.86wan.com/0.0.0.0
address=/adm.bbcss.com/0.0.0.0
address=/adm.funshion.com/0.0.0.0
address=/adm.jjj8.cn/0.0.0.0
address=/adm.qzbbs.com/0.0.0.0
address=/adm.xmfish.com/0.0.0.0
address=/adm.zbinfo.net/0.0.0.0
address=/adm.zzfish.cn/0.0.0.0
address=/admd.yam.com/0.0.0.0
address=/adnetpub.yaolan.com/0.0.0.0
address=/adp.cnool.net/0.0.0.0
address=/adpub.yaolan.com/0.0.0.0
address=/adpubs.yaolan.com/0.0.0.0
address=/adsclick.yx.js.cn/0.0.0.0
address=/adspending01.bwnet.com.tw/0.0.0.0
address=/afp.chinanews.com/0.0.0.0
address=/afp.wasu.cn/0.0.0.0
address=/afpcreative.wasu.cn/0.0.0.0
address=/ai.bioon.com/0.0.0.0
address=/aid.chinayk.com/0.0.0.0
address=/am.6park.com/0.0.0.0
address=/am.szhome.com/0.0.0.0
address=/app.acm.dzwww.com/0.0.0.0
address=/as.sinahk.net/0.0.0.0
address=/ashow.pcpop.com/0.0.0.0
address=/bb345.com/0.0.0.0
address=/besc.baidustatic.com/0.0.0.0
address=/biz.gexing.com/0.0.0.0
address=/biz.weibo.com/0.0.0.0
address=/btn.onlylady.com/0.0.0.0
address=/btn.pchome.net/0.0.0.0
address=/business.92wy.com/0.0.0.0
address=/by.7avz.com/0.0.0.0
address=/cacafly.net/0.0.0.0
address=/cachead.com/0.0.0.0
address=/cdn.wdlm.cn/0.0.0.0
address=/chidir.com/0.0.0.0
address=/cps.okbuy.com/0.0.0.0
address=/d.107788.com/0.0.0.0
address=/d.taomato.com/0.0.0.0
address=/d0.xcar.com.cn/0.0.0.0
address=/dd.xdnice.com/0.0.0.0
address=/de.as.pptv.com/0.0.0.0
address=/dfad.dfdaily.com/0.0.0.0
address=/dg.073img.com/0.0.0.0
address=/doubleclick.tv002.com/0.0.0.0
address=/dvs.china.com/0.0.0.0
address=/dvser.china.com/0.0.0.0
address=/e.yycqc.com/0.0.0.0
address=/eap.big5.enorth.com.cn/0.0.0.0
address=/eap.enorth.com.cn/0.0.0.0
address=/ebp.renren.com/0.0.0.0
address=/ecma.bdimg.com/0.0.0.0
address=/ecmb.bdimg.com/0.0.0.0
address=/fun.ynet.com/0.0.0.0
address=/g.gxorg.com/0.0.0.0
address=/g.hsw.cn/0.0.0.0
address=/g.ousns.net/0.0.0.0
address=/g1.0573ren.com/0.0.0.0
address=/g2.ousns.net/0.0.0.0
address=/ganjituiguang.ganji.com/0.0.0.0
address=/gdt.qq.com/0.0.0.0
address=/get.766.com/0.0.0.0
address=/gg.0598yu.com/0.0.0.0
address=/gg.18183.com/0.0.0.0
address=/gg.cs090.com/0.0.0.0
address=/gg.gao7.com/0.0.0.0
address=/gg.kugou.com/0.0.0.0
address=/gg.sonhoo.com/0.0.0.0
address=/gg.yxdown.com/0.0.0.0
address=/ggg.zj.com/0.0.0.0
address=/ggw.gusuwang.com/0.0.0.0
address=/ggw.watertu.com/0.0.0.0
address=/ggyq.xdkb.net/0.0.0.0
address=/go.hangzhou.com.cn/0.0.0.0
address=/goto.www.iciba.com/0.0.0.0
address=/gqgc.sz.zj.cn/0.0.0.0
address=/groupa.onlylady.com/0.0.0.0
address=/gsspcln.jp/0.0.0.0
address=/gt.yy.com/0.0.0.0
address=/guess.h.qhimg.com/0.0.0.0
address=/haxiu.miaotiao.com/0.0.0.0
address=/hdad.baike.com/0.0.0.0
address=/hiad.vmall.com/0.0.0.0
address=/hz.shouyoutv.com/0.0.0.0
address=/hzhyhm.com/0.0.0.0
address=/i.syasn.com/0.0.0.0
address=/iads.xinmin.cn/0.0.0.0
address=/idcot.com/0.0.0.0
address=/ifx.aifang.com/0.0.0.0
address=/image.6park.com/0.0.0.0
address=/image.9duw.com/0.0.0.0
address=/image.hh010.com/0.0.0.0
address=/image.lepan.cc/0.0.0.0
address=/images.chinaz.com/0.0.0.0
address=/images.gxsky.com/0.0.0.0
address=/img.3sjt.com/0.0.0.0
address=/img.9duw.com/0.0.0.0
address=/img1.126.net/0.0.0.0
address=/img2.126.net/0.0.0.0
address=/img2.www.fmdisk.com/0.0.0.0
address=/inte.sogou.com/0.0.0.0
address=/iwanad.baidu.com/0.0.0.0
address=/j.6avz.com/0.0.0.0
address=/j.7avz.com/0.0.0.0
address=/ja.gamersky.com/0.0.0.0
address=/jmsyzj.com/0.0.0.0
address=/js-1.pchome.net/0.0.0.0
address=/js.duotegame.com/0.0.0.0
address=/js.leshen.com/0.0.0.0
address=/js.pub.tom.com/0.0.0.0
address=/js.youxi369.com/0.0.0.0
address=/jxad.jx163.com/0.0.0.0
address=/knnwdyou.com/0.0.0.0
address=/leiqun.snxyf.com/0.0.0.0
address=/life.e0575.com/0.0.0.0
address=/lingdian98.com/0.0.0.0
address=/link.fobshanghai.com/0.0.0.0
address=/lxting.com/0.0.0.0
address=/m.aty.sohu.com/0.0.0.0
address=/manads.static.olcdn.com/0.0.0.0
address=/manage.wdfans.cn/0.0.0.0
address=/market.178.com/0.0.0.0
address=/market.21cn.com/0.0.0.0
address=/market.duowan.com/0.0.0.0
address=/media.cheshi-img.com/0.0.0.0
address=/money.qz828.com/0.0.0.0
address=/myad.toocle.com/0.0.0.0
address=/ok.432kkk.com/0.0.0.0
address=/p.szonline.net/0.0.0.0
address=/p.zol-img.com.cn/0.0.0.0
address=/p4p.sina.com.cn/0.0.0.0
address=/p8u.hinet.net/0.0.0.0
address=/panda.kdnet.net/0.0.0.0
address=/pcs1.app.joy.cn/0.0.0.0
address=/phpad.cqnews.net/0.0.0.0
address=/pic.0597kk.com/0.0.0.0
address=/pic.111cn.net/0.0.0.0
address=/pic.2u.com.cn/0.0.0.0
address=/pic.ea3w.com/0.0.0.0
address=/pic.fengniao.com/0.0.0.0
address=/pic.taian.com/0.0.0.0
address=/pic.xgo-img.com.cn/0.0.0.0
address=/playad.xjmg.com/0.0.0.0
address=/poster.weather.com.cn/0.0.0.0
address=/pp.7060.la/0.0.0.0
address=/pro.iweihai.cn/0.0.0.0
address=/pub.funshion.com/0.0.0.0
address=/pub.mop.com/0.0.0.0
address=/publicize.liao1.com/0.0.0.0
address=/publish.ad.youth.cn/0.0.0.0
address=/res.hunantv.com/0.0.0.0
address=/rh.qq.com/0.0.0.0
address=/same.chinadaily.com.cn/0.0.0.0
address=/same.eastmoney.com/0.0.0.0
address=/same.stockstar.com/0.0.0.0
address=/sc.tom.com/0.0.0.0
address=/sgg.southcn.com/0.0.0.0
address=/share.gzdsw.com/0.0.0.0
address=/shenleyuni.com/0.0.0.0
address=/shows.21cn.com/0.0.0.0
address=/so.6949.com/0.0.0.0
address=/sss.sege.xxx/0.0.0.0
address=/static.yujiehenaishang.com/0.0.0.0
address=/sub.powerapple.com/0.0.0.0
address=/super.cat898.com/0.0.0.0
address=/super.kdnet.net/0.0.0.0
address=/synacast.com/0.0.0.0
address=/tf.360.cn/0.0.0.0
address=/tg.delnapb.com/0.0.0.0
address=/tk.504pk.com/0.0.0.0
address=/tp.sgcn.com/0.0.0.0
address=/u.63kc.com/0.0.0.0
address=/u.cnzol.com/0.0.0.0
address=/union.china.com.cn/0.0.0.0
address=/untitled.dwstatic.com/0.0.0.0
address=/up.hiao.com/0.0.0.0
address=/v-56.com/0.0.0.0
address=/vas.funshion.com/0.0.0.0
address=/vupload.duowan.com/0.0.0.0
address=/web.900.la/0.0.0.0
address=/xc.macd.cn/0.0.0.0
address=/xs.houyi.baofeng.net/0.0.0.0
address=/yktj.yzz.cn/0.0.0.0
address=/zo66.com/0.0.0.0
address=/zt2088.com/0.0.0.0
address=/146.148.85.61/0.0.0.0
address=/hdapp1003-a.akamaihd.net/0.0.0.0
address=/hdapp1008-a.akamaihd.net/0.0.0.0
address=/hdsrc-a.akamaihd.net/0.0.0.0
address=/46.165.197.153/0.0.0.0
address=/46.165.197.231/0.0.0.0
address=/74.117.182.77/0.0.0.0
address=/78.140.131.214/0.0.0.0
address=/clkrev.com/0.0.0.0
address=/a.livesportmedia.eu/0.0.0.0
address=/a.ucoz.net/0.0.0.0
address=/a.watershed-publishing.com/0.0.0.0
address=/a04296f070c0146f314d-0dcad72565cb350972beb3666a86f246.r50.cf5.rackcdn.com/0.0.0.0
address=/ad.about.co.kr/0.0.0.0
address=/ad.accessmediaproductions.com/0.0.0.0
address=/ad.bitmedia.io/0.0.0.0
address=/ad.flux.com/0.0.0.0
address=/ad.foxnetworks.com/0.0.0.0
address=/ad.icasthq.com/0.0.0.0
address=/ad.idgtn.net/0.0.0.0
address=/ad.jamba.net/0.0.0.0
address=/ad.livere.co.kr/0.0.0.0
address=/ad.mail.ru/0.0.0.0
address=/ad.mesomorphosis.com/0.0.0.0
address=/ad.openmultimedia.biz/0.0.0.0
address=/ad.outsidehub.com/0.0.0.0
address=/ad.pickple.net/0.0.0.0
address=/ad.proxy.sh/0.0.0.0
address=/ad.r.worldssl.net/0.0.0.0
address=/ad.rambler.ru/0.0.0.0
address=/ad.reklamport.com/0.0.0.0
address=/ad.sensismediasmart.com.au/0.0.0.0
address=/ad.smartclip.net/0.0.0.0
address=/ad.spielothek.so/0.0.0.0
address=/ad.vidaroo.com/0.0.0.0
address=/ad.winningpartner.com/0.0.0.0
address=/add.bugun.com.tr/0.0.0.0
address=/adingo.jp.eimg.jp/0.0.0.0
address=/adn.ebay.com/0.0.0.0
address=/adplus.goo.mx/0.0.0.0
address=/ads.mp.mydas.mobi/0.0.0.0
address=/adscaspion.appspot.com/0.0.0.0
address=/adss.dotdo.net/0.0.0.0
address=/adz.zwee.ly/0.0.0.0
address=/aff.eteachergroup.com/0.0.0.0
address=/aff.marathonbet.com/0.0.0.0
address=/aff.svjump.com/0.0.0.0
address=/affil.mupromo.com/0.0.0.0
address=/affiliateprogram.keywordspy.com/0.0.0.0
address=/affiliates.allposters.com/0.0.0.0
address=/affiliatesmedia.sbobet.com/0.0.0.0
address=/affiliation.fotovista.com/0.0.0.0
address=/agenda.complex.com/0.0.0.0
address=/airpushmarketing.s3.amazonaws.com/0.0.0.0
address=/ais.abacast.com/0.0.0.0
address=/analytics.disneyinternational.com/0.0.0.0
address=/ard.ihookup.com/0.0.0.0
address=/award.sitekeuring.net/0.0.0.0
address=/b.babylon.com/0.0.0.0
address=/b.livesport.eu/0.0.0.0
address=/b92.putniktravel.com/0.0.0.0
address=/banner.101xp.com/0.0.0.0
address=/banner.3ddownloads.com/0.0.0.0
address=/banner.europacasino.com/0.0.0.0
address=/banner.telefragged.com/0.0.0.0
address=/banner.titancasino.com/0.0.0.0
address=/bl.wavecdn.de/0.0.0.0
address=/blamads-assets.s3.amazonaws.com/0.0.0.0
address=/bluhostedbanners.blucigs.com/0.0.0.0
address=/box.anchorfree.net/0.0.0.0
address=/btr.domywife.com/0.0.0.0
address=/c.netu.tv/0.0.0.0
address=/cas.clickability.com/0.0.0.0
address=/cash.neweramediaworks.com/0.0.0.0
address=/cerebral.typn.com/0.0.0.0
address=/cjmooter.xcache.kinxcdn.com/0.0.0.0
address=/clarity.abacast.com/0.0.0.0
address=/click.eyk.net/0.0.0.0
address=/clickstrip.6wav.es/0.0.0.0
address=/connect.summit.co.uk/0.0.0.0
address=/content.livesportmedia.eu/0.0.0.0
address=/cpm.amateurcommunity.de/0.0.0.0
address=/creatives.inmotionhosting.com/0.0.0.0
address=/creatives.summitconnect.co.uk/0.0.0.0
address=/d13czkep7ax7nj.cloudfront.net/0.0.0.0
address=/d140sbu1b1m3h0.cloudfront.net/0.0.0.0
address=/d15565yqt7pv7r.cloudfront.net/0.0.0.0
address=/d15gt9gwxw5wu0.cloudfront.net/0.0.0.0
address=/d17f2fxw547952.cloudfront.net/0.0.0.0
address=/d19972r8wdpby8.cloudfront.net/0.0.0.0
address=/d1ade4ciw4bqyc.cloudfront.net/0.0.0.0
address=/d1cl1sqtf3o420.cloudfront.net/0.0.0.0
address=/d1d95giojjkirt.cloudfront.net/0.0.0.0
address=/d1ep3cn6qx0l3z.cloudfront.net/0.0.0.0
address=/d1ey3fksimezm4.cloudfront.net/0.0.0.0
address=/d1fo96xm8fci0r.cloudfront.net/0.0.0.0
address=/d1gojtoka5qi10.cloudfront.net/0.0.0.0
address=/d1k74lgicilrr3.cloudfront.net/0.0.0.0
address=/d1noellhv8fksc.cloudfront.net/0.0.0.0
address=/d1pcttwib15k25.cloudfront.net/0.0.0.0
address=/d1pdpbxj733bb1.cloudfront.net/0.0.0.0
address=/d1spb7fplenrp4.cloudfront.net/0.0.0.0
address=/d1vbm0eveofcle.cloudfront.net/0.0.0.0
address=/d1zgderxoe1a.cloudfront.net/0.0.0.0
address=/d23guct4biwna6.cloudfront.net/0.0.0.0
address=/d23nyyb6dc29z6.cloudfront.net/0.0.0.0
address=/d25ruj6ht8bs1.cloudfront.net/0.0.0.0
address=/d25xkbr68qqtcn.cloudfront.net/0.0.0.0
address=/d26dzd2k67we08.cloudfront.net/0.0.0.0
address=/d26j9bp9bq4uhd.cloudfront.net/0.0.0.0
address=/d26wy0pxd3qqpv.cloudfront.net/0.0.0.0
address=/d27jt7xr4fq3e8.cloudfront.net/0.0.0.0
address=/d287x05ve9a63s.cloudfront.net/0.0.0.0
address=/d29r6igjpnoykg.cloudfront.net/0.0.0.0
address=/d2anfhdgjxf8s1.cloudfront.net/0.0.0.0
address=/d2b2x1ywompm1b.cloudfront.net/0.0.0.0
address=/d2b65ihpmocv7w.cloudfront.net/0.0.0.0
address=/d2bgg7rjywcwsy.cloudfront.net/0.0.0.0
address=/d2cxkkxhecdzsq.cloudfront.net/0.0.0.0
address=/d2d2lbvq8xirbs.cloudfront.net/0.0.0.0
address=/d2dxgm96wvaa5j.cloudfront.net/0.0.0.0
address=/d2gpgaupalra1d.cloudfront.net/0.0.0.0
address=/d2gtlljtkeiyzd.cloudfront.net/0.0.0.0
address=/d2gz6iop9uxobu.cloudfront.net/0.0.0.0
address=/d2hap2bsh1k9lw.cloudfront.net/0.0.0.0
address=/d2ipklohrie3lo.cloudfront.net/0.0.0.0
address=/d2mic0r0bo3i6z.cloudfront.net/0.0.0.0
address=/d2mq0uzafv8ytp.cloudfront.net/0.0.0.0
address=/d2nlytvx51ywh9.cloudfront.net/0.0.0.0
address=/d2o307dm5mqftz.cloudfront.net/0.0.0.0
address=/d2oallm7wrqvmi.cloudfront.net/0.0.0.0
address=/d2omcicc3a4zlg.cloudfront.net/0.0.0.0
address=/d2pgy8h4i30on1.cloudfront.net/0.0.0.0
address=/d2plxos94peuwp.cloudfront.net/0.0.0.0
address=/d2r359adnh3sfn.cloudfront.net/0.0.0.0
address=/d2s64zaa9ua7uv.cloudfront.net/0.0.0.0
address=/d2tgev5wuprbqq.cloudfront.net/0.0.0.0
address=/d2tnimpzlb191i.cloudfront.net/0.0.0.0
address=/d2ubicnllnnszy.cloudfront.net/0.0.0.0
address=/d2ue9k1rhsumed.cloudfront.net/0.0.0.0
address=/d2v4glj2m8yzg5.cloudfront.net/0.0.0.0
address=/d2v9ajh2eysdau.cloudfront.net/0.0.0.0
address=/d2vt6q0n0iy66w.cloudfront.net/0.0.0.0
address=/d2yhukq7vldf1u.cloudfront.net/0.0.0.0
address=/d2z1smm3i01tnr.cloudfront.net/0.0.0.0
address=/d31807xkria1x4.cloudfront.net/0.0.0.0
address=/d32pxqbknuxsuy.cloudfront.net/0.0.0.0
address=/d33f10u0pfpplc.cloudfront.net/0.0.0.0
address=/d33otidwg56k90.cloudfront.net/0.0.0.0
address=/d34obr29voew8l.cloudfront.net/0.0.0.0
address=/d34rdvn2ky3gnm.cloudfront.net/0.0.0.0
address=/d37kzqe5knnh6t.cloudfront.net/0.0.0.0
address=/d38pxm3dmrdu6d.cloudfront.net/0.0.0.0
address=/d38r21vtgndgb1.cloudfront.net/0.0.0.0
address=/d39xqloz8t5a6x.cloudfront.net/0.0.0.0
address=/d3bvcf24wln03d.cloudfront.net/0.0.0.0
address=/d3dphmosjk9rot.cloudfront.net/0.0.0.0
address=/d3f9mcik999dte.cloudfront.net/0.0.0.0
address=/d3fzrm6pcer44x.cloudfront.net/0.0.0.0
address=/d3irruagotonpp.cloudfront.net/0.0.0.0
address=/d3iwjrnl4m67rd.cloudfront.net/0.0.0.0
address=/d3lvr7yuk4uaui.cloudfront.net/0.0.0.0
address=/d3lzezfa753mqu.cloudfront.net/0.0.0.0
address=/d3m41swuqq4sv5.cloudfront.net/0.0.0.0
address=/d3nvrqlo8rj1kw.cloudfront.net/0.0.0.0
address=/d3p9ql8flgemg7.cloudfront.net/0.0.0.0
address=/d3pkae9owd2lcf.cloudfront.net/0.0.0.0
address=/d3q2dpprdsteo.cloudfront.net/0.0.0.0
address=/d3qszud4qdthr8.cloudfront.net/0.0.0.0
address=/d3t2wca0ou3lqz.cloudfront.net/0.0.0.0
address=/d3t9ip55bsuxrf.cloudfront.net/0.0.0.0
address=/d3tdefw8pwfkbk.cloudfront.net/0.0.0.0
address=/d3vc1nm9xbncz5.cloudfront.net/0.0.0.0
address=/d5pvnbpawsaav.cloudfront.net/0.0.0.0
address=/d6bdy3eto8fyu.cloudfront.net/0.0.0.0
address=/d8qy7md4cj3gz.cloudfront.net/0.0.0.0
address=/dal9hkyfi0m0n.cloudfront.net/0.0.0.0
address=/dart.clearchannel.com/0.0.0.0
address=/dasfdasfasdf.no-ip.info/0.0.0.0
address=/data.neuroxmedia.com/0.0.0.0
address=/dbam.dashbida.com/0.0.0.0
address=/ddwht76d9jvfl.cloudfront.net/0.0.0.0
address=/dew9ckzjyt2gn.cloudfront.net/0.0.0.0
address=/dff7tx5c2qbxc.cloudfront.net/0.0.0.0
address=/display.digitalriver.com/0.0.0.0
address=/disy2s34euyqm.cloudfront.net/0.0.0.0
address=/dizixdllzznrf.cloudfront.net/0.0.0.0
address=/djlf5xdlz7m8m.cloudfront.net/0.0.0.0
address=/dkd69bwkvrht1.cloudfront.net/0.0.0.0
address=/dkdwv3lcby5zi.cloudfront.net/0.0.0.0
address=/dl392qndlveq0.cloudfront.net/0.0.0.0
address=/dl5v5atodo7gn.cloudfront.net/0.0.0.0
address=/dlupv9uqtjlie.cloudfront.net/0.0.0.0
address=/dm0acvguygm9h.cloudfront.net/0.0.0.0
address=/dm8srf206hien.cloudfront.net/0.0.0.0
address=/dp51h10v6ggpa.cloudfront.net/0.0.0.0
address=/dpsq2uzakdgqz.cloudfront.net/0.0.0.0
address=/dq2tgxnc2knif.cloudfront.net/0.0.0.0
address=/dqhi3ea93ztgv.cloudfront.net/0.0.0.0
address=/dr8pk6ovub897.cloudfront.net/0.0.0.0
address=/duct5ntjian71.cloudfront.net/0.0.0.0
address=/dvf2u7vwmkr5w.cloudfront.net/0.0.0.0
address=/dvt4pepo9om3r.cloudfront.net/0.0.0.0
address=/dx5qvhwg92mjd.cloudfront.net/0.0.0.0
address=/dxq6c0tx3v6mm.cloudfront.net/0.0.0.0
address=/dxqd86uz345mg.cloudfront.net/0.0.0.0
address=/dy48bnzanqw0v.cloudfront.net/0.0.0.0
address=/dycpc40hvg4ki.cloudfront.net/0.0.0.0
address=/dyl3p6so5yozo.cloudfront.net/0.0.0.0
address=/epowernetworktrackerimages.s3.amazonaws.com/0.0.0.0
address=/euwidget.imshopping.com/0.0.0.0
address=/events.kalooga.com/0.0.0.0
address=/ext.theglobalweb.com/0.0.0.0
address=/feeds.logicbuy.com/0.0.0.0
address=/ft.pnop.com/0.0.0.0
address=/gateway.fortunelounge.com/0.0.0.0
address=/gateways.s3.amazonaws.com/0.0.0.0
address=/geo.connexionsecure.com/0.0.0.0
address=/geobanner.friendfinder.com/0.0.0.0
address=/geobanner.passion.com/0.0.0.0
address=/gfaf-banners.s3.amazonaws.com/0.0.0.0
address=/homad-global-configs.schneevonmorgen.com/0.0.0.0
address=/im.ov.yahoo.co.jp/0.0.0.0
address=/ima3vpaid.appspot.com/0.0.0.0
address=/indieclick.3janecdn.com/0.0.0.0
address=/inskin.vo.llnwd.net/0.0.0.0
address=/k2team.kyiv.ua/0.0.0.0
address=/mads.aol.com/0.0.0.0
address=/marketing.888.com/0.0.0.0
address=/mb.zam.com/0.0.0.0
address=/mozo-widgets.f2.com.au/0.0.0.0
address=/network.aufeminin.com/0.0.0.0
address=/network.business.com/0.0.0.0
address=/oclasrv.comindex-2.htmlapu.php/0.0.0.0
address=/odin.goo.mx/0.0.0.0
address=/on.maxspeedcdn.com/0.0.0.0
address=/ox-i.cordillera.tv/0.0.0.0
address=/partner.bargaindomains.com/0.0.0.0
address=/partner.catchy.com/0.0.0.0
address=/partner.premiumdomains.com/0.0.0.0
address=/partnerads.ysm.yahoo.com/0.0.0.0
address=/partnerads1.ysm.yahoo.com/0.0.0.0
address=/partners.fshealth.com/0.0.0.0
address=/partners.optiontide.com/0.0.0.0
address=/partners.rochen.com/0.0.0.0
address=/partners.sportingbet.com.au/0.0.0.0
address=/partners.vouchedfor.co.uk/0.0.0.0
address=/partners.xpertmarket.com/0.0.0.0
address=/priceinfo.comuv.com/0.0.0.0
address=/promos.fling.com/0.0.0.0
address=/promote.pair.com/0.0.0.0
address=/promotions.iasbet.com/0.0.0.0
address=/pub.betclick.com/0.0.0.0
address=/pubs.hiddennetwork.com/0.0.0.0
address=/rack.bauermedia.co.uk/0.0.0.0
address=/res3.feedsportal.com/0.0.0.0
address=/revealads.appspot.com/0.0.0.0
address=/rotabanner.kulichki.net/0.0.0.0
address=/rotator.tradetracker.net/0.0.0.0
address=/s-yoolk-banner-assets.yoolk.com/0.0.0.0
address=/s-yoolk-billboard-assets.yoolk.com/0.0.0.0
address=/secretmedia.s3.amazonaws.com/0.0.0.0
address=/servedby.keygamesnetwork.com/0.0.0.0
address=/sitescout-video-cdn.edgesuite.net/0.0.0.0
address=/slot.union.ucweb.com/0.0.0.0
address=/smart.styria-digital.com/0.0.0.0
address=/squarespace.evyy.net/0.0.0.0
address=/stats.hosting24.com/0.0.0.0
address=/stats.sitesuite.org/0.0.0.0
address=/stuff-nzwhistleout.s3.amazonaws.com/0.0.0.0
address=/survey.g.doubleclick.net/0.0.0.0
address=/syndication.jsadapi.com/0.0.0.0
address=/syndication1.viraladnetwork.net/0.0.0.0
address=/tap.more-results.net/0.0.0.0
address=/ti.tradetracker.net/0.0.0.0
address=/track.bcvcmedia.com/0.0.0.0
address=/twinplan.com/0.0.0.0
address=/vendor1.fitschigogerl.com/0.0.0.0
address=/web-jp.ad-v.jp/0.0.0.0
address=/whistleout.s3.amazonaws.com/0.0.0.0
address=/widget.crowdignite.com/0.0.0.0
address=/widget.kelkoo.com/0.0.0.0
address=/widget.raaze.com/0.0.0.0
address=/widget.searchschoolsnetwork.com/0.0.0.0
address=/widget.shopstyle.com.au/0.0.0.0
address=/widget.solarquotes.com.au/0.0.0.0
address=/widgets.realestate.com.au/0.0.0.0
address=/wtpn.twenga.co.uk/0.0.0.0
address=/wtpn.twenga.de/0.0.0.0
address=/yb.torchbrowser.com/0.0.0.0
address=/yeas.yahoo.co.jp/0.0.0.0
address=/zapads.zapak.com/0.0.0.0
address=/zeus.qj.net/0.0.0.0
address=/iadc.qwapi.com/0.0.0.0
address=/d1nmk7iw7hajjn.cloudfront.net/0.0.0.0
address=/ad.duga.jp/0.0.0.0
address=/ad.iloveinterracial.com/0.0.0.0
address=/ads.videosz.com/0.0.0.0
address=/affiliates.thrixxx.com/0.0.0.0
address=/ard.sweetdiscreet.com/0.0.0.0
address=/bannershotlink.perfectgonzo.com/0.0.0.0
address=/blaaaa12.googlecode.com/0.0.0.0
address=/br.blackfling.com/0.0.0.0
address=/br.fling.com/0.0.0.0
address=/br.realitykings.com/0.0.0.0
address=/cpm.amateurcommunity.com/0.0.0.0
address=/dailyvideo.securejoin.com/0.0.0.0
address=/desk.cmix.org/0.0.0.0
address=/feeds.videosz.com/0.0.0.0
address=/ff.nsg.org.ua/0.0.0.0
address=/freexxxvideoclip.aebn.net/0.0.0.0
address=/geo.cliphunter.com/0.0.0.0
address=/geo.frtya.com/0.0.0.0
address=/geobanner.adultfriendfinder.com/0.0.0.0
address=/geobanner.alt.com/0.0.0.0
address=/geobanner.socialflirt.com/0.0.0.0
address=/partners.pornerbros.com/0.0.0.0
address=/s1magnettvcom.maynemyltf.netdna-cdn.com/0.0.0.0
address=/surv.xbizmedia.com/0.0.0.0
address=/sweet.game-rust.ru/0.0.0.0
address=/widgets.comcontent.net/0.0.0.0
address=/widgetssec.cam-content.com/0.0.0.0
address=/a.cdngeek.net/0.0.0.0
address=/a.clipconverter.cc/0.0.0.0
address=/a.giantrealm.com/0.0.0.0
address=/a.i-sgcm.com/0.0.0.0
address=/a.kat.cr/0.0.0.0
address=/a.kickass.to/0.0.0.0
address=/a.lolwot.com/0.0.0.0
address=/ac2.msn.com/0.0.0.0
address=/access.njherald.com/0.0.0.0
address=/ad.cooks.com/0.0.0.0
address=/ad.digitimes.com.tw/0.0.0.0
address=/ad.directmirror.com/0.0.0.0
address=/ad.download.cnet.com/0.0.0.0
address=/ad.evozi.com/0.0.0.0
address=/ad.fnnews.com/0.0.0.0
address=/ad.jamster.com/0.0.0.0
address=/ad.lyricswire.com/0.0.0.0
address=/ad.mangareader.net/0.0.0.0
address=/ad.newegg.com/0.0.0.0
address=/ad.pandora.tv/0.0.0.0
address=/ad.reachlocal.com/0.0.0.0
address=/ad.search.ch/0.0.0.0
address=/ad.services.distractify.com/0.0.0.0
address=/adcitrus.com/0.0.0.0
address=/addirector.vindicosuite.com/0.0.0.0
address=/adds.weatherology.com/0.0.0.0
address=/adlink.shopsafe.co.nz/0.0.0.0
address=/admeta.vo.llnwd.net/0.0.0.0
address=/ads-rolandgarros.com/0.0.0.0
address=/ads.pof.com/0.0.0.0
address=/ads.yahoo.com/0.0.0.0
address=/ads.zynga.com/0.0.0.0
address=/adsatt.abcnews.starwave.com/0.0.0.0
address=/adsatt.espn.starwave.com/0.0.0.0
address=/adshare.freedocast.com/0.0.0.0
address=/adsor.openrunner.com/0.0.0.0
address=/adss.yahoo.com/0.0.0.0
address=/adstil.indiatimes.com/0.0.0.0
address=/adtest.theonion.com/0.0.0.0
address=/advertise.twitpic.com/0.0.0.0
address=/advice-ads-cdn.vice.com/0.0.0.0
address=/adx.kat.ph/0.0.0.0
address=/aff.lmgtfy.com/0.0.0.0
address=/ajnad.aljazeera.net/0.0.0.0
address=/amz.steamprices.com/0.0.0.0
address=/analytics.mmosite.com/0.0.0.0
address=/as.inbox.com/0.0.0.0
address=/asd.projectfreetv.so/0.0.0.0
address=/avpa.dzone.com/0.0.0.0
address=/b.localpages.com/0.0.0.0
address=/b.thefile.me/0.0.0.0
address=/ba.ccm2.net/0.0.0.0
address=/ba.kioskea.net/0.0.0.0
address=/banner.automotiveworld.com/0.0.0.0
address=/banner.itweb.co.za/0.0.0.0
address=/banners.beevpn.com/0.0.0.0
address=/banners.beted.com/0.0.0.0
address=/banners.clubworldgroup.com/0.0.0.0
address=/banners.expressindia.com/0.0.0.0
address=/banners.i-comers.com/0.0.0.0
address=/banners.itweb.co.za/0.0.0.0
address=/banners.playocio.com/0.0.0.0
address=/beap.gemini.yahoo.com/0.0.0.0
address=/bizanti.youwatch.org/0.0.0.0
address=/bnrs.ilm.ee/0.0.0.0
address=/bwp.theinsider.com.com/0.0.0.0
address=/cadvv.heraldm.com/0.0.0.0
address=/cadvv.koreaherald.com/0.0.0.0
address=/canvas.thenextweb.com/0.0.0.0
address=/click.livedoor.com/0.0.0.0
address=/clicks.superpages.com/0.0.0.0
address=/cnetwidget.creativemark.co.uk/0.0.0.0
address=/collector.viki.io/0.0.0.0
address=/creatives.livejasmin.com/0.0.0.0
address=/d.annarbor.com/0.0.0.0
address=/d.businessinsider.com/0.0.0.0
address=/d.gossipcenter.com/0.0.0.0
address=/d.thelocal.com/0.0.0.0
address=/dads.new.digg.com/0.0.0.0
address=/dailydeals.amarillo.com/0.0.0.0
address=/dailydeals.augustachronicle.com/0.0.0.0
address=/dailydeals.brainerddispatch.com/0.0.0.0
address=/dailydeals.lubbockonline.com/0.0.0.0
address=/dailydeals.onlineathens.com/0.0.0.0
address=/dailydeals.savannahnow.com/0.0.0.0
address=/dcad.watersoul.com/0.0.0.0
address=/deals.ledgertranscript.com/0.0.0.0
address=/digdug.divxnetworks.com/0.0.0.0
address=/display.superbay.net/0.0.0.0
address=/dontblockme.modaco.com/0.0.0.0
address=/ehow.com/media/ad.html/0.0.0.0
address=/eva.ucas.com/0.0.0.0
address=/fan.twitch.tv/0.0.0.0
address=/fimserve.ign.com/0.0.0.0
address=/findnsave.idahostatesman.com/0.0.0.0
address=/g.brothersoft.com/0.0.0.0
address=/gameads.digyourowngrave.com/0.0.0.0
address=/geoshopping.nzherald.co.nz/0.0.0.0
address=/get.thefile.me/0.0.0.0
address=/gfx.infomine.com/0.0.0.0
address=/green.virtual-nights.com/0.0.0.0
address=/hejban.youwatch.org/0.0.0.0
address=/ibanners.empoweredcomms.com.au/0.0.0.0
address=/iframe.travel.yahoo.com/0.0.0.0
address=/imads.rediff.com/0.0.0.0
address=/kat-ads.torrenticity.com/0.0.0.0
address=/keepthelighton.vpsboard.com/0.0.0.0
address=/kermit.macnn.com/0.0.0.0
address=/life.imagepix.org/0.0.0.0
address=/ll.a.hulu.com/0.0.0.0
address=/londonprivaterentals.standard.co.uk/0.0.0.0
address=/looky.hyves.org/0.0.0.0
address=/lw2.gamecopyworld.com/0.0.0.0
address=/mads.dailymail.co.uk/0.0.0.0
address=/marketingsolutions.yahoo.com/0.0.0.0
address=/mb.hockeybuzz.com/0.0.0.0
address=/mealsandsteals.sandiego6.com/0.0.0.0
address=/media-delivery.armorgames.com/0.0.0.0
address=/media-mgmt.armorgames.com/0.0.0.0
address=/mediamgr.ugo.com/0.0.0.0
address=/nest.youwatch.org/0.0.0.0
address=/netspidermm.indiatimes.com/0.0.0.0
address=/network.sofeminine.co.uk/0.0.0.0
address=/noram.srv.ysm.yahoo.com/0.0.0.0
address=/oas.autotrader.co.uk/0.0.0.0
address=/oas.skyscanner.net/0.0.0.0
address=/oasc07.citywire.co.uk/0.0.0.0
address=/oascentral.chron.com/0.0.0.0
address=/oascentral.hosted.ap.org/0.0.0.0
address=/oascentral.newsmax.com/0.0.0.0
address=/ox-d.rantsports.com/0.0.0.0
address=/ox-d.sbnation.com/0.0.0.0
address=/ox-d.wetransfer.com/0.0.0.0
address=/ox.furaffinity.net/0.0.0.0
address=/partners-z.com/0.0.0.0
address=/photo.net/equipment/pg-160/0.0.0.0
address=/player.1800coupon.com/0.0.0.0
address=/player.1stcreditrepairs.com/0.0.0.0
address=/player.800directories.com/0.0.0.0
address=/player.accoona.com/0.0.0.0
address=/player.alloutwedding.com/0.0.0.0
address=/player.insuranceandhealth.com/0.0.0.0
address=/pmm.people.com.cn/0.0.0.0
address=/pop-over.powered-by.justplayzone.com/0.0.0.0
address=/prerollads.ign.com/0.0.0.0
address=/promo.fileforum.com/0.0.0.0
address=/rad.microsoft.com/0.0.0.0
address=/rad.msn.com/0.0.0.0
address=/red.bayimg.net/0.0.0.0
address=/redvase.bravenet.com/0.0.0.0
address=/richmedia.yimg.com/0.0.0.0
address=/roia.com/0.0.0.0
address=/rpt.anchorfree.net/0.0.0.0
address=/searchignited.com/0.0.0.0
address=/sebar.thand.info/0.0.0.0
address=/shoppingpartners2.futurenet.com/0.0.0.0
address=/sponsors.s2ki.com/0.0.0.0
address=/sponsors.webosroundup.com/0.0.0.0
address=/srv.thespacereporter.com/0.0.0.0
address=/storewidget.pcauthority.com.au/0.0.0.0
address=/stream.heavenmedia.net/0.0.0.0
address=/tanzanite.infomine.com/0.0.0.0
address=/targetedinfo.com/0.0.0.0
address=/targetedtopic.com/0.0.0.0
address=/thejesperbay.com/0.0.0.0
address=/themis.yahoo.com/0.0.0.0
address=/tmcs.net/0.0.0.0
address=/tom.itv.com/0.0.0.0
address=/tracking.hostgator.com/0.0.0.0
address=/ua.badongo.com/0.0.0.0
address=/uimserv.net/0.0.0.0
address=/unicast.ign.com/0.0.0.0
address=/unicast.msn.com/0.0.0.0
address=/verdict.abc.go.com/0.0.0.0
address=/vice-ads-cdn.vice.com/0.0.0.0
address=/w.homes.yahoo.net/0.0.0.0
address=/webmaster.extabit.com/0.0.0.0
address=/widget.directory.dailycommercial.com/0.0.0.0
address=/x.castanet.net/0.0.0.0
address=/yea.uploadimagex.com/0.0.0.0
address=/yesbeby.whies.info/0.0.0.0
address=/yrt7dgkf.exashare.com/0.0.0.0
address=/ysm.yahoo.com/0.0.0.0
address=/zads.care2.com/0.0.0.0
address=/a.eporner.com/0.0.0.0
address=/a.heavy-r.com/0.0.0.0
address=/a.killergram-girls.com/0.0.0.0
address=/ad.eporner.com/0.0.0.0
address=/ad.slutload.com/0.0.0.0
address=/ad.thisav.com/0.0.0.0
address=/ad.userporn.com/0.0.0.0
address=/ads.xxxbunker.com/0.0.0.0
address=/affiliates.goodvibes.com/0.0.0.0
address=/banner1.pornhost.com/0.0.0.0
address=/banners.cams.com/0.0.0.0
address=/bob.crazyshit.com/0.0.0.0
address=/brcache.madthumbs.com/0.0.0.0
address=/creatives.cliphunter.com/0.0.0.0
address=/creatives.pichunter.com/0.0.0.0
address=/dot.eporner.com/0.0.0.0
address=/dot2.eporner.com/0.0.0.0
address=/exit.macandbumble.com/0.0.0.0
address=/lw1.cdmediaworld.com/0.0.0.0
address=/m2.xhamster.com/0.0.0.0
address=/partners.xhamster.com/0.0.0.0
address=/pr-static.empflix.com/0.0.0.0
address=/pr-static.tnaflix.com/0.0.0.0
address=/r.radikal.ru/0.0.0.0
address=/rev.fapdu.com/0.0.0.0
address=/site.img.4tube.com/0.0.0.0
address=/static.kinghost.com/0.0.0.0
address=/x.eroticity.net/0.0.0.0
address=/x.vipergirls.to/0.0.0.0

View File

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

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

View File

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

View File

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

View File

@ -0,0 +1,19 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for Aliddns
LUCI_DEPENDS:=+wget +openssl-util
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,4 @@
module("luci.controller.aliddns",package.seeall)
function index()
entry({"admin","services","aliddns"},cbi("aliddns"),_("Aliddns Client"),101)
end

View File

@ -0,0 +1,52 @@
local a=require"luci.sys"
local e=luci.model.uci.cursor()
local e=require"nixio.fs"
require("luci.sys")
local t,e,o
local m,s
t=Map("aliddns",translate("阿里DDNS客户端"),translate("基于阿里云解析的私人DDNS解决方案"))
e=t:section(TypedSection,"base")
e.anonymous=true
e:tab("basic", translate("设置"))
enable=e:taboption("basic",Flag,"enable",translate("开启"),translate("开启或关闭aliddns动态域名"))
enable.rmempty=false
token=e:taboption("basic",Value,"app_key",translate("APP KEY"))
email=e:taboption("basic",Value,"app_secret",translate("APP SECRET"))
iface=e:taboption("basic",ListValue,"interface",translate("选择外网接口"),translate("限定要动态aliddns的外网接口如pppoe-wan"))
iface:value("",translate("选择要动态更新的外网接口"))
for t,e in ipairs(a.net.devices())do
if e~="lo"then iface:value(e)end
end
iface.rmempty=false
main=e:taboption("basic",Value,"main_domain",translate("主域名"),"想要解析的主域名,例如:baidu.com")
main.rmempty=false
sub=e:taboption("basic",Value,"sub_domain",translate("子域名"),"想要解析的子域名,例如:test hehe")
sub.rmempty=false
time=e:taboption("basic",Value,"time",translate("检查时间"),"域名检查时间单位分钟范围1-59")
time.rmempty=false
e:tab("log", translate("更新记录"))
--e=t:section(TypedSection,"base",translate("更新记录"))
e.anonymous=true
local a="/var/log/aliddns.log"
tvlog=e:taboption("log",TextValue,"sylogtext")
tvlog.rows=14
tvlog.readonly="readonly"
tvlog.wrap="off"
function tvlog.cfgvalue(e,e)
sylogtext=""
if a and nixio.fs.access(a)then
sylogtext=luci.sys.exec("tail -n 100 %s"%a)
end
return sylogtext
end
tvlog.write=function(e,e,e)
end
local e=luci.http.formvalue("cbi.apply")
if e then
io.popen("/etc/init.d/aliddns restart")
end
return t

View File

@ -0,0 +1,4 @@
msgid "Aliddns Client"
msgstr "阿里DDNS客户端"

View File

@ -0,0 +1,10 @@
config base 'base'
option time '30'
option enable '0'
option app_key '1'
option app_secret '1'
option interface 'br-lan'
option main_domain '1.com'
option sub_domain '2'

View File

@ -0,0 +1,18 @@
#!/bin/sh /etc/rc.common
START=80
restart()
{
/usr/sbin/aliddns
}
start()
{
/usr/sbin/aliddns
}
stop()
{
/usr/sbin/aliddns
}

View File

@ -0,0 +1,5 @@
#!/bin/sh
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,126 @@
#!/bin/sh
aliddns_ak=`uci get aliddns.base.app_key 2>/dev/null`
aliddns_sk=`uci get aliddns.base.app_secret 2>/dev/null`
aliddns_record_id=`uci get aliddns.base.record_id 2>/dev/null`
time=`uci get aliddns.base.time 2>/dev/null`
aliddns_enable=`uci get aliddns.base.enable`
aliddns_domain=`uci get aliddns.base.main_domain 2>/dev/null`
aliddns_name=`uci get aliddns.base.sub_domain 2>/dev/null`
interface=`uci get aliddns.base.interface 2>/dev/null`
DATE=$(date +'%Y-%m-%d %H:%M:%S')
timestamp=`date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ"`
ip=$(ifconfig $interface 2> /dev/null | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null)
check_aliddns() {
#ip=`wget -qO- http://whatismyip.akamai.com/ 2>/dev/null`
current_ip=`nslookup $aliddns_name.$aliddns_domain | grep "Address 1"|tail -n1|cut -d' ' -f3 2>/dev/null`
echo "$DATE 当前路由IP: ${ip}" >> /var/log/aliddns.log
echo "$DATE 远程解析IP: ${current_ip}" >> /var/log/aliddns.log
if [ "$ip" = "$current_ip" ]
then
echo "$DATE IP未改变无需更新" >> /var/log/aliddns.log
exit 0
else
echo "$DATE 更新中..." >> /var/log/aliddns.log
fi
}
urlencode() {
# urlencode <string>
local length="${#1}"
i=0
out=""
for i in $(awk "BEGIN { for ( i=0; i<$length; i++ ) { print i; } }")
do
local c="${1:$i:1}"
case $c in
[a-zA-Z0-9._-]) out="$out$c" ;;
*) out="$out`printf '%%%02X' "'$c"`" ;;
esac
i=$(($i + 1))
done
echo -n $out
}
send_request() {
local args="AccessKeyId=$aliddns_ak&Action=$1&Format=json&$2&Version=2015-01-09"
local hash=$(urlencode $(echo -n "GET&%2F&$(urlencode $args)" | openssl dgst -sha1 -hmac "$aliddns_sk&" -binary | openssl base64))
wget -qO- "http://alidns.aliyuncs.com/?$args&Signature=$hash" 2> /dev/null
}
get_recordid() {
grep -Eo '"RecordId":"[0-9]+"' | cut -d':' -f2 | tr -d '"'
}
query_recordid() {
send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$aliddns_name.$aliddns_domain&Timestamp=$timestamp"
}
update_record() {
send_request "UpdateDomainRecord" "RR=$aliddns_name&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
}
add_record() {
send_request "AddDomainRecord&DomainName=$aliddns_domain" "RR=$aliddns_name&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
}
go_record() {
if [ "$aliddns_record_id" = "" ]
then
aliddns_record_id=`query_recordid | get_recordid`
fi
if [ "$aliddns_record_id" = "" ]
then
aliddns_record_id=`add_record | get_recordid`
echo "$DATE 添加 record $aliddns_record_id" >> /var/log/aliddns.log
else
update_record $aliddns_record_id
echo "$DATE 更新 record $aliddns_record_id" >> /var/log/aliddns.log
fi
# save to file
if [ "$aliddns_record_id" = "" ]; then
# failed
echo "$DATE : 更新出错,请检查设置!" >> /var/log/aliddns.log
exit 0
else
uci set aliddns.base.record_id=$aliddns_record_id
uci commit
echo "$DATE : 更新成功!($ip)" >> /var/log/aliddns.log
fi
}
#将执行脚本写入crontab定时运行
add_aliddns_cru(){
wirtecron=$(cat /etc/crontabs/root | grep "$time * * * *" | grep aliddns)
if [ -z "$wirtecron" ];then
sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1
echo "*/$time * * * * /usr/sbin/aliddns" >> /etc/crontabs/root
fi
}
#清除过多记录
clean_log(){
logrow=$(grep -c "" /var/log/aliddns.log)
if [ $logrow -ge 15 ];then
cat /dev/null > /var/log/aliddns.log
echo "$DATE Log条数超限清空处理" >> /var/log/aliddns.log
fi
}
#停止服务
stop_aliddns(){
#停掉cru里的任务
sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1
}
if [ "$aliddns_enable" != "1" ]; then
stop_aliddns
echo "$DATE : aliddns没有开启" >> /var/log/aliddns.log
else
clean_log
check_aliddns
go_record
add_aliddns_cru
fi

View File

@ -0,0 +1,15 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Amule
LUCI_DEPENDS:=+amule
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,160 @@
--[[
LuCI - Lua Configuration Interface - amule support
Copyright 2016 maz-1 <ohmygod19993@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
]]--
module("luci.controller.amule", package.seeall)
local uci = luci.model.uci.cursor()
local configdir = uci:get("amule", "main", "config_dir")
function index()
if not nixio.fs.access("/etc/config/amule") then
return
end
entry({"admin", "nas"}, firstchild(), "NAS", 45).dependent = false
local page = entry({"admin", "nas", "amule"}, cbi("amule"), _("aMule Settings"))
page.dependent = true
entry( {"admin", "nas", "amule", "logview"}, call("logread") ).leaf = true
entry( {"admin", "nas", "amule", "status"}, call("get_pid") ).leaf = true
entry( {"admin", "nas", "amule", "amulecmd"}, call("amulecmd") ).leaf = true
entry( {"admin", "nas", "amule", "startstop"}, post("startstop") ).leaf = true
entry( {"admin", "nas", "amule", "down_kad"}, post("down_kad") ).leaf = true
entry( {"admin", "nas", "amule", "down_ed2k"}, post("down_ed2k") ).leaf = true
end
-- called by XHR.get from detail_logview.htm
function logread()
-- read application settings
local uci = luci.model.uci.cursor()
local logdir = uci:get("amule", "main", "config_dir") or "/var/run/amule"
uci:unload("amule")
local ldata=nixio.fs.readfile(logdir .. "/logfile")
if not ldata or #ldata == 0 then
ldata="_nodata_"
end
luci.http.write(ldata)
end
-- called by XHR.get from detail_startstop.htm
function startstop()
local pid = get_pid(true)
if pid > 0 then
luci.sys.call("/etc/init.d/amule stop")
nixio.nanosleep(1) -- sleep a second
if nixio.kill(pid, 0) then -- still running
nixio.kill(pid, 9) -- send SIGKILL
end
pid = 0
else
luci.sys.call("/etc/init.d/amule start")
nixio.nanosleep(1) -- sleep a second
pid = tonumber(luci.sys.exec("pidof amuled")) or 0
if pid > 0 and not nixio.kill(pid, 0) then
pid = 0 -- process did not start
end
end
luci.http.write(tostring(pid)) -- HTTP needs string not number
end
function down_kad()
url = uci:get("amule", "main", "kad_nodes_url")
data_path = configdir .. "/nodes.dat"
proto = string.gsub(url, "://%S*", "")
proto_opt = ( proto == "https" ) and " --no-check-certificate" or ""
cmd = "wget -O /tmp/down_nodes.dat \"" .. url .. "\"" .. proto_opt ..
" && cat /tmp/down_nodes.dat > " .. "\"" .. data_path .. "\""
luci.sys.call(cmd)
end
function down_ed2k()
url = uci:get("amule", "main", "ed2k_servers_url")
data_path = configdir .. "/server.met"
proto = string.gsub(url, "://%S*", "")
proto_opt = ( proto == "https" ) and " --no-check-certificate" or ""
cmd = "wget -O /tmp/down_server.met \"" .. url .. "\"" .. proto_opt ..
" && cat /tmp/down_server.met > " .. "\"" .. data_path .. "\""
luci.sys.call(cmd)
end
-- called by XHR.poll from detail_startstop.htm
-- and from lua (with parameter "true")
function get_pid(from_lua)
local pid_amuled = tonumber(luci.sys.exec("pidof amuled")) or 0
local amuled_stat =false
if pid_amuled > 0 and not nixio.kill(pid_amuled, 0) then
pid_amuled = 0
end
if pid_amuled > 0 then
amuled_stat =true
else
amuled_stat =false
end
local pid_amuleweb = tonumber(luci.sys.exec("pidof amuleweb")) or 0
local amuleweb_stat = false
if pid_amuleweb > 0 and not nixio.kill(pid_amuleweb, 0) then
pid_amuleweb = 0
end
if pid_amuleweb > 0 then
amuleweb_stat =true
else
amuleweb_stat =false
end
local status = {
amuled = amuled_stat,
amuled_pid = pid_amuled,
amuleweb = amuleweb_stat
}
if from_lua then
return pid_amuled
else
luci.http.prepare_content("application/json")
luci.http.write_json(status)
end
end
function amulecmd()
local re =""
local rv = { }
local cmd = luci.http.formvalue("cmd")
local full_cmd = "HOME=\""..configdir.. "\" /usr/bin/amulecmd".." -c \""..cmd.."\" 2>&1"
local shellpipe = io.popen(full_cmd,"rw")
re = shellpipe:read("*a")
shellpipe:close()
if not re then
re=""
end
re = string.gsub(re, "This is amulecmd %S*\n", "")
re = string.gsub(re, "Creating client%S*\n", "")
re = string.gsub(re, "Succeeded! Connection established to aMule %S*\n", "")
re = string.gsub(re, "\n", "\r\n")
rv[#rv+1]=re
if #rv > 0 then
luci.http.prepare_content("application/json")
luci.http.write_json(rv)
return
end
luci.http.status(404, "No such device")
end

View File

@ -0,0 +1,456 @@
--[[
LuCI - Lua Configuration Interface - Aria2 support
Copyright 2016 maz-1 <ohmygod19993@gmail.com>
]]--
local sys = require "luci.sys"
local util = require "luci.util"
local uci = require "luci.model.uci".cursor()
ptype = {
"socks5",
"socks4",
"http",
"socks4a",
}
whocan = {
"anyone",
"friends",
"nobody",
}
function titlesplit(Value)
return "<p style=\"font-size:20px;font-weight:bold;color: DodgerBlue\">" .. translate(Value) .. "</p>"
end
m = Map("amule", translate("aMule"), translate("aMule is a ED2K/KAD client for all platforms.") .. "<br/><a href=\"https://github.com/maz-1\">luci interface by maz-1</a>")
m:section(SimpleSection).template = "amule/overview_status"
s = m:section(TypedSection, "amule", translate("aMule Settings"))
s.addremove = false
s.anonymous = true
s:tab("general", translate("General"))
s:tab("connection", translate("Connections"))
s:tab("server", translate("Server"))
s:tab("path_and_file", translate("Path And File"))
s:tab("security", translate("Security"))
s:tab("remote", translate("External Control"))
s:tab("template", translate("Edit Template"))
s:tab("logview", translate("Log File Viewer"))
s:tab("amulecmd", translate("aMule command"))
-- GENERAL --
o = s:taboption("general", Flag, "enabled", translate("Enabled"))
o.rmempty = false
user = s:taboption("general", ListValue, "runasuser", translate("Run daemon as user"))
local p_user
for _, p_user in util.vspairs(util.split(sys.exec("cat /etc/passwd | cut -f 1 -d :"))) do
user:value(p_user)
end
o = s:taboption("general", Value, "config_dir", translate("Configuration directory"))
o.rmempty = false
o.placeholder = "/var/run/amule"
o = s:taboption("general", Value, "mem_percentage", translate("Memory Limit"), translate("Percentage"))
o.rmempty = false
o.placeholder = "50"
o.datatype = "range(1, 99)"
o = s:taboption("general", Value, "nick", translate("Nickname"))
o.placeholder = "http://www.aMule.org"
o = s:taboption("general", Value, "max_upload", translate("Max upload speed"), translate("Unlimited when set to 0"))
o.datatype = "uinteger"
o.rmempty = false
o.placeholder = "0"
o = s:taboption("general", Value, "max_download", translate("Max download speed"), translate("Unlimited when set to 0"))
o.datatype = "uinteger"
o.rmempty = false
o.placeholder = "0"
o = s:taboption("general", Value, "slot_allocation", translate("Slot allocation"))
o.datatype = "uinteger"
o.rmempty = false
o.placeholder = "2"
o = s:taboption("general", Value, "max_connections", translate("Max connections"))
o.datatype = "uinteger"
o.rmempty = false
o.placeholder = "500"
o = s:taboption("general", Value, "max_sources_per_file", translate("Max sources per file"))
o.datatype = "uinteger"
o.rmempty = false
o.placeholder = "300"
-- CONNECTIONS --
o = s:taboption("connection", Value, "port", translate("TCP port"))
o.datatype = "port"
o.rmempty = false
o.placeholder = "4662"
o = s:taboption("connection", Flag, "udp_enable", translate("Enable UDP port"))
o.rmempty = false
o = s:taboption("connection", Value, "udp_port", translate("UDP port"))
o.datatype = "port"
o.rmempty = false
o.placeholder = "4672"
o = s:taboption("connection", Flag, "upnp_enabled", translate("Enable UPnP"))
o.rmempty = false
o = s:taboption("connection", Value, "upnp_tcp_port", translate("UPnP TCP port"))
o.datatype = "port"
o.rmempty = false
o.placeholder = "50000"
o = s:taboption("connection", Value, "address", translate("Bind Address"), translate("Leave blank to bind all"))
o.datatype = "ip4addr"
o.rmempty = true
o = s:taboption("connection", Flag, "auto_connect", translate("Automatically connect"))
o.rmempty = false
o = s:taboption("connection", Flag, "reconnect", translate("Automatically reconnect"))
o.rmempty = false
o = s:taboption("connection", Flag, "connect_to_kad", translate("Connect to Kad network"))
o.rmempty = false
o = s:taboption("connection", Flag, "connect_to_ed2k", translate("Connect to ED2K network"))
o.rmempty = false
s:taboption("connection", DummyValue,"titlesplit1" ,titlesplit(translate("Proxy Configuration")))
o = s:taboption("connection", Flag, "proxy_enable_proxy", translate("Enable proxy"))
o.rmempty = false
o = s:taboption("connection", ListValue, "proxy_type", translate("Proxy type"))
for i,v in ipairs(ptype) do
o:value(v)
end
o.rmempty = false
o = s:taboption("connection", Value, "proxy_name", translate("Proxy name"))
o.rmempty = true
o = s:taboption("connection", Value, "proxy_port", translate("Proxy port"))
o.datatype = "port"
o.rmempty = true
o = s:taboption("connection", Flag, "proxy_enable_password", translate("Proxy requires authentication"))
o.rmempty = true
o = s:taboption("connection", Value, "proxy_user", translate("Proxy user"))
--o:depends("proxy_enable_password", "1")
o.rmempty = true
o = s:taboption("connection", Value, "proxy_password", translate("Proxy password"))
o.password = true
o.rmempty = true
-- SERVER --
o = s:taboption("server", Value, "kad_nodes_url", translate("Kad Nodes Url"), "<input type=\"button\" size=\"0\" title=\""
.. translate("Download now") .. "\" onclick=\"onclick_down_kad(this.id)\" "
.. "value=\"&#10597;&#10597;&#10597;\" "
.. "style=\"font-weight:bold;text-decoration:overline;\""
.. "/>")
o.rmempty = false
o.placeholder = "http://upd.emule-security.org/nodes.dat"
o = s:taboption("server", Value, "ed2k_servers_url", translate("Ed2k Servers List Url"), "<input type=\"button\" size=\"0\" title=\""
.. translate("Download now") .. "\" onclick=\"onclick_down_ed2k(this.id)\" "
.. "value=\"&#10597;&#10597;&#10597;\" "
.. "style=\"font-weight:bold;text-decoration:overline;\""
.. "/>")
o.rmempty = false
o.placeholder = "http://upd.emule-security.org/server.met"
o = s:taboption("server", Flag, "remove_dead_server", translate("Remove Dead Server"))
o.rmempty = false
o = s:taboption("server", Value, "dead_server_retry", translate("Dead Server Retry"))
--o:depends("remove_dead_server", "1")
o.datatype = "uinteger"
o.rmempty = false
o.placeholder = "3"
o.default = "3"
o = s:taboption("server", Flag, "add_server_list_from_server", translate("Update server list when connecting to a server"))
o.rmempty = false
o = s:taboption("server", Flag, "add_server_list_from_client", translate("Update server list when a client connects"))
o.rmempty = false
o = s:taboption("server", Flag, "scoresystem", translate("Use priority system"))
o.rmempty = false
o = s:taboption("server", Flag, "smart_id_check", translate("Use smart LowID check on connect"))
o.rmempty = false
o = s:taboption("server", Flag, "safe_server_connect", translate("Safe connect"))
o.rmempty = false
o = s:taboption("server", Flag, "auto_connect_static_only", translate("Auto connect to servers in static list only"))
o.rmempty = false
o = s:taboption("server", Flag, "manual_high_prio", translate("Set manually added servers to high priority"))
o.rmempty = false
o = s:taboption("server", Flag, "serverlist", translate("Auto update server list at startup"), translate("addresses.dat file"))
o.rmempty = false
addr = s:taboption("server", Value, "addresses", translate("Server addresses"),
translate("Content of addresses.dat. One address per line"))
addr:depends("serverlist", "1")
addr.template = "cbi/tvalue"
addr.rows = 5
addr.rmempty = true
function addr.cfgvalue(self, section)
return nixio.fs.readfile("/etc/amule/addresses.dat")
end
function addr.write(self, section, value)
value = value:gsub("\r\n?", "\n")
nixio.fs.writefile("//etc/amule/addresses.dat", value)
end
-- PATH AND FILE --
o = s:taboption("path_and_file", Value, "temp_dir", translate("Temporary directory"))
o.rmempty = false
o.placeholder = "/var/run/amule/.aMule/Temp"
o = s:taboption("path_and_file", Value, "incoming_dir", translate("Incoming directory"))
o.rmempty = false
o.placeholder = "/var/run/amule/.aMule/Incoming"
shareddir = s:taboption("path_and_file", Value, "shareddir", translate("Shared directory"),
translate("Content of shareddir.dat. One directory per line"))
shareddir.template = "cbi/tvalue"
shareddir.titleref = luci.dispatcher.build_url("admin", "system", "fstab")
shareddir.rows = 5
shareddir.rmempty = true
function shareddir.cfgvalue(self, section)
return nixio.fs.readfile("/etc/amule/shareddir.dat")
end
function shareddir.write(self, section, value)
value = value:gsub("\r\n?", "\n")
nixio.fs.writefile("//etc/amule/shareddir.dat", value)
end
o = s:taboption("path_and_file", Flag, "ich", translate("Intelligent corruption handling (I.C.H.)"))
o.rmempty = false
o = s:taboption("path_and_file", Flag, "a_ich_trust", translate("Advanced I.C.H trusts every hash (not recommended)"))
o.rmempty = false
o = s:taboption("path_and_file", Flag, "add_new_files_paused", translate("Add files to download in pause mode"))
o.rmempty = false
o = s:taboption("path_and_file", Flag, "dap_pref", translate("Add files to download with auto priority"))
o.rmempty = false
o = s:taboption("path_and_file", Flag, "start_next_file", translate("Start next paused file when a file completes"))
o.rmempty = false
o = s:taboption("path_and_file", Flag, "start_next_file_same_cat", translate("Start next paused file from the same category"))
o:depends("start_next_file", "1")
o.rmempty = true
o = s:taboption("path_and_file", Flag, "start_next_file_alpha", translate("Start next paused file in alphabetic order"))
o:depends("start_next_file", "1")
o.rmempty = true
o = s:taboption("path_and_file", Flag, "allocate_full_file", translate("Preallocate disk space for new files"))
o.rmempty = false
o = s:taboption("path_and_file", Value, "min_free_disk_space", translate("Minimum free disk space. in Mbytes"))
o.datatype = "uinteger"
o.placeholder = "1"
o.rmempty = false
o = s:taboption("path_and_file", Flag, "use_src_seed", translate("Save 10 sources on rare files (< 20 sources)"))
o.rmempty = false
o = s:taboption("path_and_file", Flag, "uap_pref", translate("Add new shares with auto priority"))
o.rmempty = false
-- SECURITY --
o = s:taboption("security", Flag, "use_sec_ident", translate("Use secure user identification"))
o.rmempty = false
o = s:taboption("security", Flag, "is_crypt_layer_requested", translate("Use obfuscation for outgoing connections"))
o.rmempty = false
o = s:taboption("security", Flag, "is_client_crypt_layer_required", translate("Accept only obfuscation connections"))
o.rmempty = false
o = s:taboption("security", ListValue, "see_share", translate("Who can see my shared files"))
for i,v in ipairs(whocan) do
o:value(v)
end
o.rmempty = false
s:taboption("security", DummyValue,"titlesplit2" ,titlesplit(translate("IP Filter Configuration")))
shareddir = s:taboption("security", Value, "ipfilter_static", translate("Static IP list for filtering"),
translate("Content of ipfilter_static.dat"))
shareddir.template = "cbi/tvalue"
shareddir.titleref = luci.dispatcher.build_url("admin", "system", "fstab")
shareddir.rows = 5
shareddir.rmempty = true
function shareddir.cfgvalue(self, section)
return nixio.fs.readfile("/etc/amule/ipfilter_static.dat")
end
function shareddir.write(self, section, value)
value = value:gsub("\r\n?", "\n")
nixio.fs.writefile("//etc/amule/ipfilter_static.dat", value)
end
o = s:taboption("security", Flag, "ip_filter_clients", translate("Filter clients by IP"))
o.rmempty = false
o = s:taboption("security", Flag, "ip_filter_servers", translate("Filter servers by IP"))
o.rmempty = false
o = s:taboption("security", Value, "ip_filter_url", translate("IP filter list URL"))
o.rmempty = true
o = s:taboption("security", Flag, "ip_filter_auto_load", translate("Auto-update ipfilter at startup"))
o.rmempty = false
o = s:taboption("security", Value, "filter_level", translate("Filtering Level"))
o.datatype = "range(1, 255)"
o.rmempty = false
o.placeholder = "127"
o = s:taboption("security", Flag, "filter_lan_ips", translate("Always filter LAN IPs"))
o.rmempty = false
o = s:taboption("security", Flag, "paranoid_filtering", translate("Paranoid handling of non-matching IPs"))
o.rmempty = false
o = s:taboption("security", Flag, "ip_filter_system", translate("Use system-wide ipfilter.dat if available"))
o.rmempty = false
-- REMOTE CONTROL --
o = s:taboption("remote", Value, "ec_address", translate("IP of the listening interface for external connection"))
o.datatype = "ip4addr"
o.placeholder = "127.0.0.1"
o.rmempty = true
o = s:taboption("remote", Value, "ec_port", translate("TCP port for EC"))
o.datatype = "port"
o.placeholder = "4712"
o.rmempty = false
o = s:taboption("remote", Flag, "upnp_ec_enabled", translate("Enable upnp port forwarding on the EC port"))
o.rmempty = false
o = s:taboption("remote", Value, "ec_password", translate("EC password"))
o.password = true
o.rmempty = false
s:taboption("remote", DummyValue,"titlesplit3", titlesplit(translate("aMule Web Configuration")))
o = s:taboption("remote", Flag, "web_enabled", translate("Enable web server on startup"))
o.rmempty = false
o = s:taboption("remote", Value, "template", translate("Web template"))
o.rmempty = false
local tpth_suggestions = luci.sys.exec("ls /usr/share/amule/webserver/|sed ':a;N;$!ba;s/\\n/:/g'")
if tpth_suggestions then
for entry in string.gmatch(tpth_suggestions, "[^:]+") do
o:value(entry)
end
end
o = s:taboption("remote", Value, "web_password", translate("Web full rights password"))
o.password = true
o.rmempty = true
o = s:taboption("remote", Flag, "use_low_rights_user", translate("Use low rights user"))
o.rmempty = false
o = s:taboption("remote", Value, "password_low", translate("Web low rights password"))
o.password = true
o.rmempty = true
o = s:taboption("remote", Value, "web_port", translate("Web TCP port"))
o.datatype = "port"
o.placeholder = "4711"
o.rmempty = false
o = s:taboption("remote", Flag, "upnp_web_server_enabled", translate("Enable UPnP port forwarding of the web server port"))
o.rmempty = false
o = s:taboption("remote", Value, "web_upnp_tcp_port", translate("Web UPnP TCP port"))
o.datatype = "port"
o.placeholder = "50001"
o.rmempty = false
o = s:taboption("remote", Value, "page_refresh_time", translate("Page refresh time(in secs)"))
o.datatype = "range(1, 600)"
o.rmempty = false
o.placeholder = "121"
o = s:taboption("remote", Flag, "use_gzip", translate("Enable Gzip compression"))
o.rmempty = false
-- TEMPLATE --
tmpl = s:taboption("template", Value, "_tmpl",
translate("Edit the template that is used for generating the aMule configuration."),
translate("This is the content of the file '/etc/amule/amule.conf.template' from which your amule configuration will be generated. " ..
"Values enclosed by pipe symbols ('|') should not be changed. They get their values from other tabs."))
tmpl.template = "cbi/tvalue"
tmpl.rows = 20
function tmpl.cfgvalue(self, section)
return nixio.fs.readfile("/etc/amule/amule.conf.template")
end
function tmpl.write(self, section, value)
value = value:gsub("\r\n?", "\n")
nixio.fs.writefile("//etc/amule/amule.conf.template", value)
end
-- LOGVIEW --
local lv = s:taboption("logview", DummyValue, "_logview")
lv.template = "amule/detail_logview"
lv.inputtitle = translate("Read / Reread log file")
lv.rows = 50
function lv.cfgvalue(self, section)
return translate("Please press [Read] button")
end
-- AMULECMD --
local cmd = s:taboption("amulecmd", DummyValue, "_amulecmd")
cmd.template = "amule/webshell"
return m

View File

@ -0,0 +1,56 @@
<!-- ++ BEGIN ++ aMule ++ detail_logview.htm ++ -->
<script type="text/javascript">//<![CDATA[
function onclick_logview(section, bottom) {
// get elements
var txt = document.getElementById("cbid.amule.main._logview.txt"); // TextArea
if ( !txt ) { return; } // security check
var lvXHR = new XHR();
lvXHR.get('<%=url('admin/nas/amule/logview')%>', null,
function(x) {
if (x.responseText == "_nodata_")
txt.value = "<%:File not found or empty%>";
else
txt.value = x.responseText;
if (bottom)
txt.scrollTop = txt.scrollHeight;
else
txt.scrollTop = 0; }
);
}
//]]></script>
<%+cbi/valueheader%>
<br />
<%
-- one button on top, one at the buttom
%>
<input class="cbi-button cbi-input-button" style="align: center; width: 100%" type="button" onclick="onclick_logview(this.name, false)"
<%=
attr("name", section) .. attr("id", cbid .. ".btn1") .. attr("value", self.inputtitle)
%> />
<br /><br />
<%
-- set a readable style taken from openwrt theme for textarea#syslog
-- in openwrt theme there are problems with a width of 100 so we check for theme and set to lower value
%>
<textarea style="width: <%if media == "/luci-static/openwrt.org" then%>98.7%<%else%>100%<%end%> ; min-height: 500px; border: 3px solid #cccccc; padding: 5px; font-family: monospace; resize: none;" wrap="off" readonly="readonly"
<%=
attr("name", cbid .. ".txt") .. attr("id", cbid .. ".txt") .. ifattr(self.rows, "rows")
%> >
<%-=pcdata(self:cfgvalue(section))-%>
</textarea>
<br /><br />
<%
-- one button on top, one at the buttom
%>
<input class="cbi-button cbi-input-button" style="align: center; width: 100%" type="button" onclick="onclick_logview(this.name, true)"
<%= attr("name", section) .. attr("id", cbid .. ".btn2") .. attr("value", self.inputtitle) %> />
<%+cbi/valuefooter%>
<!-- ++ END ++ aMule ++ detail_logview.htm ++ -->

View File

@ -0,0 +1,94 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(5, '<%=luci.dispatcher.build_url("admin/nas/amule/status")%>', null,
function(x, data) {
var tb = document.getElementById('amule_status');
var btn = document.getElementById("amule_startstop");
var btn_tmpl = '<input class="cbi-button cbi-button-apply" id="btn_startstop" style="font-size: 100%;" value="PID: NUMBER"type="button" onclick="onclick_startstop(this.id)">'
if (data && tb) {
if (data.amuled) {
var links = '<em><%:aMule daemon is running.%></em>';
if (data.amuleweb) {
links += '<input class="cbi-button mar-10" type="button" value="<%:Open aMuleWeb%>" onclick="openWebUI();" />';
}
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><%:aMule daemon is not running.%></em>';
}
if (data.amuled_pid == "0") {
btn.innerHTML = btn_tmpl.replace("PID: NUMBER", "<%:Start aMule%>");
} else {
btn.innerHTML = btn_tmpl.replace("NUMBER", data.amuled_pid);
}
}
}
);
function _data2elements(x, data) {
var btn = document.getElementById("btn_startstop");
if ( ! btn ) { return; } // security check
if (data.amuled_pid == "0") {
btn.value = "<%:Start aMule%>";
btn.className = "cbi-button cbi-button-apply";
btn.disabled = false;
} else {
btn.value = "PID: " + data.amuled_pid;
btn.className = "cbi-button cbi-button-reset";
btn.disabled = false;
}
}
// event handler for start/stop button
function onclick_startstop(id) {
// do start/stop
var btnXHR = new XHR();
btnXHR.post('<%=url('admin/nas/amule/startstop')%>', { token: '<%=token%>' },
function(x, data) { _data2elements(x, data); }
);
}
// event handler for download files
function onclick_down_kad(id) {
if(confirm("<%:Existing file will be overwritten, do you really want to proceed?%>"))
{
var btnXHR = new XHR();
btnXHR.post('<%=url('admin/nas/amule/down_kad')%>', { token: '<%=token%>' },
function(x) {}
);
}
}
function onclick_down_ed2k(id) {
if(confirm("<%:Existing file will be overwritten, do you really want to proceed?%>"))
{
var btnXHR = new XHR();
btnXHR.post('<%=url('admin/nas/amule/down_ed2k')%>', { token: '<%=token%>' },
function(x) {}
);
}
}
function openWebUI() {
var curWwwPath = window.document.location.href;
var pathName = window.document.location.pathname;
var pos = curWwwPath.indexOf(pathName);
var localhostPath = curWwwPath.substring(0, pos);
var auth_port = document.getElementById("cbid.amule.main.web_port");
if (auth_port.value == "") {
auth_port_value = "44711"
} else {
auth_port_value = auth_port.value
};
var url = "http:" + localhostPath.substring(window.location.protocol.length) + ":" + auth_port_value;
window.open(url)
};
//]]>
</script>
<style>.mar-10 {margin-left: 10px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<legend><%:aMule Status%></legend>
<p id="amule_status">
<em><%:Collecting data...%></em>
</p>
<p id="amule_startstop">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -0,0 +1,90 @@
<script type="text/javascript">//<![CDATA[
String.prototype.startsWith = function (str){
return this.indexOf(str) == 0;
};
var iwxhr = new XHR();
function update_status(e) {
if(e!=null && e.keyCode!=13) return false;
/*var cmd = document.getElementById("cmd").value;
if(cmd.startsWith("cd"))
{
newpath = cmd.replace("cd","").replace(" ","");
if(newpath.startsWith("/")){
document.getElementById("currentpath").value = newpath;
}else{
document.getElementById("currentpath").value += newpath;
}
cmd="";
}*/
obj = document.getElementById("screen");
cmdstr=(document.getElementById("cmd").value).replace(/\s+/g,"")
if (cmdstr == "cls" || cmdstr == "clear")
{
obj = document.getElementById("screen");
obj.value = "";
document.getElementById("cmd").value = "";
return false;
}
iwxhr.get('<%=luci.dispatcher.build_url("admin", "nas", "amule", "amulecmd")%>', {cmd: document.getElementById("cmd").value },
function(x, ifc)
{
obj = document.getElementById("screen");
obj.value+=ifc[0];
document.getElementById("cmd").focus();
}
)
if ((document.getElementById("cmd").value).replace(/\s+/g,"") != "")
{
obj.value+="\r\n--------------------------------------------\r\n"+document.getElementById("cmd").value+"\r\n--------------------------------------------\r\n";
document.getElementById("cmd").value = "";
return false;
}
};
function clear_textfield() {
obj = document.getElementById("screen");
obj.value=""
}
//]]></script>
<style>
.cmd_line{
background-color:yellow;
}
#list ul li
{
margin-right:5px;
height:16px;
display:block;
float:left;
word-break: keep-all;
}
#list ul li:hover
{
background:blue;
cursor:pointer;
}
</style>
<div class="cbi-map" id="cbi-system">
<h4><a id="content" name="content"><%:You can call amulecmd commands here to control your amule.%></a></h4>
<h4><a id="content" name="content"><%:Execute 'Help' to get more infomation.%></a></h4>
<textarea id="screen" style="width:100%;height:400px;overflow:auto;font-size:12px;" readonly="readonly" ></textarea>
<br/>
<%=translate("Command: ")%>
<input type="text" id="cmd"/>
<input class="cbi-button cbi-input-button" style="align: center; width: 100%" type="button" onclick="update_status(null)"
<%= attr("name", section) .. attr("id", cbid .. ".btn2") .. attr("value", translate("Execute")) %> />
<input class="cbi-button cbi-input-button" style="align: center; width: 100%" type="button" onclick="clear_textfield()"
<%= attr("name", section) .. attr("id", cbid .. ".btn3") .. attr("value", translate("Clear")) %> />
<br/>
</div>

View File

@ -0,0 +1,360 @@
msgid "aMule is a ED2K/KAD client for all platforms."
msgstr "aMule是一个跨平台的ED2K/KAD客户端"
msgid "NAS"
msgstr "网络存储"
msgid "General"
msgstr "常规"
msgid "Connections"
msgstr "连接"
msgid "Server"
msgstr "服务器"
msgid "Path And File"
msgstr "路径和文件"
msgid "Security"
msgstr "安全"
msgid "External Control"
msgstr "远程控制"
msgid "Edit Template"
msgstr "编辑配置模版"
msgid "Log File Viewer"
msgstr "日志查看"
msgid "aMule Settings"
msgstr "aMule设置"
msgid "Run daemon as user"
msgstr "运行守护进程的用户"
msgid "Configuration directory"
msgstr "配置目录"
msgid "Nickname"
msgstr "昵称"
msgid "Max upload speed"
msgstr "最大上传速度"
msgid "Max download speed"
msgstr "最大下载速度"
msgid "Unlimited when set to 0"
msgstr "设为0时不限制"
msgid "Slot allocation"
msgstr "槽速度"
msgid "Max connections"
msgstr "最大连接数"
msgid "Max sources per file"
msgstr "单文件最大连接数"
msgid "TCP port"
msgstr "TCP端口"
msgid "UDP port"
msgstr "UDP端口"
msgid "Enable UDP port"
msgstr "启用UDP端口"
msgid "Enable UPnP"
msgstr "启用UPnP"
msgid "UPnP TCP port"
msgstr "UPnP TCP端口"
msgid "Bind Address"
msgstr "地址绑定"
msgid "Leave blank to bind all"
msgstr "留空则全部绑定"
msgid "Default to bind all"
msgstr "默认全部绑定"
msgid "Automatically connect"
msgstr "自动连接"
msgid "Automatically reconnect"
msgstr "自动重连"
msgid "Connect to Kad network"
msgstr "连接到Kad网络"
msgid "Connect to ED2K network"
msgstr "连接到ED2K网络"
msgid "Proxy Configuration"
msgstr "代理设置"
msgid "Enable proxy"
msgstr "启用代理"
msgid "Proxy type"
msgstr "代理类型"
msgid "Proxy name"
msgstr "代理名称"
msgid "Proxy port"
msgstr "代理端口"
msgid "Proxy requires authentication"
msgstr "代理需要认证"
msgid "Proxy user"
msgstr "代理用户"
msgid "Proxy password"
msgstr "代理密码"
msgid "Kad Nodes Url"
msgstr "Kad节点URL"
msgid "Ed2k Servers List Url"
msgstr "Ed2k服务器列表URL"
msgid "Remove Dead Server"
msgstr "删除无效服务器"
msgid "Dead Server Retry"
msgstr "删除前重连次数"
msgid "Update server list when connecting to a server"
msgstr "与服务器连接时更新服务器列表"
msgid "Update server list when a client connects"
msgstr "与其他用户连接时更新服务器列表"
msgid "Use priority system"
msgstr "启用优先级系统"
msgid "Use smart LowID check on connect"
msgstr "智能LOWID检测"
msgid "Safe connect"
msgstr "安全连接"
msgid "Auto connect to servers in static list only"
msgstr "只自动连接到静态列表中的服务器"
msgid "Set manually added servers to high priority"
msgstr "将手动输入的服务器设为高优先级"
msgid "Auto update server list at startup"
msgstr "启动时自动更新服务器列表"
msgid "addresses.dat file"
msgstr "addresses.dat文件"
msgid "Server addresses"
msgstr "服务器地址"
msgid "Content of addresses.dat. One address per line"
msgstr "addresses.dat的内容. 每行一个地址."
msgid "Temporary directory"
msgstr "临时文件夹"
msgid "Incoming directory"
msgstr "下载文件夹"
msgid "Shared directory"
msgstr "共享文件夹"
msgid "Content of shareddir.dat. One directory per line"
msgstr "shareddir.dat的内容. 每行一个目录."
msgid "Intelligent corruption handling (I.C.H.)"
msgstr "智能损坏数据处理(I.C.H.)"
msgid "Advanced I.C.H trusts every hash (not recommended)"
msgstr "高级I.C.H信任全部校验值不推荐"
msgid "Add files to download in pause mode"
msgstr "添加新下载文件时设为暂停"
msgid "Add files to download with auto priority"
msgstr "添加新下载文件时设定优先级为自动"
msgid "Start next paused file when a file completes"
msgstr "一个文件完成时开始下一个暂停的文件"
msgid "Start next paused file from the same category"
msgstr "从同一分类开始下一个暂停的文件"
msgid "Start next paused file in alphabetic order"
msgstr "根据字母顺序开始下一个暂停的文件"
msgid "Preallocate disk space for new files"
msgstr "为新文件预分配磁盘空间"
msgid "Minimum free disk space. in Mbytes"
msgstr "最低剩余空间单位MB"
msgid "Save 10 sources on rare files (< 20 sources)"
msgstr "保存稀有文件少于20个源的十个源"
msgid "Add new shares with auto priority"
msgstr "添加新共享文件时设优先级为自动"
msgid "Use secure user identification"
msgstr "使用安全用户认证"
msgid "Use obfuscation for outgoing connections"
msgstr "为传出连接使用迷惑协议"
msgid "Accept only obfuscation connections"
msgstr "只接受迷惑协议连接"
msgid "Who can see my shared files"
msgstr "谁可查看我的共享文件"
msgid "IP Filter Configuration"
msgstr "IP过滤设置"
msgid "Static IP list for filtering"
msgstr "静态IP过滤列表"
msgid "Content of ipfilter_static.dat"
msgstr "ipfilter_static.dat的内容"
msgid "Filter clients by IP"
msgstr "过滤用户"
msgid "Filter servers by IP"
msgstr "过滤服务器"
msgid "IP filter list URL"
msgstr "过滤列表URL"
msgid "Auto-update ipfilter at startup"
msgstr "自动更新过滤列表"
msgid "Filtering Level"
msgstr "过滤级别"
msgid "Always filter LAN IPs"
msgstr "总是过滤局域网ip地址"
msgid "Paranoid handling of non-matching IPs"
msgstr "处理不匹配的IP"
msgid "Use system-wide ipfilter.dat if available"
msgstr "可用情况下使用系统级的ipfilter.dat"
msgid "IP of the listening interface for external connection"
msgstr "远程连接监听IP"
msgid "TCP port for EC"
msgstr "远程连接TCP端口"
msgid "Enable upnp port forwarding on the EC port"
msgstr "为远程连接端口启用upnp"
msgid "aMule Web Configuration"
msgstr "aMule Web设置"
msgid "EC password"
msgstr "远程连接密码"
msgid "Enable web server on startup"
msgstr "启动时运行Web服务"
msgid "Web template"
msgstr "Web模版"
msgid "Web full rights password"
msgstr "Web最高权限密码"
msgid "Use low rights user"
msgstr "启用低权限用户"
msgid "Web low rights password"
msgstr "Web低权限密码"
msgid "Web TCP port"
msgstr "Web TCP端口"
msgid "Enable UPnP port forwarding of the web server port"
msgstr "为Web服务端口启用UPnP端口转发"
msgid "Web UPnP TCP port"
msgstr "Web服务UPnP的TCP端口"
msgid "Page refresh time(in secs)"
msgstr "页面刷新周期(秒)"
msgid "Enable Gzip compression"
msgstr "启用Gzip压缩"
msgid "Edit the template that is used for generating the aMule configuration."
msgstr "编辑用来生成aMule设置的模板"
msgid "This is the content of the file '/etc/amule/amule.conf.template' from which your amule configuration will be generated. Values enclosed by pipe symbols ('|') should not be changed. They get their values from other tabs."
msgstr "创建aMule设置的 '/etc/amule/amule.conf.template' 文件的内容。被通道符|包围的值不应该在这里改动,请在其他标签修改这些设置。"
msgid "Read / Reread log file"
msgstr "读取/重载日志文件"
msgid "Please press [Read] button"
msgstr "请点击[读取]按钮"
msgid "File not found or empty"
msgstr "文件不存在或为空"
msgid "aMule Status"
msgstr "aMule状态"
msgid "Open aMuleWeb"
msgstr "打开aMuleWeb"
msgid "aMule daemon is running."
msgstr "aMule守护进程正在运行"
msgid "aMule daemon is not running."
msgstr "aMule守护进程未运行"
msgid "Start aMule"
msgstr "启动aMule"
msgid "aMule command"
msgstr "aMule命令"
msgid "aMule Command"
msgstr "aMule命令"
msgid "You can call amulecmd commands here to control your amule."
msgstr "你可以在这里运行amulecmd命令以控制你的aMule"
msgid "Execute 'Help' to get more infomation."
msgstr "执行'Help'命令以获取更多信息"
msgid "Execute"
msgstr "执行"
msgid "Clear"
msgstr "清空"
msgid "Command: "
msgstr "命令: "
msgid "Download now"
msgstr "立即下载"
msgid "Existing file will be overwritten, do you really want to proceed?"
msgstr "已有文件将被覆盖,是否继续?"
msgid "Percentage"
msgstr "百分比"

View File

@ -0,0 +1,206 @@
[eMule]
Nick=|NICK|
MaxUpload=|MAXUPLOAD|
MaxDownload=|MAXDOWNLOAD|
SlotAllocation=|SLOTALLOCATION|
MaxConnections=|MAXCONNECTIONS|
MaxSourcesPerFile=|MAXSOURCESPERFILE|
Port=|PORT|
UDPPort=|UDPPORT|
UDPEnable=|UDPENABLE|
UPnPEnabled=|UPNPENABLED|
UPnPTCPPort=|UPNPTCPPORT|
Address=|ADDRESS|
Autoconnect=|AUTOCONNECT|
Reconnect=|RECONNECT|
ConnectToKad=|CONNECTTOKAD|
ConnectToED2K=|CONNECTTOED2K|
KadNodesUrl=|KADNODESURL|
Ed2kServersUrl=|ED2KSERVERSURL|
RemoveDeadServer=|REMOVEDEADSERVER|
DeadServerRetry=|DEADSERVERRETRY|
AddServerListFromServer=|ADDSERVERLISTFROMSERVER|
AddServerListFromClient=|ADDSERVERLISTFROMCLIENT|
Scoresystem=|SCORESYSTEM|
SmartIdCheck=|SMARTIDCHECK|
SafeServerConnect=|SAFESERVERCONNECT|
AutoConnectStaticOnly=|AUTOCONNECTSTATICONLY|
ManualHighPrio=|MANUALHIGHPRIO|
Serverlist=|SERVERLIST|
TempDir=|TEMPDIR|
IncomingDir=|INCOMINGDIR|
ICH=|ICH|
AICHTrust=|AICHTRUST|
AddNewFilesPaused=|ADDNEWFILESPAUSED|
DAPPref=|DAPPREF|
StartNextFile=|STARTNEXTFILE|
StartNextFileSameCat=|STARTNEXTFILESAMECAT|
StartNextFileAlpha=|STARTNEXTFILEALPHA|
AllocateFullFile=|ALLOCATEFULLFILE|
MinFreeDiskSpace=|MINFREEDISKSPACE|
UAPPref=|UAPPREF|
SeeShare=|SEESHARE|
IPFilterURL=|IPFILTERURL|
IPFilterAutoLoad=|IPFILTERAUTOLOAD|
FilterLevel=|FILTERLANIPS|
FilterLanIPs=|FILTERLANIPS|
ParanoidFiltering=|PARANOIDFILTERING|
IPFilterSystem=|IPFILTERSYSTEM|
FilterMessages=1
FilterAllMessages=0
MessagesFromFriendsOnly=0
MessageFromValidSourcesOnly=1
FilterWordMessages=0
MessageFilter=
ShowMessagesInLog=1
FilterComments=0
CommentFilter=
AppVersion=SVN
QueueSizePref=50
MaxConnectionsPerFiveSeconds=20
ServerKeepAliveTimeout=0
CheckDiskspace=1
PreviewPrio=0
FileBufferSizePref=16
OSDirectory=/var/run/amule
OnlineSignature=0
OnlineSignatureUpdate=5
EnableTrayIcon=0
MinToTray=0
ConfirmExit=1
StartupMinimized=0
3DDepth=10
ToolTipDelay=1
ShowOverhead=0
ShowInfoOnCatTabs=1
VerticalToolbar=0
GeoIPEnabled=1
VideoPlayer=
StatGraphsInterval=3
statsInterval=30
DownloadCapacity=300
UploadCapacity=100
StatsAverageMinutes=5
VariousStatisticsMaxValue=100
ShareHiddenFiles=0
AutoSortDownloads=0
NewVersionCheck=1
AdvancedSpamFilter=1
MessageUseCaptchas=1
Language=
SplitterbarPosition=75
YourHostname=
DateTimeFormat=%A, %x, %X
AllcatType=0
ShowAllNotCats=0
SmartIdState=0
DropSlowSources=0
ShowRatesOnTitle=0
GeoLiteCountryUpdateUrl=http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
StatsServerName=Shorty's ED2K stats
StatsServerURL=http://ed2k.shortypower.dyndns.org/?hash=
CreateSparseFiles=1
[Browser]
OpenPageInTab=1
CustomBrowserString=
[Proxy]
ProxyEnableProxy=|PROXYENABLEPROXY|
ProxyType=|PROXYTYPE|
ProxyName=|PROXYNAME|
ProxyPort=|PROXYPORT|
ProxyEnablePassword=|PROXYENABLEPASSWORD|
ProxyUser=|PROXYUSER|
ProxyPassword=|PROXYPASSWORD|
[DLP]
CheckModString=1
CheckUsername=1
CheckUserHash=1
CheckHelloTag=1
CheckInfoTag=1
CheckVeryCDMod=0
CheckGhostMod=1
[ExternalConnect]
ECAddress=|ECADDRESS|
ECPort=|ECPORT|
UPnPECEnabled=|UPNPECENABLED|
ECPassword=|ECPASSWORD|
UseSrcSeeds=|USESRCSEED|
UseSecIdent=|USESECIDENT|
IpFilterClients=|IPFILTERCLIENTS|
IpFilterServers=|IPFILTERSERVERS|
AcceptExternalConnections=1
ShowProgressBar=1
ShowPercent=1
TransmitOnlyUploadingClients=0
[WebServer]
Enabled=|WEBENABLED|
Template=|TEMPLATE|
Password=|WEBPASSWORD|
UseLowRightsUser=|USELOWRIGHTSUSER|
PasswordLow=|PASSWORDLOW|
Port=|WEBPORT|
UPnPWebServerEnabled=|UPNPWEBSERVERENABLED|
WebUPnPTCPPort=|WEBUPNPTCPPORT|
PageRefreshTime=|PAGEREFRESHTIME|
UseGzip=|USEGZIP|
Path=amuleweb
[GUI]
HideOnClose=0
[Razor_Preferences]
FastED2KLinksHandler=1
[SkinGUIOptions]
Skin=
[Statistics]
MaxClientVersions=0
[Obfuscation]
IsCryptLayerRequested=|ISCRYPTLAYERREQUESTED|
IsClientCryptLayerRequired=|ISCLIENTCRYPTLAYERREQUIRED|
IsClientCryptLayerSupported=1
CryptoPaddingLenght=254
CryptoKadUDPKey=281625462
[PowerManagement]
PreventSleepWhileDownloading=0
[UserEvents]
[UserEvents/DownloadCompleted]
CoreEnabled=0
CoreCommand=
GUIEnabled=0
GUICommand=
[UserEvents/NewChatSession]
CoreEnabled=0
CoreCommand=
GUIEnabled=0
GUICommand=
[UserEvents/OutOfDiskSpace]
CoreEnabled=0
CoreCommand=
GUIEnabled=0
GUICommand=
[UserEvents/ErrorOnCompletion]
CoreEnabled=0
CoreCommand=
GUIEnabled=0
GUICommand=
[HTTPDownload]
URL_1=

View File

@ -0,0 +1,71 @@
config amule 'main'
option enabled '0'
option runasuser 'amule'
option config_dir '/var/run/amule'
option mem_percentage '50'
option nice '10'
option ionice_flags '-c 3'
option nick 'http://www.aMule.org'
option max_upload '0'
option max_download '0'
option slot_allocation '2'
option max_connections '500'
option max_sources_per_file '300'
option port '4662'
option udp_enable '1'
option udp_port '4672'
option upnp_tcp_port '50000'
option auto_connect '1'
option reconnect '1'
option connect_to_kad '1'
option connect_to_ed2k '1'
option kad_nodes_url 'http://upd.emule-security.org/nodes.dat'
option ed2k_servers_url 'http://upd.emule-security.org/server.met'
option remove_dead_server '1'
option dead_server_retry '3'
option scoresystem '1'
option smart_id_check '1'
option use_sec_ident '1'
option is_crypt_layer_requested '1'
option ip_filter_clients '1'
option ip_filter_servers '1'
option ip_filter_auto_load '1'
option filter_level '127'
option filter_lan_ips '1'
option paranoid_filtering '1'
option ec_port '4712'
option ec_password '12345678'
option ich '1'
option dap_pref '1'
option start_next_file '1'
option min_free_disk_space '1'
option use_src_seed '1'
option temp_dir '/var/run/amule/Temp'
option incoming_dir '/var/run/amule/Incoming'
option proxy_enable_proxy '0'
option add_server_list_from_server '0'
option add_server_list_from_client '0'
option safe_server_connect '0'
option auto_connect_static_only '0'
option manual_high_prio '0'
option serverlist '0'
option a_ich_trust '0'
option add_new_files_paused '0'
option allocate_full_file '0'
option uap_pref '0'
option is_client_crypt_layer_required '0'
option see_share 'nobody'
option ip_filter_system '0'
option upnp_ec_enabled '0'
option web_enabled '0'
option upnp_enabled '0'
option proxy_type 'socks5'
option template 'default'
option use_low_rights_user '0'
option web_port '44711'
option upnp_web_server_enabled '0'
option web_upnp_tcp_port '50001'
option page_refresh_time '121'
option use_gzip '0'

View File

@ -0,0 +1,14 @@
#!/bin/sh
# Copyright (C) 2007 OpenWrt.org
/etc/init.d/amule enabled && {
[ "$ACTION" = "ifup" ] && {
/etc/init.d/amule start
}
[ "$ACTION" = "ifdown" ] && {
/etc/init.d/amule stop
}
}

View File

@ -0,0 +1,175 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2015 OpenWrt.org
START=99
USE_PROCD=1
LIST_SEP="
"
unregex() {
echo "$1" | sed -e 's/[]\/()$*.^|[]/\\&/g'
}
option_word_to_digit() {
word=$(grep -ioE "\b$2=\S+" "$1"|awk -F= '{print $2}')
digit=$(echo "$3" |grep -oE "$word/\S+"|awk -F'/' '{print $2}')
sed -i "s/\b$2=$word\b/$2=$digit/g" "$1"
}
encrypt_password() {
pass_notencryted=$(grep -ioE "\b$2=[^\n]+" "$1"|sed "s/.*$2=//g")
pass_encryted=$(echo -n $pass_notencryted|md5sum|grep -oE "[a-z0-9]{32}")
[[ -z $pass_notencryted ]] || sed -i "s/\b$2=$(unregex $pass_notencryted)/$2=$pass_encryted/g" "$1"
}
write_dat_file() {
if [[ -s "$1" ]] ; then
cat "$1" > "$2"
else
[[ -s "$2" ]] && cat "$2" > "$1"
fi
}
set_params() {
cat /etc/amule/amule.conf.template > "$config_file"
local p; local v; local s="$1"; shift
for p in $*; do
config_get v "$s" "$p"
IFS="$LIST_SEP"
for v in $v; do
[ -n "$v" ] && (
sed -i "s;|$(echo $p|tr '[a-z]' '[A-Z]'|sed -e 's|_||g')|;$(unregex $v);g" "$config_file"
)
done
unset IFS
done
#delete unreplaced placeholders
sed -i "s;=|[A-Z0-9]*|;=;g" "$config_file"
#convert some options to digit
option_word_to_digit "$config_file" "ProxyType" "socks5/0 socks4/1 http/2 socks4a/3"
option_word_to_digit "$config_file" "SeeShare" "anyone/0 friends/1 nobody/2"
#encrypt password
encrypt_password "$config_file" "ECPassword"
encrypt_password "$config_file" "Password"
encrypt_password "$config_file" "PasswordLow"
}
section_enabled() {
config_get_bool enabled "$1" 'enabled' 0
[ $enabled -gt 0 ]
}
set_owner() {
case $(echo "$1"|grep -oE "^/[^/]+") in
"/var"|"/tmp"|"/mnt"|"root")
cur_user=$(ls -w50 -ld "$1"|awk '{print $3}')
cur_group=$(ls -w50 -ld "$1"|awk '{print $4}')
[[ $cur_user == $2 ]] || ( chown -R $2 "$1" )
[[ $cur_group == $3 ]] || ( chgrp -R $3 "$1" )
;;
*)
false
;;
esac
}
amule() {
local cfg="$1"
local USE
local runasuser
local incoming_dir config_dir temp_dir
local mem_percentage
local config_overwrite nice ionice_flags
local cmdline
section_enabled "$section" || return 1
config_get config_dir "$cfg" 'config_dir' '/var/run/amule'
config_get runasuser "$cfg" 'runasuser' 'daemon'
config_get incoming_dir "$cfg" 'incoming_dir' "$config_dir/Incoming"
config_get temp_dir "$cfg" 'temp_dir' "$config_dir/Temp"
config_get mem_percentage "$cfg" 'mem_percentage' '50'
config_get config_overwrite "$cfg" config_overwrite 1
config_get nice "$cfg" nice "-19"
config_get ionice_flags "$cfg" ionice_flags ''
group=$(id -Gn $runasuser)
case $(echo "$config_dir"|grep -oE "^/[^/]+") in
"/var"|"/tmp"|"/mnt"|"/root"|"/home")
true
;;
*)
echo "You should set config_dir to subfolders under /var, /tmp ,/mnt or /root"
return 1
;;
esac
which ionice > /dev/null || ionice_flags=''
local MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
if test "$MEM" -gt 1;then
USE=$(expr $MEM \* $mem_percentage \* 10)
fi
config_file="$config_dir/amule.conf"
#[ -d "$config_dir" ] || {
mkdir -m 0755 -p "$config_dir"
chmod g+s "$config_dir"
chown $group:$runasuser "$config_dir"
touch "$config_file" "$config_dir/addresses.dat" "$config_dir/shareddir.dat" \
"$config_dir/ipfilter_static.dat"
[ -d "$config_dir/.aMule" ] || ln -s ./ $config_dir/.aMule
#[ -z "$runasuser" ] || set_owner "$config_dir" $runasuser $group
#}
touch "$config_file"
write_dat_file /etc/amule/addresses.dat "$config_dir/addresses.dat"
write_dat_file /etc/amule/shareddir.dat "$config_dir/shareddir.dat"
write_dat_file /etc/amule/ipfilter_static.dat "$config_dir/ipfilter_static.dat"
#[ "$config_overwrite" == 0 ] || {
set_params "$cfg" $(uci show amule|awk -F'[.=]' '{print $3}'|tr '\n' ' ')
#}
HOME="$config_dir" /usr/bin/amulecmd --create-config-from="$config_file"
cmdline="/usr/bin/amuled -c $config_dir"
[ "$ionice_flags" ] && cmdline="ionice $ionice_flags $cmdline"
procd_open_instance
procd_set_param command $cmdline
procd_set_param respawn retry=60
procd_set_param user "$runasuser"
procd_set_param nice "$nice"
if test -z "$USE";then
procd_set_param limits core="0 0"
else
procd_set_param limits core="0 0" as="$USE $USE"
logger -t amule "Starting with $USE virt mem"
fi
procd_add_jail amule log
procd_add_jail_mount_rw $config_file
procd_add_jail_mount_rw $incoming_dir
procd_add_jail_mount_rw $temp_dir
procd_close_instance
}
start_service() {
killall -9 amuleweb >/dev/null 2>&1
config_load 'amule'
config_foreach amule 'amule'
}
restart() {
stop
sleep 2
start
}

View File

@ -0,0 +1,26 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@amule[-1]
add ucitrack amule
set ucitrack.@amule[-1].init=amule
commit ucitrack
EOF
while [ ! $(grep -e "amule" ${IPKG_INSTROOT}/etc/passwd) ]
do
gid=$(awk -v min=1000 -v max=1500 'BEGIN{srand(); print int(min+rand()*(max-min+1))}')
echo amule:x:0:0:99999:7::: >> ${IPKG_INSTROOT}/etc/shadow
grep -e ":$gid:" ${IPKG_INSTROOT}/etc/passwd || ( \
echo "amule:x:$gid:amule" >> ${IPKG_INSTROOT}/etc/group ; \
echo "amule:x:$gid:$gid:amule:/var/run/amule:/bin/false" >> ${IPKG_INSTROOT}/etc/passwd )
sleep 1
done
mkdir -p ${IPKG_INSTROOT}/etc/amule/
touch ${IPKG_INSTROOT}/etc/amule/addresses.dat
touch ${IPKG_INSTROOT}/etc/amule/ipfilter_static.dat
touch ${IPKG_INSTROOT}/etc/amule/shareddir.dat
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,17 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Scheduled Reboot
LUCI_DEPENDS:=+luci
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=7
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,4 @@
module("luci.controller.autoreboot",package.seeall)
function index()
entry({"admin","system","autoreboot"},cbi("autoreboot"),_("Scheduled Reboot"),88)
end

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