update 2023-01-29 08:54:20

This commit is contained in:
github-actions[bot] 2023-01-29 08:54:20 +08:00
parent 49ca67feab
commit 200925c0e9
33 changed files with 3 additions and 4196 deletions

View File

@ -1,118 +0,0 @@
#
# Copyright (C) 2007-2021 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=aMule-DLP
PKG_VERSION:=2.3.3
PKG_RELEASE:=16
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/persmule/amule-dlp.git
PKG_SOURCE_DATE:=2021-01-30
PKG_SOURCE_VERSION:=78a95e54e976c612fde6eb49390807df7870f26a
PKG_MIRROR_HASH:=skip
PKG_CONFIG_DEPEDS:= CONFIG_AMULE_CRYPTOPP_STATIC_LINKING
PKG_FIXUP:=autoreconf
PKG_BUILD_DEPENDS:=libcryptopp libgd
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/amule-dlp
SUBMENU:=P2P
SECTION:=net
CATEGORY:=Network
TITLE:=A multi-platform eMule-like ed2k client
URL:=http://www.amule.org/
DEPENDS:=+antileech +libpng +libpthread +libncurses +libreadline +libwxbase \
+libupnp +libbfd $(ICONV_DEPENDS) $(INTL_DEPENDS) \
+!AMULE_CRYPTOPP_STATIC_LINKING:libcryptopp
endef
define Package/amule-dlp/config
config AMULE_CRYPTOPP_STATIC_LINKING
bool "Link libcryptopp statically"
default n
endef
define Download/AmuleWebUI
URL:=https://github.com/MatteoRagni/AmuleWebUI-Reloaded/archive
URL_FILE:=master.zip
FILE:=AmuleWebUI.zip
HASH:=skip
endef
define Build/Prepare
$(call Build/Prepare/Default)
unzip $(DL_DIR)/AmuleWebUI.zip -d $(PKG_BUILD_DIR)
endef
TARGET_LDFLAGS+= -liconv
CONFIGURE_ARGS+= \
--disable-static \
--disable-rpath \
--with-gnu-ld \
--disable-ccache \
--enable-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
MAKE_FLAGS += HOSTCC="$(HOSTCC)"
define Build/Configure
cd $(PKG_BUILD_DIR); $(SHELL) autogen.sh
$(call Build/Configure/Default)
ifeq ($(CONFIG_AMULE_CRYPTOPP_STATIC_LINKING),y)
$(SED) 's;^CRYPTOPP_LIBS.*;CRYPTOPP_LIBS \= "$(STAGING_DIR)/usr/lib/libcryptopp.a";g' \
$(PKG_BUILD_DIR)/src/Makefile
endif
endef
define Package/amule-dlp/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amulecmd $(1)/usr/bin/amulecmd
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amuled $(1)/usr/bin/amuled
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amuleweb $(1)/usr/bin/amuleweb
$(INSTALL_DIR) $(1)/usr/share
$(CP) $(PKG_INSTALL_DIR)/usr/share/amule-dlp $(1)/usr/share/
$(CP) $(PKG_BUILD_DIR)/AmuleWebUI-Reloaded-master $(1)/usr/share/amule-dlp/webserver/AmuleWebUI-Reloaded
endef
$(eval $(call Download,AmuleWebUI))
$(eval $(call BuildPackage,amule-dlp))

View File

@ -1,22 +0,0 @@
From 0a9c99fe35b68725036ed7109954327dffc31323 Mon Sep 17 00:00:00 2001
From: kiddin9 <48883331+kiddin9@users.noreply.github.com>
Date: Sun, 12 Sep 2021 05:31:27 +0800
Subject: [PATCH] Update Path.cpp
---
src/libs/common/Path.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libs/common/Path.cpp b/src/libs/common/Path.cpp
index b70e937f2..0e162bbc3 100644
--- a/src/libs/common/Path.cpp
+++ b/src/libs/common/Path.cpp
@@ -230,7 +230,7 @@ CPath::CPath(const wxString& filename)
}
wxCharBuffer fn = filename2char(filename);
- if (fn.data() && fn.length()) {
+ 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

@ -1,22 +0,0 @@
--- a/m4/libupnp.m4
+++ b/m4/libupnp.m4
@@ -57,7 +57,6 @@ dnl Test for --with-libupnp-prefix
])
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], [
@@ -84,11 +83,6 @@ dnl Check for libupnp >= MIN_LIBUPNP_VER
])
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

@ -1,39 +0,0 @@
diff --git a/src/DLP.cpp b/src/DLP.cpp
index 7016598..d06c2d0 100644
--- a/src/DLP.cpp
+++ b/src/DLP.cpp
@@ -62,6 +62,7 @@ bool DLP::DLPCheck(CUpDownClient* c){
CString clientver(c->GetClientVerString());
CString uname(c->GetUserName());
CString uhash(wxString(c->GetUserHash().EncodeSTL().c_str(), wxConvUTF8));
+ CString fullip(Uint32_16toStringIP_Port(c->GetConnectIP(),c->GetUserPort()));
//CheckGhostMod
if(prefs & PF_GHOSTMOD) {
@@ -89,7 +90,6 @@ bool DLP::DLPCheck(CUpDownClient* c){
}
}
-
// Check VeryCD eMule
if ((prefs & PF_VERYCDEMULE) && (tmp == NULL)) {
if(modver.Find(wxT("VeryCD")) != wxNOT_FOUND){
@@ -97,11 +97,16 @@ bool DLP::DLPCheck(CUpDownClient* c){
tmp = ret.c_str();
}
}
-
+
+ if (c->HasLowID() && (tmp == NULL)) {
+ ret = _("Ban Low ID");
+ tmp = ret.c_str();
+ }
+
if (tmp != NULL) {
ret = tmp;
wxString wxInfo;
- wxInfo.Printf(wxT("[%s] %s"), ret.c_str(), c->GetClientFullInfo().c_str());
+ wxInfo.Printf(wxT("_%s_%s_%s_%s_%s"), uhash.c_str(), ret.c_str(), fullip.c_str(), clientver.c_str(), uname.c_str());
c->Ban();
theApp->AddDLPMessageLine(wxInfo);
return true;

View File

@ -1,10 +0,0 @@
--- a/src/libs/common/MuleDebug.cpp
+++ b/src/libs/common/MuleDebug.cpp
@@ -56,6 +56,7 @@
#include <vector>
+#include <exception>
/**
* This functions displays a verbose description of

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,161 +0,0 @@
--[[
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
page.acl_depends = { "luci-app-amule" }
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

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

@ -1,56 +0,0 @@
<!-- ++ 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="btn 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="btn 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

@ -1,84 +0,0 @@
<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="btn 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 url = window.location.host+":<%=luci.sys.exec("uci -q get amule.main.web_port"):gsub("^%s*(.-)%s*$", "%1")%>";
window.open('http://'+url,'target','');
};
//]]>
</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

@ -1,90 +0,0 @@
<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="btn 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="btn 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

@ -1 +0,0 @@
zh_Hans

View File

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

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

@ -1,71 +0,0 @@
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 '1'
option add_server_list_from_client '1'
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 '1'
option upnp_enabled '0'
option proxy_type 'socks5'
option template 'AmuleWebUI-Reloaded'
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

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

@ -1,179 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2015 OpenWrt.org
START=99
USE_PROCD=1
LIST_SEP="
"
service_triggers() {
procd_add_reload_trigger amule
}
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

@ -1,27 +0,0 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@amule[-1]
add ucitrack amule
set ucitrack.@amule[-1].init=amule
commit ucitrack
EOF
chmod +x /etc/init.d/amule
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 )
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

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

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-xray
PKG_VERSION:=1.26.0
PKG_VERSION:=1.26.1
PKG_RELEASE:=1
PKG_LICENSE:=MPLv2

View File

@ -93,7 +93,7 @@ setup_dnsmasq() {
}
flush_dnsmasq() {
rm /tmp/dnsmasq.d/xray.conf
rm -f /tmp/dnsmasq.d/xray.conf
/etc/init.d/dnsmasq restart > /dev/null 2>&1
}

View File

@ -21,7 +21,7 @@ flush_firewall() {
ip route del local default dev lo table 252
logger -st xray[$$] -p4 "Flushing firewall4 rules..."
rm /var/etc/xray/firewall_include.nft
rm -f /var/etc/xray/firewall_include.nft
logger -st xray[$$] -p4 "Triggering firewall4 restart..."
/etc/init.d/firewall restart > /dev/null 2>&1