update 03-25 09:18

This commit is contained in:
github-actions[bot] 2022-03-25 09:18:46 +08:00
parent 34c161825a
commit 22d254ece2
493 changed files with 10061 additions and 57584 deletions

View File

@ -0,0 +1,83 @@
# SPDX-Identifier-License: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic-Go
PKG_VERSION:=0.2.13
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/cnsilvan/UnblockNeteaseMusic/tar.gz/$(PKG_VERSION)?
PKG_HASH:=skip
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_CONFIG_DEPENDS:= \
CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY \
CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX
PKG_BUILD_DIR:=$(BUILD_DIR)/$(firstword $(subst -, ,$(PKG_NAME)))-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/cnsilvan/UnblockNeteaseMusic
GO_PKG_BUILD_PKG:=$$(GO_PKG)
GO_PKG_LDFLAGS:=-s -w
COMPILE_TIME:= $(shell TZ=UTC-8 date '+%Y-%m-%d %H:%M:%S')
GO_PKG_LDFLAGS+= \
-X '$(GO_PKG)/version.Version=$(PKG_VERSION)' \
-X '$(GO_PKG)/version.BuildTime=$(COMPILE_TIME)' \
-X '$(GO_PKG)/version.ExGoVersionInfo=$(GO_ARM) $(GO_MIPS)$(GO_MIPS64)'
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/UnblockNeteaseMusic-Go/config
config UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX
bool "Compress executable files with UPX"
depends on !mips64
default n
endef
ifeq ($(CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.io
endif
define Package/UnblockNeteaseMusic-Go
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE:=Revive Netease Cloud Music (Golang)
URL:=https://github.com/cnsilvan/UnblockNeteaseMusic
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Build/Compile
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_GOST_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/UnblockNeteaseMusic
endif
endef
define Package/UnblockNeteaseMusic-Go/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/UnblockNeteaseMusic $(1)/usr/bin/UnblockNeteaseMusic
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusicGo
$(CP) ./files/* $(1)/usr/share/UnblockNeteaseMusicGo/
endef
$(eval $(call GoBinPackage,UnblockNeteaseMusic-Go))
$(eval $(call BuildPackage,UnblockNeteaseMusic-Go))

View File

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

View File

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

View File

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

View File

@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic
PKG_BASE_VERSION:=0.27.0-rc.4
PKG_RELEASE:=102
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/UnblockNeteaseMusic/server.git
PKG_SOURCE_DATE:=2021-12-21
PKG_SOURCE_VERSION:=027e0df75eda788b7de9ddf1467040b635a3e3c8
PKG_SOURCE_VERSION:=54b7a60b07a85dea3b52a5d9f1ada456aba12609
PKG_MIRROR_HASH:=skip
PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))

View File

@ -6,11 +6,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=adguardhome
PKG_VERSION:=0.108.0-b.5
PKG_VERSION:=0.107.5
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=2c33ab6a92c7066a26e68b6fff0fa04d8218f054
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/AdguardTeam/AdGuardHome
PKG_MIRROR_HASH:=skip
@ -30,7 +30,7 @@ GO_PKG_BUILD_PKG:=github.com/AdguardTeam/AdGuardHome
AGH_BUILD_TIME:=$(shell date -d @$(SOURCE_DATE_EPOCH) +%FT%TZ%z)
AGH_VERSION_PKG:=github.com/AdguardTeam/AdGuardHome/internal/version
GO_PKG_LDFLAGS_X:=$(AGH_VERSION_PKG).channel=release \
$(AGH_VERSION_PKG).version=v$(PKG_VERSION) \
$(AGH_VERSION_PKG).version=$(PKG_SOURCE_VERSION) \
$(AGH_VERSION_PKG).buildtime=$(AGH_BUILD_TIME) \
$(AGH_VERSION_PKG).goarm=$(GO_ARM) \
$(AGH_VERSION_PKG).gomips=$(GO_MIPS)

View File

@ -1,9 +0,0 @@
--- a/client/src/helpers/version.js
+++ b/client/src/helpers/version.js
@@ -13,5 +13,5 @@ export const areEqualVersions = (left, right) => {
const leftVersion = left.replace(/^v/, '');
const rightVersion = right.replace(/^v/, '');
- return leftVersion === rightVersion;
+ return leftVersion >= rightVersion;
};

117
amule-dlp/Makefile Normal file
View File

@ -0,0 +1,117 @@
#
# 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:=+libpng +libpthread +libncurses +libreadline +libwxbase +libupnp +libbfd +antileech \
$(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

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

@ -0,0 +1,39 @@
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,49 +1,51 @@
# SDPX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021-2022 ImmortalWrt.org
# 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_NAME:=aMule
PKG_VERSION:=2.3.3
PKG_RELEASE:=$(AUTORELEASE)
PKG_RELEASE:=3
PKG_REV=4b87b20
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/amule-project/amule/tar.gz/$(PKG_VERSION)?
PKG_HASH:=skip
PKG_CONFIG_DEPEDS:= CONFIG_AMULE_CRYPTOPP_STATIC_LINKING
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_MIRROR_HASH:=skip
PKG_FIXUP:=autoreconf
PKG_BUILD_DEPENDS:=libcryptopp libgd
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
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
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/config
config AMULE_CRYPTOPP_STATIC_LINKING
bool "Link libcryptopp statically"
default n
endef
TARGET_LDFLAGS+= -liconv
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 +libbfd \
$(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 \
@ -57,13 +59,11 @@ CONFIGURE_ARGS+= \
--disable-ed2k \
--disable-alc \
--disable-alcc \
--disable-debug \
--disable-fileview \
--disable-plasmamule \
--without-wxdebug \
--enable-dlp \
--enable-upnp \
--with-gnu-ld \
--with-zlib="$(STAGING_DIR)/usr" \
--with-gdlib-prefix="$(STAGING_DIR)/usr" \
--with-libpng-prefix="$(STAGING_DIR)/usr" \
@ -72,27 +72,39 @@ CONFIGURE_ARGS+= \
--with-libiconv-prefix="$(ICONV_PREFIX)" \
--with-libintl-prefix="$(INTL_PREFIX)" \
--with-libupnp-prefix="$(STAGING_DIR)/usr" \
--without-x
--without-x \
--disable-debug
TARGET_LDFLAGS += -liconv
MAKE_FLAGS += HOSTCC="$(HOSTCC)"
define Build/Configure
cd $(PKG_BUILD_DIR); $(SHELL) autogen.sh
cd $(PKG_BUILD_DIR) && sh ./autogen.sh
$(call Build/Configure/Default)
endef
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
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_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 $(1)/usr/share/
$(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))

View File

@ -0,0 +1,25 @@
From 46ecaeadff4c07b8fd98cf41e27605895328ce0a Mon Sep 17 00:00:00 2001
From: W_Y_CPP <383152993@qq.com>
Date: Thu, 2 Dec 2021 00:46:12 -0800
Subject: [PATCH] fix API mismatch with crypto++ 6.0.0
---
src/ClientCreditsList.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ClientCreditsList.cpp b/src/ClientCreditsList.cpp
index d61e8d4..b02e162 100644
--- a/src/ClientCreditsList.cpp
+++ b/src/ClientCreditsList.cpp
@@ -312,7 +312,7 @@ void CClientCreditsList::InitalizeCrypting()
// calculate and store public key
CryptoPP::RSASSA_PKCS1v15_SHA_Verifier pubkey(*static_cast<CryptoPP::RSASSA_PKCS1v15_SHA_Signer *>(m_pSignkey));
CryptoPP::ArraySink asink(m_abyMyPublicKey, 80);
- pubkey.DEREncode(asink);
+ pubkey.GetMaterial().Save(asink);
m_nMyPublicKeyLen = asink.TotalPutLength();
asink.MessageEnd();
} catch (const CryptoPP::Exception& e) {
--
2.17.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
From dcc605e06e106b05bc5e756eeeeb17abbc1a6e5c Mon Sep 17 00:00:00 2001
From: W_Y_CPP <383152993@qq.com>
Date: Wed, 1 Dec 2021 23:13:08 -0800
Subject: [PATCH] fix set_terminate
---
src/libs/common/MuleDebug.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libs/common/MuleDebug.cpp b/src/libs/common/MuleDebug.cpp
index 5d8d758..14206f9 100644
--- a/src/libs/common/MuleDebug.cpp
+++ b/src/libs/common/MuleDebug.cpp
@@ -24,7 +24,7 @@
//
#include <cstdlib> // Needed for std::abort()
-
+#include <exception>
#ifdef HAVE_CONFIG_H
# include "config.h" // Needed for HAVE_CXXABI and HAVE_EXECINFO
#endif
--
2.17.1

View File

@ -1,6 +1,7 @@
--- a/configure.ac
+++ b/configure.ac
@@ -91,6 +91,14 @@ MULE_IF_ENABLED([static], [MULE_APPEND([
diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac 2016-10-06 19:01:54.000000000 +0800
+++ b/configure.ac 2016-10-14 12:33:51.660347919 +0800
@@ -89,6 +89,14 @@
KDE_CONFIG_OPTIONS
QT_CONFIG_OPTIONS
@ -15,8 +16,8 @@
# Default is yes, because they're most likely compatible.
# However, this is only used when cross-compiling.
AC_ARG_WITH(
@@ -451,6 +459,8 @@ AM_CONDITIONAL(NEED_CORESERVICES, test x
AM_CONDITIONAL(COMPILE_NLS, test x$USE_NLS = xyes)
@@ -457,6 +465,8 @@
AM_CONDITIONAL(GENERATE_FLEX_HEADER, test x$HAVE_FLEX_EXTENDED = xyes)
AM_CONDITIONAL(INSTALL_SKINS, test MULE_IS_ENABLED_ANY([monolithic, amule-gui]))
AM_CONDITIONAL(PLASMAMULE, test MULE_IS_ENABLED([plasmamule]))
+#Dynamic Leech Protection - Bill Lee
@ -24,17 +25,18 @@
AM_CONDITIONAL([COMPILE_LIB_COMMON], [test MULE_IS_ENABLED_ANY([monolithic, amule-daemon, amulecmd, webserver, amule-gui, fileview])])
AM_CONDITIONAL([COMPILE_LIB_EC], [test MULE_IS_ENABLED_ANY([monolithic, amule-daemon, amulecmd, webserver, amule-gui])])
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -7,6 +7,7 @@
diff -Naur a/po/zh_CN.po b/po/zh_CN.po
--- a/po/zh_CN.po 2016-10-06 19:01:54.000000000 +0800
+++ b/po/zh_CN.po 2016-10-14 12:33:51.662347964 +0800
@@ -5,6 +5,7 @@
# xiaoqiao <29551030@qq.com>, 2007, 2008.
# JimHu <jimhuyiwei@gmail.com>, 2009.
# Xiaoqiao <wo@xiaoqiao.me>, 2010.
+# Bill Lee <bill.lee.y@gmail.com>, 2010, 2011.
# Yi Qi <u4781098@anu.edu.au>, 2011.
# Yi Qi <u4781098@anu.edu.au>,2011.
#
msgid ""
@@ -471,6 +472,12 @@ msgstr " 版权所有 (c) 2002-2011 Peta
@@ -467,6 +468,12 @@
msgid "http://kademlia.scs.cs.nyu.edu\n"
msgstr "http://kademlia.scs.cs.nyu.edu\n"
@ -44,22 +46,22 @@
+msgid " Homepage: http://amule-dlp.googlecode.com \n"
+msgstr " 主页http://amule-dlp.googlecode.com \n"
+
#: src/amuleDlg.cpp:509 src/KadDlg.cpp:193 src/PartFile.cpp:919
#: src/PartFile.cpp:927 src/PrefsUnifiedDlg.cpp:637 src/PrefsUnifiedDlg.cpp:742
#: src/PrefsUnifiedDlg.cpp:862
@@ -3824,6 +3831,9 @@ msgstr "按此按钮清空日志."
msgid "Click on this button to update the servers list from URL ..."
msgstr "按此按钮从该网址更新服务器列表 ..."
#: src/amuleDlg.cpp:512 src/KadDlg.cpp:193 src/PartFile.cpp:918
#: src/PartFile.cpp:926 src/PrefsUnifiedDlg.cpp:629
#: src/PrefsUnifiedDlg.cpp:734 src/PrefsUnifiedDlg.cpp:847
@@ -3856,6 +3863,9 @@
msgid "Click on this button to update the nodes list from URL ..."
msgstr "按此更新节点列表自网址..."
+msgid "DLP Info"
+msgstr "动态反吸血信息"
+
#: src/muuli_wdr.cpp:2535
msgid "Server list"
msgstr "服务器列表"
@@ -7448,6 +7458,48 @@ msgstr "已请求注销\n"
msgid "Processing request [redirected]: "
msgstr "正在处理请求 [已重定向]"
#: src/muuli_wdr.cpp:2649
msgid "Nodes (0)"
msgstr "节点0"
@@ -7682,6 +7692,48 @@
#~ "\n"
#~ "此外,浏览器设定已经被重设为系统默认值。如有必要,请重新配置浏览器选项。\n"
+msgid "Dynamic Leecher Protection Options"
+msgstr "动态反吸血保护选项"
@ -103,11 +105,12 @@
+msgid "Succeed loading antiLeech! Version: %d"
+msgstr "成功加载 antiLeech! 版本: %d"
+
#~ msgid ""
#~ "Invalid URL for HTTP download or HTTP redirection (did you forget "
#~ "'http://' ?)"
--- a/src/BaseClient.cpp
+++ b/src/BaseClient.cpp
#~ msgid "Fetching status..."
#~ msgstr "正在获取状态..."
diff -Naur a/src/BaseClient.cpp b/src/BaseClient.cpp
--- a/src/BaseClient.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/BaseClient.cpp 2016-10-14 12:35:45.793953665 +0800
@@ -1,4 +1,3 @@
-//
// This file is part of the aMule Project.
@ -136,7 +139,7 @@
// some client testing variables
static wxString crash_name = wxT("[Invalid User Name]");
static wxString empty_name = wxT("[Empty User Name]");
@@ -290,6 +292,10 @@ void CUpDownClient::Init()
@@ -290,6 +292,10 @@
m_cMessagesReceived = 0;
m_cMessagesSent = 0;
@ -147,7 +150,7 @@
}
@@ -635,6 +641,15 @@ bool CUpDownClient::ProcessHelloTypePack
@@ -635,6 +641,15 @@
m_fSharedDirectories = 1;
dwEmuleTags |= 4;
break;
@ -163,7 +166,7 @@
}
}
@@ -717,6 +732,11 @@ bool CUpDownClient::ProcessHelloTypePack
@@ -717,6 +732,11 @@
Kademlia::CKademlia::Bootstrap(wxUINT32_SWAP_ALWAYS(GetIP()), GetKadPort());
}
@ -175,7 +178,7 @@
return bIsMule;
}
@@ -966,6 +986,14 @@ bool CUpDownClient::ProcessMuleInfoPacke
@@ -966,6 +986,14 @@
% GetClientFullInfo()
);
@ -190,7 +193,7 @@
break;
}
}
@@ -1003,6 +1031,11 @@ bool CUpDownClient::ProcessMuleInfoPacke
@@ -1003,6 +1031,11 @@
m_byInfopacketsReceived |= IP_EMULEPROTPACK;
}
@ -202,7 +205,7 @@
return (protocol_version == 0xFF); // This was a OS_Info?
}
@@ -2303,7 +2336,7 @@ bool CUpDownClient::CheckHandshakeFinish
@@ -2302,7 +2335,7 @@
}
@ -211,8 +214,9 @@
wxString CUpDownClient::GetClientFullInfo()
{
if (m_clientVerString.IsEmpty()) {
--- /dev/null
+++ b/src/CString_wx.h
diff -Naur a/src/CString_wx.h b/src/CString_wx.h
--- a/src/CString_wx.h 1970-01-01 08:00:00.000000000 +0800
+++ b/src/CString_wx.h 2016-10-14 12:33:51.664348010 +0800
@@ -0,0 +1,59 @@
+/**
+ * Author: Bill Lee<bill.lee.y@gmail.com>
@ -273,8 +277,9 @@
+ }
+};
+#endif
--- /dev/null
+++ b/src/DLP.cpp
diff -Naur a/src/DLP.cpp b/src/DLP.cpp
--- a/src/DLP.cpp 1970-01-01 08:00:00.000000000 +0800
+++ b/src/DLP.cpp 2016-10-14 12:33:51.664348010 +0800
@@ -0,0 +1,190 @@
+// Copyright (C) 2011 Bill Lee <bill.lee.y@gmail.com>
+//
@ -466,8 +471,9 @@
+ antiLeechLib.Load(file);
+ return antiLeechLib.IsLoaded();
+}
--- /dev/null
+++ b/src/DLP.h
diff -Naur a/src/DLP.h b/src/DLP.h
--- a/src/DLP.h 1970-01-01 08:00:00.000000000 +0800
+++ b/src/DLP.h 2016-10-14 12:33:51.665348032 +0800
@@ -0,0 +1,45 @@
+// Copyright (C) 2011 Bill Lee <bill.lee.y@gmail.com>
+//
@ -514,8 +520,9 @@
+
+ bool LoadFrom(wxString& file);
+};
--- /dev/null
+++ b/src/DLPPref.h
diff -Naur a/src/DLPPref.h b/src/DLPPref.h
--- a/src/DLPPref.h 1970-01-01 08:00:00.000000000 +0800
+++ b/src/DLPPref.h 2016-10-14 12:33:51.665348032 +0800
@@ -0,0 +1,15 @@
+#ifndef ANTILEECH_AMULE_H
+#define ANTILEECH_AMULE_H
@ -532,9 +539,10 @@
+#define PF_GHOSTMOD 0x100
+
+#endif
--- a/src/DownloadQueue.cpp
+++ b/src/DownloadQueue.cpp
@@ -623,6 +623,15 @@ void CDownloadQueue::CheckAndAddSource(C
diff -Naur a/src/DownloadQueue.cpp b/src/DownloadQueue.cpp
--- a/src/DownloadQueue.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/DownloadQueue.cpp 2016-10-14 12:33:51.665348032 +0800
@@ -623,6 +623,15 @@
return;
}
@ -550,9 +558,10 @@
// Filter sources which are known to be dead/useless
if ( theApp->clientlist->IsDeadSource( source ) || sender->IsDeadSource(source) ) {
source->Safe_Delete();
--- a/src/ExternalConn.cpp
+++ b/src/ExternalConn.cpp
@@ -55,6 +55,9 @@
diff -Naur a/src/ExternalConn.cpp b/src/ExternalConn.cpp
--- a/src/ExternalConn.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/ExternalConn.cpp 2016-10-14 12:33:51.666348055 +0800
@@ -57,6 +57,9 @@
#include "kademlia/kademlia/UDPFirewallTester.h"
#include "Statistics.h"
@ -562,7 +571,7 @@
//-------------------- File_Encoder --------------------
@@ -1388,6 +1391,15 @@ CECPacket *CECServerSocket::ProcessReque
@@ -1384,6 +1387,15 @@
}
}
break;
@ -578,9 +587,10 @@
//
// Status requests
//
--- a/src/Logger.cpp
+++ b/src/Logger.cpp
@@ -297,6 +297,8 @@ void CLogger::FlushApplog()
diff -Naur a/src/Logger.cpp b/src/Logger.cpp
--- a/src/Logger.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/Logger.cpp 2016-10-14 12:40:22.827322335 +0800
@@ -297,6 +297,8 @@
}
CLogger theLogger;
@ -589,9 +599,10 @@
BEGIN_EVENT_TABLE(CLogger, wxEvtHandler)
EVT_MULE_LOGGING(CLogger::OnLoggingEvent)
--- a/src/Logger.h
+++ b/src/Logger.h
@@ -310,6 +310,8 @@ private:
diff -Naur a/src/Logger.h b/src/Logger.h
--- a/src/Logger.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/Logger.h 2016-10-14 12:41:14.694519856 +0800
@@ -310,6 +310,8 @@
};
extern CLogger theLogger;
@ -600,7 +611,7 @@
/**
* This class forwards log-lines from wxWidgets to CLogger.
@@ -456,5 +458,8 @@ public:
@@ -456,5 +458,8 @@
#define AddLogLineF(string) theLogger.AddLogLine(__TFILE__, __LINE__, false, logStandard, string, false, false)
#endif
@ -609,9 +620,10 @@
+
#endif
// File_checked_for_headers
--- a/src/LoggerConsole.cpp
+++ b/src/LoggerConsole.cpp
@@ -94,6 +94,8 @@ void CLogger::AddLogLine(
diff -Naur a/src/LoggerConsole.cpp b/src/LoggerConsole.cpp
--- a/src/LoggerConsole.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/LoggerConsole.cpp 2016-10-14 12:41:54.805446813 +0800
@@ -85,6 +85,8 @@
}
CLogger theLogger;
@ -620,9 +632,10 @@
BEGIN_EVENT_TABLE(CLogger, wxEvtHandler)
END_EVENT_TABLE()
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -178,6 +178,13 @@ core_sources = \
diff -Naur a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am 2016-10-06 19:01:54.000000000 +0800
+++ b/src/Makefile.am 2016-10-14 12:33:51.666348055 +0800
@@ -179,6 +179,13 @@
kademlia/routing/RoutingZone.cpp
@ -636,9 +649,10 @@
gui_sources = \
amule-gui.cpp \
amuleDlg.cpp \
--- a/src/Preferences.cpp
+++ b/src/Preferences.cpp
@@ -49,6 +49,11 @@
diff -Naur a/src/Preferences.cpp b/src/Preferences.cpp
--- a/src/Preferences.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/Preferences.cpp 2016-10-14 12:33:51.667348078 +0800
@@ -51,6 +51,11 @@
#include "UserEvents.h"
@ -650,7 +664,7 @@
#ifndef AMULE_DAEMON
#include <wx/valgen.h>
#include "muuli_wdr.h"
@@ -343,6 +348,19 @@ protected:
@@ -344,6 +349,19 @@
wxWindow* m_widget;
};
@ -670,7 +684,7 @@
/** Cfg class for wxStrings. */
class Cfg_Str : public Cfg_Tmpl<wxString>
@@ -952,6 +970,11 @@ CPreferences::CPreferences()
@@ -953,6 +971,11 @@
s_userhash[5] = 14;
s_userhash[14] = 111;
@ -682,7 +696,7 @@
#ifndef CLIENT_GUI
LoadPreferences();
ReloadSharedFolders();
@@ -1061,6 +1084,20 @@ void CPreferences::BuildItemList( const
@@ -1062,6 +1085,20 @@
NewCfgItem( IDC_NETWORKKAD, (new Cfg_Bool( wxT("/eMule/ConnectToKad"), s_ConnectToKad, true )) );
NewCfgItem( IDC_NETWORKED2K, ( new Cfg_Bool( wxT("/eMule/ConnectToED2K"), s_ConnectToED2K, true ) ));
@ -703,7 +717,7 @@
/**
* Files
@@ -1471,6 +1508,11 @@ void CPreferences::Save()
@@ -1471,6 +1508,11 @@
}
SavePreferences();
@ -715,7 +729,7 @@
#ifndef CLIENT_GUI
CTextFile sdirfile;
@@ -1483,6 +1525,21 @@ void CPreferences::Save()
@@ -1483,6 +1525,21 @@
#endif
}
@ -737,9 +751,10 @@
CPreferences::~CPreferences()
{
--- a/src/Preferences.h
+++ b/src/Preferences.h
@@ -580,6 +580,11 @@ public:
diff -Naur a/src/Preferences.h b/src/Preferences.h
--- a/src/Preferences.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/Preferences.h 2016-10-14 12:33:51.667348078 +0800
@@ -579,6 +579,11 @@
// Sleep
static bool GetPreventSleepWhileDownloading() { return s_preventSleepWhileDownloading; }
static void SetPreventSleepWhileDownloading(bool status) { s_preventSleepWhileDownloading = status; }
@ -751,7 +766,7 @@
protected:
static int32 GetRecommendedMaxConnections();
@@ -600,6 +605,11 @@ protected:
@@ -599,6 +604,11 @@
private:
void LoadPreferences();
void SavePreferences();
@ -763,7 +778,7 @@
protected:
static wxString s_configDir;
@@ -815,6 +825,20 @@ protected:
@@ -813,6 +823,20 @@
// Stats server
static wxString s_StatsServerName;
static wxString s_StatsServerURL;
@ -784,8 +799,9 @@
};
--- a/src/PrefsUnifiedDlg.cpp
+++ b/src/PrefsUnifiedDlg.cpp
diff -Naur a/src/PrefsUnifiedDlg.cpp b/src/PrefsUnifiedDlg.cpp
--- a/src/PrefsUnifiedDlg.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/PrefsUnifiedDlg.cpp 2016-10-14 12:33:51.668348101 +0800
@@ -53,6 +53,11 @@
#include "UserEvents.h"
#include "PlatformSpecific.h" // Needed for PLATFORMSPECIFIC_CAN_PREVENT_SLEEP_MODE
@ -798,7 +814,7 @@
BEGIN_EVENT_TABLE(PrefsUnifiedDlg,wxDialog)
// Events
#define USEREVENTS_EVENT(ID, NAME, VARS) \
@@ -114,6 +119,11 @@ BEGIN_EVENT_TABLE(PrefsUnifiedDlg,wxDial
@@ -114,6 +119,11 @@
EVT_CHOICE(IDC_COLORSELECTOR, PrefsUnifiedDlg::OnColorCategorySelected)
EVT_LIST_ITEM_SELECTED(ID_PREFSLISTCTRL,PrefsUnifiedDlg::OnPrefsPageChange)
@ -810,7 +826,7 @@
EVT_INIT_DIALOG(PrefsUnifiedDlg::OnInitDialog)
EVT_COMMAND_SCROLL(IDC_SLIDER, PrefsUnifiedDlg::OnScrollBarChange)
@@ -187,6 +197,9 @@ PrefsPage pages[] =
@@ -187,6 +197,9 @@
{ wxTRANSLATE("Online Signature"), PreferencesOnlineSigTab, 21 },
{ wxTRANSLATE("Advanced"), PreferencesaMuleTweaksTab, 12 },
{ wxTRANSLATE("Events"), PreferencesEventsTab, 5 }
@ -820,7 +836,7 @@
#ifdef __DEBUG__
,{ wxTRANSLATE("Debugging"), PreferencesDebug, 25 }
#endif
@@ -1096,6 +1109,21 @@ void PrefsUnifiedDlg::OnButtonIPFilterUp
@@ -1076,6 +1089,21 @@
theApp->ipfilter->Update( CastChild( IDC_IPFILTERURL, wxTextCtrl )->GetValue() );
}
@ -842,9 +858,10 @@
void PrefsUnifiedDlg::OnPrefsPageChange(wxListEvent& event)
{
--- a/src/PrefsUnifiedDlg.h
+++ b/src/PrefsUnifiedDlg.h
@@ -124,6 +124,9 @@ protected:
diff -Naur a/src/PrefsUnifiedDlg.h b/src/PrefsUnifiedDlg.h
--- a/src/PrefsUnifiedDlg.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/PrefsUnifiedDlg.h 2016-10-14 12:33:51.668348101 +0800
@@ -124,6 +124,9 @@
void OnUserEventSelected(wxListEvent& event);
void OnLanguageChoice(wxCommandEvent &event);
void CreateEventPanels(const int idx, const wxString& vars, wxWindow* parent);
@ -854,9 +871,10 @@
void OnInitDialog( wxInitDialogEvent& evt );
--- a/src/ServerWnd.cpp
+++ b/src/ServerWnd.cpp
@@ -46,6 +46,7 @@ BEGIN_EVENT_TABLE(CServerWnd,wxPanel)
diff -Naur a/src/ServerWnd.cpp b/src/ServerWnd.cpp
--- a/src/ServerWnd.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/ServerWnd.cpp 2016-10-14 12:33:51.668348101 +0800
@@ -46,6 +46,7 @@
EVT_BUTTON(ID_BTN_RESET, CServerWnd::OnBnClickedResetLog)
EVT_BUTTON(ID_BTN_RESET_SERVER, CServerWnd::OnBnClickedResetServerLog)
EVT_SPLITTER_SASH_POS_CHANGED(ID_SRV_SPLITTER,CServerWnd::OnSashPositionChanged)
@ -864,7 +882,7 @@
END_EVENT_TABLE()
@@ -152,6 +153,11 @@ void CServerWnd::OnBnClickedResetServerL
@@ -152,6 +153,11 @@
theApp->GetServerLog(true); // Reset it
}
@ -876,9 +894,10 @@
void CServerWnd::UpdateED2KInfo()
{
--- a/src/ServerWnd.h
+++ b/src/ServerWnd.h
@@ -50,6 +50,7 @@ private:
diff -Naur a/src/ServerWnd.h b/src/ServerWnd.h
--- a/src/ServerWnd.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/ServerWnd.h 2016-10-14 12:33:51.668348101 +0800
@@ -50,6 +50,7 @@
void OnBnClickedUpdateservermetfromurl(wxCommandEvent& evt);
void OnBnClickedResetLog(wxCommandEvent& evt);
void OnBnClickedResetServerLog(wxCommandEvent& evt);
@ -886,9 +905,10 @@
DECLARE_EVENT_TABLE()
};
--- a/src/TextClient.cpp
+++ b/src/TextClient.cpp
@@ -67,6 +67,7 @@ enum {
diff -Naur a/src/TextClient.cpp b/src/TextClient.cpp
--- a/src/TextClient.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/TextClient.cpp 2016-10-14 12:33:51.669348124 +0800
@@ -73,6 +73,7 @@
CMD_ID_RELOAD_SHARED,
CMD_ID_RELOAD_IPFILTER_LOCAL,
CMD_ID_RELOAD_IPFILTER_NET,
@ -896,7 +916,7 @@
CMD_ID_SET_IPFILTER_ON,
CMD_ID_SET_IPFILTER_OFF,
CMD_ID_SET_IPFILTER_CLIENTS_ON,
@@ -100,7 +101,6 @@ enum {
@@ -106,7 +107,6 @@
CMD_ID_DOWNLOAD,
// IDs for deprecated commands
CMD_ID_SET_IPFILTER
@ -904,7 +924,7 @@
};
// method to create a SearchFile
@@ -234,6 +234,12 @@ int CamulecmdApp::ProcessCommand(int Cmd
@@ -240,6 +240,12 @@
case CMD_ID_DISCONNECT_KAD:
request_list.push_back(new CECPacket(EC_OP_KAD_STOP));
break;
@ -917,7 +937,7 @@
case CMD_ID_RELOAD_SHARED:
request_list.push_back(new CECPacket(EC_OP_SHAREDFILES_RELOAD));
@@ -904,6 +910,9 @@ void CamulecmdApp::OnInitCommandSet()
@@ -903,6 +909,9 @@
tmp2->AddCommand(wxT("Net"), CMD_ID_RELOAD_IPFILTER_NET, wxTRANSLATE("Update IP filtering table from URL."),
wxTRANSLATE("If URL is omitted the URL from the preferences is used."), CMD_PARAM_OPTIONAL);
@ -927,9 +947,10 @@
tmp = m_commands.AddCommand(wxT("Connect"), CMD_ID_CONNECT, wxTRANSLATE("Connect to the network."),
wxTRANSLATE("This will connect to all networks that are enabled in Preferences.\nYou may also optionally specify a server address in IP:Port form, to connect to\nthat server only. The IP must be a dotted decimal IPv4 address,\nor a resolvable DNS name."), CMD_PARAM_OPTIONAL);
tmp->AddCommand(wxT("ED2K"), CMD_ID_CONNECT_ED2K, wxTRANSLATE("Connect to eD2k only."), wxEmptyString, CMD_PARAM_NEVER);
--- a/src/UploadQueue.cpp
+++ b/src/UploadQueue.cpp
@@ -390,6 +390,11 @@ void CUploadQueue::AddClientToQueue(CUpD
diff -Naur a/src/UploadQueue.cpp b/src/UploadQueue.cpp
--- a/src/UploadQueue.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/UploadQueue.cpp 2016-10-14 12:33:51.669348124 +0800
@@ -390,6 +390,11 @@
return;
}
@ -941,9 +962,10 @@
client->AddAskedCount();
client->SetLastUpRequest();
--- a/src/amule-gui.cpp
+++ b/src/amule-gui.cpp
@@ -333,6 +333,21 @@ wxString CamuleGuiApp::GetLog(bool reset
diff -Naur a/src/amule-gui.cpp b/src/amule-gui.cpp
--- a/src/amule-gui.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/amule-gui.cpp 2016-10-14 12:33:51.669348124 +0800
@@ -333,6 +333,21 @@
return CamuleApp::GetLog(reset);
}
@ -965,8 +987,9 @@
wxString CamuleGuiApp::GetServerLog(bool reset)
{
--- a/src/amule.cpp
+++ b/src/amule.cpp
diff -Naur a/src/amule.cpp b/src/amule.cpp
--- a/src/amule.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/amule.cpp 2016-10-14 12:33:51.670348146 +0800
@@ -23,7 +23,6 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
//
@ -975,7 +998,7 @@
#include "amule.h" // Interface declarations.
#include <csignal>
@@ -87,6 +86,11 @@
@@ -90,6 +89,11 @@
#include <wx/sysopt.h> // Do_not_auto_remove
#endif
@ -987,7 +1010,7 @@
#ifndef AMULE_DAEMON
#ifdef __WXMAC__
#include <CoreFoundation/CFBundle.h> // Do_not_auto_remove
@@ -517,6 +521,11 @@ bool CamuleApp::OnInit()
@@ -520,6 +524,11 @@
uploadqueue = new CUploadQueue();
ipfilter = new CIPFilter();
@ -999,7 +1022,7 @@
// Creates all needed listening sockets
wxString msg;
if (!ReinitializeNetwork(&msg)) {
@@ -2063,3 +2072,8 @@ DEFINE_LOCAL_EVENT_TYPE(wxEVT_CORE_SOURC
@@ -2062,3 +2071,8 @@
DEFINE_LOCAL_EVENT_TYPE(wxEVT_CORE_UDP_DNS_DONE)
DEFINE_LOCAL_EVENT_TYPE(wxEVT_CORE_SERVER_DNS_DONE)
// File_checked_for_headers
@ -1008,9 +1031,10 @@
+#ifdef AMULE_DLP
+DLP* theDLP;
+#endif
--- a/src/amule.h
+++ b/src/amule.h
@@ -134,6 +134,8 @@ protected:
diff -Naur a/src/amule.h b/src/amule.h
--- a/src/amule.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/amule.h 2016-10-14 12:42:22.776093625 +0800
@@ -135,6 +135,8 @@
bool m_geometryEnabled;
wxString m_geometryString;
wxString m_logFile;
@ -1019,7 +1043,7 @@
wxString m_appName;
wxString m_PidFile;
@@ -409,6 +411,7 @@ public:
@@ -410,6 +412,7 @@
wxString GetLog(bool reset = false);
wxString GetServerLog(bool reset = false);
void AddServerMessageLine(wxString &msg);
@ -1027,7 +1051,7 @@
DECLARE_EVENT_TABLE()
};
@@ -573,6 +576,8 @@ public:
@@ -573,6 +576,8 @@
virtual int ShowAlert(wxString msg, wxString title, int flags);
@ -1036,7 +1060,7 @@
DECLARE_EVENT_TABLE()
};
@@ -583,3 +588,8 @@ extern CamuleDaemonApp *theApp;
@@ -583,3 +588,8 @@
#endif // AMULE_H
// File_checked_for_headers
@ -1045,9 +1069,10 @@
+class DLP; //forward declaretion
+extern DLP* theDLP;
+#endif
--- a/src/amuleAppCommon.cpp
+++ b/src/amuleAppCommon.cpp
@@ -65,6 +65,9 @@ CamuleAppCommon::CamuleAppCommon()
diff -Naur a/src/amuleAppCommon.cpp b/src/amuleAppCommon.cpp
--- a/src/amuleAppCommon.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/amuleAppCommon.cpp 2016-10-14 12:44:08.981552362 +0800
@@ -65,6 +65,9 @@
m_configFile = wxT("amule.conf");
m_logFile = wxT("logfile");
@ -1057,7 +1082,7 @@
if (IsDaemon()) {
m_appName = wxT("aMuleD");
} else {
@@ -443,6 +446,21 @@ bool CamuleAppCommon::InitCommon(int arg
@@ -443,6 +446,21 @@
return false;
}
@ -1079,9 +1104,10 @@
// Load Preferences
CPreferences::BuildItemList(thePrefs::GetConfigDir());
CPreferences::LoadAllItems( wxConfigBase::Get() );
--- a/src/amuleDlg.cpp
+++ b/src/amuleDlg.cpp
@@ -311,7 +311,7 @@ m_clientSkinNames(CLIENT_SKIN_SIZE)
diff -Naur a/src/amuleDlg.cpp b/src/amuleDlg.cpp
--- a/src/amuleDlg.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/amuleDlg.cpp 2016-10-14 12:44:47.637582726 +0800
@@ -315,7 +315,7 @@
wxNotebook* logs_notebook = CastChild( ID_SRVLOG_NOTEBOOK, wxNotebook);
wxNotebook* networks_notebook = CastChild( ID_NETNOTEBOOK, wxNotebook);
@ -1090,7 +1116,7 @@
wxASSERT(networks_notebook->GetPageCount() == 2);
for (uint32 i = 0; i < logs_notebook->GetPageCount(); ++i) {
@@ -503,7 +503,12 @@ void CamuleDlg::OnAboutButton(wxCommandE
@@ -507,7 +507,12 @@
_("Part of aMule is based on \n") <<
_("Kademlia: Peer-to-peer routing based on the XOR metric.\n") <<
_(" Copyright (c) 2002-2011 Petar Maymounkov ( petar@post.harvard.edu )\n") <<
@ -1104,7 +1130,7 @@
if (m_is_safe_state) {
wxMessageBox(msg, _("Message"), wxOK | wxICON_INFORMATION, this);
@@ -655,8 +660,24 @@ void CamuleDlg::AddServerMessageLine(wxS
@@ -659,8 +664,24 @@
}
cv->ShowPosition(cv->GetLastPosition()-1);
}
@ -1129,7 +1155,7 @@
void CamuleDlg::ShowConnectionState(bool skinChanged)
{
@@ -1435,7 +1456,9 @@ void CamuleDlg::DoNetworkRearrange()
@@ -1456,7 +1477,9 @@
if (thePrefs::GetNetworkKademlia()) {
logs_notebook->AddPage(m_logpages[3].page, m_logpages[3].name);
}
@ -1140,9 +1166,10 @@
// Set the main window.
// If we have both networks active, activate a notebook to select between them.
// If only one is active, show the window directly without a surrounding one tab notebook.
--- a/src/amuleDlg.h
+++ b/src/amuleDlg.h
@@ -114,6 +114,9 @@ public:
diff -Naur a/src/amuleDlg.h b/src/amuleDlg.h
--- a/src/amuleDlg.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/amuleDlg.h 2016-10-14 12:33:51.671348169 +0800
@@ -114,6 +114,9 @@
void AddLogLine(const wxString& line);
void AddServerMessageLine(wxString& message);
@ -1152,7 +1179,7 @@
void ResetLog(int id);
void ShowUserCount(const wxString& info = wxEmptyString);
@@ -222,7 +225,7 @@ private:
@@ -231,7 +234,7 @@
WX_DECLARE_STRING_HASH_MAP(wxZipEntry*, ZipCatalog);
ZipCatalog cat;
@ -1161,9 +1188,10 @@
PageType m_networkpages[2];
bool LoadGUIPrefs(bool override_pos, bool override_size);
--- a/src/amuled.cpp
+++ b/src/amuled.cpp
@@ -783,4 +783,10 @@ int CamuleDaemonApp::ShowAlert(wxString
diff -Naur a/src/amuled.cpp b/src/amuled.cpp
--- a/src/amuled.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/amuled.cpp 2016-10-14 12:45:23.506600119 +0800
@@ -749,4 +749,10 @@
return 0; // That's neither yes nor no, ok, cancel
}
@ -1174,8 +1202,9 @@
+}
+
// File_checked_for_headers
--- /dev/null
+++ b/src/antiLeech.h
diff -Naur a/src/antiLeech.h b/src/antiLeech.h
--- a/src/antiLeech.h 1970-01-01 08:00:00.000000000 +0800
+++ b/src/antiLeech.h 2016-10-14 12:33:51.672348192 +0800
@@ -0,0 +1,48 @@
+#ifndef ANTILEECH_H
+#define ANTILEECH_H
@ -1225,8 +1254,9 @@
+extern "C" int destoryAntiLeechInstant(IantiLeech*);
+
+#endif
--- /dev/null
+++ b/src/antiLeech_wx.h
diff -Naur a/src/antiLeech_wx.h b/src/antiLeech_wx.h
--- a/src/antiLeech_wx.h 1970-01-01 08:00:00.000000000 +0800
+++ b/src/antiLeech_wx.h 2016-10-14 12:33:51.672348192 +0800
@@ -0,0 +1,49 @@
+#ifndef ANTILEECH_WX_H
+#define ANTILEECH_WX_H
@ -1277,9 +1307,10 @@
+#define _tcsicmp(a, b) wcscasecmp(a, b)
+
+#endif
--- a/src/libs/ec/abstracts/ECCodes.abstract
+++ b/src/libs/ec/abstracts/ECCodes.abstract
@@ -148,6 +148,8 @@ EC_OP_SERVER_SET_STATIC_PRIO 0x56
diff -Naur a/src/libs/ec/abstracts/ECCodes.abstract b/src/libs/ec/abstracts/ECCodes.abstract
--- a/src/libs/ec/abstracts/ECCodes.abstract 2016-10-06 19:01:54.000000000 +0800
+++ b/src/libs/ec/abstracts/ECCodes.abstract 2016-10-14 12:33:51.672348192 +0800
@@ -148,6 +148,8 @@
EC_OP_FRIEND 0x57
@ -1288,9 +1319,10 @@
[/Section]
[Section Content]
--- a/src/libs/ec/cpp/ECCodes.h
+++ b/src/libs/ec/cpp/ECCodes.h
@@ -121,7 +121,8 @@ enum ECOpCodes {
diff -Naur a/src/libs/ec/cpp/ECCodes.h b/src/libs/ec/cpp/ECCodes.h
--- a/src/libs/ec/cpp/ECCodes.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/libs/ec/cpp/ECCodes.h 2016-10-14 12:33:51.673348215 +0800
@@ -121,7 +121,8 @@
EC_OP_CLIENT_SWAP_TO_ANOTHER_FILE = 0x54,
EC_OP_SHARED_FILE_SET_COMMENT = 0x55,
EC_OP_SERVER_SET_STATIC_PRIO = 0x56,
@ -1300,7 +1332,7 @@
};
enum ECTagNames {
@@ -556,6 +557,7 @@ wxString GetDebugNameECOpCodes(uint8 arg
@@ -556,6 +557,7 @@
case 0x55: return wxT("EC_OP_SHARED_FILE_SET_COMMENT");
case 0x56: return wxT("EC_OP_SERVER_SET_STATIC_PRIO");
case 0x57: return wxT("EC_OP_FRIEND");
@ -1308,9 +1340,10 @@
default: return CFormat(wxT("unknown %d 0x%x")) % arg % arg;
}
}
--- a/src/libs/ec/java/ECCodes.java
+++ b/src/libs/ec/java/ECCodes.java
@@ -112,6 +112,7 @@ public final static byte EC_OP_CLIENT_SW
diff -Naur a/src/libs/ec/java/ECCodes.java b/src/libs/ec/java/ECCodes.java
--- a/src/libs/ec/java/ECCodes.java 2016-10-06 19:01:54.000000000 +0800
+++ b/src/libs/ec/java/ECCodes.java 2016-10-14 12:33:51.673348215 +0800
@@ -112,6 +112,7 @@
public final static byte EC_OP_SHARED_FILE_SET_COMMENT = 0x55;
public final static byte EC_OP_SERVER_SET_STATIC_PRIO = 0x56;
public final static byte EC_OP_FRIEND = 0x57;
@ -1318,9 +1351,10 @@
public final static short EC_TAG_STRING = 0x0000;
public final static short EC_TAG_PASSWD_HASH = 0x0001;
--- a/src/muuli_wdr.cpp
+++ b/src/muuli_wdr.cpp
@@ -1772,6 +1772,51 @@ wxSizer *PreferencesServerTab( wxWindow
diff -Naur a/src/muuli_wdr.cpp b/src/muuli_wdr.cpp
--- a/src/muuli_wdr.cpp 2016-10-06 19:01:54.000000000 +0800
+++ b/src/muuli_wdr.cpp 2016-10-14 12:33:51.676348283 +0800
@@ -1769,6 +1769,51 @@
return item0;
}
@ -1372,7 +1406,7 @@
wxSizer *PreferencesFilesTab( wxWindow *parent, bool call_fit, bool set_sizer )
{
wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
@@ -2590,6 +2635,42 @@ wxSizer *serverListDlgUp( wxWindow *pare
@@ -2587,6 +2632,42 @@
return item0;
}
@ -1415,7 +1449,7 @@
wxSizer *serverListDlgDown( wxWindow *parent, bool call_fit, bool set_sizer )
{
wxStaticBox *item1 = new wxStaticBox( parent, -1, wxT("") );
@@ -2605,7 +2686,7 @@ wxSizer *serverListDlgDown( wxWindow *pa
@@ -2602,7 +2683,7 @@
wxPanel *item4 = new wxPanel( item3, -1 );
aMuleLog( item4, FALSE );
item3->AddPage( item4, _("aMule Log") );
@ -1424,7 +1458,7 @@
wxPanel *item5 = new wxPanel( item3, -1 );
ServerInfoLog( item5, FALSE );
item3->AddPage( item5, _("Server Info") );
@@ -2617,6 +2698,10 @@ wxSizer *serverListDlgDown( wxWindow *pa
@@ -2614,6 +2695,10 @@
wxPanel *item7 = new wxPanel( item3, -1 );
Kad_Info( item7, FALSE );
item3->AddPage( item7, _("Kad Info") );
@ -1435,21 +1469,22 @@
item0->Add( item2, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
--- a/src/muuli_wdr.h
+++ b/src/muuli_wdr.h
@@ -336,6 +336,10 @@ wxSizer *transferDlg( wxWindow *parent,
#define ID_BTN_RESET_SERVER 10241
diff -Naur a/src/muuli_wdr.h b/src/muuli_wdr.h
--- a/src/muuli_wdr.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/muuli_wdr.h 2016-10-14 12:33:51.676348283 +0800
@@ -335,6 +335,10 @@
#define ID_BTN_RESET_SERVER 10240
wxSizer *ServerInfoLog( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
+#define ID_DLPINFO 22001
+#define ID_BTN_RESET_DLP 22002
+wxSizer *DLPInfoLog( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
+
#define ID_LOGVIEW 10242
#define ID_BTN_RESET 10243
#define ID_LOGVIEW 10241
#define ID_BTN_RESET 10242
wxSizer *aMuleLog( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
@@ -425,6 +429,21 @@ wxSizer *CoreConnect( wxWindow *parent,
#define ID_DEBUGCATS 10308
@@ -424,6 +428,21 @@
#define ID_DEBUGCATS 10307
wxSizer *PreferencesDebug( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
+/* Dynamic Leecher Protection */
@ -1468,11 +1503,12 @@
+#endif
+
extern wxSizer *IDC_CURJOB;
#define IDC_CONV_PB_LABEL 10309
#define IDC_CONV_PROZENT 10310
--- a/src/updownclient.h
+++ b/src/updownclient.h
@@ -408,7 +408,13 @@ public:
#define IDC_CONV_PB_LABEL 10308
#define IDC_CONV_PROZENT 10309
diff -Naur a/src/updownclient.h b/src/updownclient.h
--- a/src/updownclient.h 2016-10-06 19:01:54.000000000 +0800
+++ b/src/updownclient.h 2016-10-14 12:37:03.224728226 +0800
@@ -408,7 +408,13 @@
bool GetSentCancelTransfer() const { return m_fSentCancelTransfer; }
void SetSentCancelTransfer(bool bVal) { m_fSentCancelTransfer = bVal; }
@ -1487,7 +1523,7 @@
wxString GetClientShortInfo();
const wxString& GetClientOSInfo() const { return m_sClientOSInfo; }
@@ -581,7 +587,10 @@ public:
@@ -581,7 +587,10 @@
bool ShouldReceiveCryptUDPPackets() const;
bool HasDisabledSharedFiles() const { return m_fNoViewSharedFiles; }
@ -1499,7 +1535,7 @@
private:
CClientCredits *credits;
@@ -842,6 +851,10 @@ private:
@@ -842,6 +851,10 @@
#ifdef __DEBUG__
wxString connection_reason;
#endif

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

@ -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

@ -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,365 @@
diff -Naur a/m4/libupnp.m4 b/m4/libupnp.m4
--- a/m4/libupnp.m4 2016-10-06 18:49:44.000000000 +0800
+++ b/m4/libupnp.m4 2019-12-11 22:13:19.008225399 +0800
@@ -45,11 +45,16 @@
dnl Test for --with-libupnp-prefix
AC_ARG_WITH(
- [libupnp-prefix],
- [AS_HELP_STRING(
+ [libupnp-prefix],[
+ AS_HELP_STRING(
[--with-libupnp-prefix=PREFIX],
- [UPnP library location])],
- [export PKG_CONFIG_PATH=$withval/lib/pkgconfig])
+ [UPnP library location])],[
+ AS_IF([test -d "$withval/lib64/pkgconfig"],[
+ export PKG_CONFIG_PATH=$withval/lib64/pkgconfig
+ ],[
+ export PKG_CONFIG_PATH=$withval/lib/pkgconfig
+ ])
+ ])
dnl Check for libupnp >= MIN_LIBUPNP_VERSION
AS_IF([test $cross_compiling = no], [
diff -Naur a/src/UPnPBase.cpp b/src/UPnPBase.cpp
--- a/src/UPnPBase.cpp 2016-10-06 18:49:44.000000000 +0800
+++ b/src/UPnPBase.cpp 2019-12-11 22:15:04.536768532 +0800
@@ -1127,7 +1127,11 @@
// This function is static
+#if UPNP_VERSION >= 10800
+int CUPnPControlPoint::Callback(Upnp_EventType_e EventType, const void *Event, void * /*Cookie*/)
+#else
int CUPnPControlPoint::Callback(Upnp_EventType EventType, void *Event, void * /*Cookie*/)
+#endif
{
std::ostringstream msg;
std::ostringstream msg2;
@@ -1149,24 +1153,47 @@
msg2<< "UPNP_DISCOVERY_SEARCH_RESULT: ";
// UPnP Discovery
upnpDiscovery:
+#if UPNP_VERSION >= 10800
+ UpnpDiscovery *d_event = (UpnpDiscovery *)Event;
+#else
struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)Event;
+#endif
IXML_Document *doc = NULL;
+#if UPNP_VERSION >= 10800
+ int errCode = UpnpDiscovery_get_ErrCode(d_event);
+ if (errCode != UPNP_E_SUCCESS) {
+ msg << UpnpGetErrorMessage(errCode) << ".";
+#else
int ret;
if (d_event->ErrCode != UPNP_E_SUCCESS) {
msg << UpnpGetErrorMessage(d_event->ErrCode) << ".";
+#endif
AddDebugLogLineC(logUPnP, msg);
}
// Get the XML tree device description in doc
+#if UPNP_VERSION >= 10800
+ const char *location = UpnpDiscovery_get_Location_cstr(d_event);
+ int ret = UpnpDownloadXmlDoc(location, &doc);
+#else
ret = UpnpDownloadXmlDoc(d_event->Location, &doc);
+#endif
if (ret != UPNP_E_SUCCESS) {
msg << "Error retrieving device description from " <<
+#if UPNP_VERSION >= 10800
+ location << ": " <<
+#else
d_event->Location << ": " <<
+#endif
UpnpGetErrorMessage(ret) <<
"(" << ret << ").";
AddDebugLogLineC(logUPnP, msg);
} else {
msg2 << "Retrieving device description from " <<
+#if UPNP_VERSION >= 10800
+ location << ".";
+#else
d_event->Location << ".";
+#endif
AddDebugLogLineN(logUPnP, msg2);
}
if (doc) {
@@ -1194,8 +1221,14 @@
AddDebugLogLineC(logUPnP, msg);
}
// Add the root device to our list
+#if UPNP_VERSION >= 10800
+ int expires = UpnpDiscovery_get_Expires(d_event);
+ upnpCP->AddRootDevice(rootDevice, urlBase,
+ location, expires);
+#else
upnpCP->AddRootDevice(rootDevice, urlBase,
d_event->Location, d_event->Expires);
+#endif
}
// Free the XML doc tree
IXML::Document::Free(doc);
@@ -1216,28 +1249,62 @@
case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
//fprintf(stderr, "Callback: UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE\n");
// UPnP Device Removed
+#if UPNP_VERSION >= 10800
+ UpnpDiscovery *dab_event = (UpnpDiscovery *)Event;
+ int errCode = UpnpDiscovery_get_ErrCode(dab_event);
+ if (errCode != UPNP_E_SUCCESS) {
+#else
struct Upnp_Discovery *dab_event = (struct Upnp_Discovery *)Event;
if (dab_event->ErrCode != UPNP_E_SUCCESS) {
+#endif
msg << "error(UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE): " <<
+#if UPNP_VERSION >= 10800
+ UpnpGetErrorMessage(errCode) <<
+#else
UpnpGetErrorMessage(dab_event->ErrCode) <<
+#endif
".";
AddDebugLogLineC(logUPnP, msg);
}
+#if UPNP_VERSION >= 10800
+ std::string devType = UpnpDiscovery_get_DeviceType_cstr(dab_event);
+#else
std::string devType = dab_event->DeviceType;
+#endif
// Check for an InternetGatewayDevice and removes it from the list
+
std::transform(devType.begin(), devType.end(), devType.begin(), tolower);
+
if (stdStringIsEqualCI(devType, UPnP::Device::IGW)) {
+#if UPNP_VERSION >= 10800
+ const char *deviceID =
+ UpnpDiscovery_get_DeviceID_cstr(dab_event);
+ upnpCP->RemoveRootDevice(deviceID);
+#else
upnpCP->RemoveRootDevice(dab_event->DeviceId);
+#endif
}
break;
}
case UPNP_EVENT_RECEIVED: {
//fprintf(stderr, "Callback: UPNP_EVENT_RECEIVED\n");
// Event reveived
+#if UPNP_VERSION >= 10800
+ UpnpEvent *e_event = (UpnpEvent *)Event;
+ int eventKey = UpnpEvent_get_EventKey(e_event);
+ IXML_Document *changedVariables =
+ UpnpEvent_get_ChangedVariables(e_event);
+ const std::string sid = UpnpEvent_get_SID_cstr(e_event);
+#else
struct Upnp_Event *e_event = (struct Upnp_Event *)Event;
const std::string Sid = e_event->Sid;
+#endif
// Parses the event
+#if UPNP_VERSION >= 10800
+ upnpCP->OnEventReceived(sid, eventKey, changedVariables);
+#else
upnpCP->OnEventReceived(Sid, e_event->EventKey, e_event->ChangedVariables);
+#endif
break;
}
case UPNP_EVENT_SUBSCRIBE_COMPLETE:
@@ -1252,24 +1319,42 @@
//fprintf(stderr, "Callback: UPNP_EVENT_RENEWAL_COMPLETE\n");
msg << "error(UPNP_EVENT_RENEWAL_COMPLETE): ";
upnpEventRenewalComplete:
+#if UPNP_VERSION >= 10800
+ UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
+ int errCode = UpnpEventSubscribe_get_ErrCode(es_event);
+ if (errCode != UPNP_E_SUCCESS) {
+#else
struct Upnp_Event_Subscribe *es_event =
(struct Upnp_Event_Subscribe *)Event;
if (es_event->ErrCode != UPNP_E_SUCCESS) {
+#endif
msg << "Error in Event Subscribe Callback";
+#if UPNP_VERSION >= 10800
+ UPnP::ProcessErrorMessage(msg.str(), errCode, NULL, NULL);
+#else
UPnP::ProcessErrorMessage(
msg.str(), es_event->ErrCode, NULL, NULL);
+#endif
} else {
#if 0
+#if UPNP_VERSION >= 10800
+
+ const UpnpString *publisherUrl =
+ UpnpEventSubscribe_get_PublisherUrl(es_event);
+ const char *sid = UpnpEvent_get_SID_cstr(es_event);
+ int timeOut = UpnpEvent_get_TimeOut(es_event);
+ TvCtrlPointHandleSubscribeUpdate(
+ publisherUrl, sid, timeOut);
+#else
TvCtrlPointHandleSubscribeUpdate(
GET_UPNP_STRING(es_event->PublisherUrl),
es_event->Sid,
es_event->TimeOut );
#endif
+#endif
}
-
break;
}
-
case UPNP_EVENT_AUTORENEWAL_FAILED:
//fprintf(stderr, "Callback: UPNP_EVENT_AUTORENEWAL_FAILED\n");
msg << "error(UPNP_EVENT_AUTORENEWAL_FAILED): ";
@@ -1280,29 +1365,56 @@
msg << "error(UPNP_EVENT_SUBSCRIPTION_EXPIRED): ";
msg2 << "UPNP_EVENT_SUBSCRIPTION_EXPIRED: ";
upnpEventSubscriptionExpired:
+#if UPNP_VERSION >= 10800
+ UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
+#else
struct Upnp_Event_Subscribe *es_event =
(struct Upnp_Event_Subscribe *)Event;
+#endif
Upnp_SID newSID;
memset(newSID, 0, sizeof(Upnp_SID));
int TimeOut = 1801;
+#if UPNP_VERSION >= 10800
+ const char *publisherUrl =
+ UpnpEventSubscribe_get_PublisherUrl_cstr(es_event);
+#endif
int ret = UpnpSubscribe(
upnpCP->m_UPnPClientHandle,
+#if UPNP_VERSION >= 10800
+ publisherUrl,
+#else
GET_UPNP_STRING(es_event->PublisherUrl),
+#endif
&TimeOut,
newSID);
if (ret != UPNP_E_SUCCESS) {
msg << "Error Subscribing to EventURL";
+#if UPNP_VERSION >= 10800
+ int errCode = UpnpEventSubscribe_get_ErrCode(es_event);
+#endif
UPnP::ProcessErrorMessage(
+#if UPNP_VERSION >= 10800
+ msg.str(), errCode, NULL, NULL);
+#else
msg.str(), es_event->ErrCode, NULL, NULL);
+#endif
} else {
ServiceMap::iterator it =
+#if UPNP_VERSION >= 10800
+ upnpCP->m_ServiceMap.find(publisherUrl);
+#else
upnpCP->m_ServiceMap.find(GET_UPNP_STRING(es_event->PublisherUrl));
+#endif
if (it != upnpCP->m_ServiceMap.end()) {
CUPnPService &service = *(it->second);
service.SetTimeout(TimeOut);
service.SetSID(newSID);
msg2 << "Re-subscribed to EventURL '" <<
+#if UPNP_VERSION >= 10800
+ publisherUrl <<
+#else
GET_UPNP_STRING(es_event->PublisherUrl) <<
+#endif
"' with SID == '" <<
newSID << "'.";
AddDebugLogLineC(logUPnP, msg2);
@@ -1321,17 +1433,34 @@
case UPNP_CONTROL_ACTION_COMPLETE: {
//fprintf(stderr, "Callback: UPNP_CONTROL_ACTION_COMPLETE\n");
// This is here if we choose to do this asynchronously
+#if UPNP_VERSION >= 10800
+ UpnpActionComplete *a_event = (UpnpActionComplete *)Event;
+ int errCode = UpnpActionComplete_get_ErrCode(a_event);
+ IXML_Document *actionResult =
+ UpnpActionComplete_get_ActionResult(a_event);
+ if (errCode != UPNP_E_SUCCESS) {
+#else
struct Upnp_Action_Complete *a_event =
(struct Upnp_Action_Complete *)Event;
if (a_event->ErrCode != UPNP_E_SUCCESS) {
+#endif
UPnP::ProcessErrorMessage(
"UpnpSendActionAsync",
+#if UPNP_VERSION >= 10800
+ errCode, NULL,
+ actionResult);
+#else
a_event->ErrCode, NULL,
a_event->ActionResult);
+#endif
} else {
// Check the response document
UPnP::ProcessActionResponse(
+#if UPNP_VERSION >= 10800
+ actionResult,
+#else
a_event->ActionResult,
+#endif
"<UpnpSendActionAsync>");
}
/* No need for any processing here, just print out results.
@@ -1342,22 +1471,43 @@
case UPNP_CONTROL_GET_VAR_COMPLETE: {
//fprintf(stderr, "Callback: UPNP_CONTROL_GET_VAR_COMPLETE\n");
msg << "error(UPNP_CONTROL_GET_VAR_COMPLETE): ";
+#if UPNP_VERSION >= 10800
+ UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)Event;
+ int errCode = UpnpStateVarComplete_get_ErrCode(sv_event);
+ if (errCode != UPNP_E_SUCCESS) {
+#else
struct Upnp_State_Var_Complete *sv_event =
(struct Upnp_State_Var_Complete *)Event;
if (sv_event->ErrCode != UPNP_E_SUCCESS) {
+#endif
msg << "m_UpnpGetServiceVarStatusAsync";
UPnP::ProcessErrorMessage(
+#if UPNP_VERSION >= 10800
+ msg.str(), errCode, NULL, NULL);
+#else
msg.str(), sv_event->ErrCode, NULL, NULL);
+#endif
} else {
#if 0
// Warning: The use of UpnpGetServiceVarStatus and
// UpnpGetServiceVarStatusAsync is deprecated by the
// UPnP forum.
+#if UPNP_VERSION >= 10800
+ const char *ctrlUrl =
+ UpnpStateVarComplete_get_CtrlUrl(sv_event);
+ const char *stateVarName =
+ UpnpStateVarComplete_get_StateVarName(sv_event);
+ const DOMString currentVal =
+ UpnpStateVarComplete_get_CurrentVal(sv_event);
+ TvCtrlPointHandleGetVar(
+ ctrlUrl, stateVarName, currentVal);
+#else
TvCtrlPointHandleGetVar(
sv_event->CtrlUrl,
sv_event->StateVarName,
sv_event->CurrentVal );
#endif
+#endif
}
break;
}
diff -Naur a/src/UPnPBase.h b/src/UPnPBase.h
--- a/src/UPnPBase.h 2016-10-06 18:49:44.000000000 +0800
+++ b/src/UPnPBase.h 2019-12-11 22:16:28.165063153 +0800
@@ -489,9 +489,15 @@
// Callback function
static int Callback(
+ #if UPNP_VERSION >= 10800
+ Upnp_EventType_e EventType,
+ const void *Event,
+ void *Cookie);
+ #else
Upnp_EventType EventType,
void* Event,
void* Cookie);
+ #endif
private:
void OnEventReceived(

View File

@ -0,0 +1,19 @@
--- a/src/libs/common/MuleDebug.cpp 2016-10-06 18:49:44.000000000 +0800
+++ b/src/libs/common/MuleDebug.cpp 2021-06-17 02:16:40.000000000 +0800
@@ -268,14 +268,14 @@
return;
}
- bfd_vma vma = bfd_get_section_vma(abfd, section);
+ bfd_vma vma = bfd_section_vma(section);
unsigned long address = (unsigned long)_address;
if (address < vma) {
return;
}
- bfd_size_type size = bfd_section_size(abfd, section);
+ bfd_size_type size = bfd_section_size(section);
if (address > (vma + size)) {
return;
}

View File

@ -0,0 +1,16 @@
diff --git a/src/UPnPBase.cpp b/src/UPnPBase.cpp
index 46ac7451e..dd244e5b0 100644
--- a/src/UPnPBase.cpp
+++ b/src/UPnPBase.cpp
@@ -828,9 +828,9 @@
int ret;
char *ipAddress = NULL;
unsigned short port = 0;
- ret = UpnpInit(ipAddress, udpPort);
+ ret = UpnpInit2(0, udpPort);
if (ret != UPNP_E_SUCCESS) {
- msg << "error(UpnpInit): Error code ";
+ msg << "error(UpnpInit2): Error code ";
goto error;
}
port = UpnpGetServerPort();

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=antileech
PKG_VERSION:=2.3.2
PKG_RELEASE:=17
PKG_RELEASE:=15
#PKG_SOURCE:=antileech-2.3.1.tar.gz
#PKG_SOURCE_URL:=@SF/amule

86
baidupcs-web/Makefile Normal file
View File

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

35
cpulimit/Makefile Normal file
View File

@ -0,0 +1,35 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=cpulimit
PKG_VERSION:=0.3.2
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/denji/cpulimit/tar.gz/$(PKG_VERSION)?
PKG_HASH:=skip
PKG_BUILD_PARALLEL:=1
PKG_LICENSE_FILES:=LICENSE
MAKE_PATH:=src
include $(INCLUDE_DIR)/package.mk
define Package/cpulimit
SECTION:=utils
CATEGORY:=Utilities
TITLE:=CPU usage limiter
URL:=https://github.com/denji/cpulimit
endef
define Package/cpulimit/description
Cpulimit is a tool which limits the CPU usage of a process
(expressed in percentage, not in CPU time).
endef
define Package/cpulimit/install
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cpulimit $(1)/usr/bin/
endef
$(eval $(call BuildPackage,cpulimit))

Binary file not shown.

View File

@ -271,6 +271,7 @@
18a8f5a1c1.com
18clicks.com
18tzx.com
19811231.me
1999019.com
199b8977fc.com
199zw.com
@ -512,6 +513,7 @@
3338877.com
3381e74f70adfb59.com
338336.com
338f4d497f.com
3393.com
33across.com
33ceaea337.cfd
@ -593,6 +595,7 @@
42837932b3d.com
42a5d530ec972d8994.com
42d61f012e27b36d53.com
42fd278b95.com
43137c93a82b0e81da.com
4399.space
4480dy.net
@ -607,6 +610,7 @@
48331375c351e.com
485d0bd3f4.com
48d58df525.com
493b0eda03.com
493b98cce8bc1a2dd.com
4affiliate.net
4b6994dfa47cee4.com
@ -995,6 +999,7 @@
833e4c13ecc.com
8341.store
835551.com
840df00e08.com
8456.xyz
8547459af5da02.com
8563p.cn
@ -1430,6 +1435,7 @@ absorbinginject.com
abstractedauthority.com
absurdwater.com
abtasty.com
abundantshells.com
abundled.club
abusedbabysitters.com
abuseewarlock.com
@ -3658,6 +3664,7 @@ arkn81.com
arliest.com
arlottencert.club
armashair.site
armaturepaletteopenminded.com
armedgroin.com
armiesgaspclue.com
armlyemoan.com
@ -4998,6 +5005,7 @@ blck4d.com
blcobmv.cn
bleaborahm.one
bleinu.com
blendorbraker.com
blenkbenched.casa
bleopi.com
blessgarments.com
@ -5528,6 +5536,7 @@ byvuwhubi.com
bzlpa.cn
bznxc6721.xyz
bzrmxfxu.com
bzwcgscqnf.com
c-5uwzmx78pmca09x24aiux2euavx2ekwu.g00.msn.com
c.28rv.com
c.bannerflow.net
@ -5549,6 +5558,7 @@ c1.nowlinux.com
c10ed2b8b417880.com
c12bleue.com
c1exchange.com
c212.net
c3t-system-err.club
c3y1oja.cn
c40.xyz
@ -5736,6 +5746,7 @@ catwenbat.com
catwrite.com
catynydy.com
cauntercanulae.com
caunuscoagel.com
caupdcloud.cn
causecherry.com
causerestrainrecorder.com
@ -5809,6 +5820,7 @@ cdn.bannerflow.com
cdn.branch.io
cdn.freshmarketer.com
cdn.heapanalytics.com
cdn.house
cdn.imvkan.com
cdn.keywee.co
cdn.onesignal.com
@ -6184,6 +6196,7 @@ cj-cy.com
cj.com
cjbmanagement.com
cjde.xyz
cjenxpjxxhdwtp.xyz
cjezgbjbltos.com
cjf25jklrwqt.com
cjgcedu.com
@ -7270,6 +7283,7 @@ d162nnmwf9bggr.cloudfront.net
d175dtblugd1dn.cloudfront.net
d188elxamt3utn.cloudfront.net
d188m5xxcpvuue.cloudfront.net
d18e74vjvmvza1.cloudfront.net
d18g6t7whf8ejf.cloudfront.net
d18mealirgdbbz.cloudfront.net
d18t35yyry2k49.cloudfront.net
@ -8306,6 +8320,7 @@ dokauzob.top
dolinaphtalic.com
dollarade.com
dollarhene.com
dolleddhaman.com
dollsdeclare.com
dolohen.com
dolphinanthill.com
@ -8986,6 +9001,7 @@ ejectsurvivalfollower.com
ejghw.cn
ejieban.com
ejktj.com
ejnjapw.cn
ejoonsoo.net
ejunshi.com
ejurzsax.com
@ -9399,6 +9415,7 @@ ewasadirec.com
ewedivotsfop.com
ewetwitter.com
ewithjam.club
ewmpvsajrhxbuev.xyz
ewooe6df.com
ewrerew29w09.com
ewruuqe5p8ca.com
@ -10939,6 +10956,7 @@ godfulsiums.com
godloveme.cn
godspeaks.net
godvwcft.com
goercoshes.com
goergleeds.com
gogoplexer.com
gohillgo.com
@ -11083,6 +11101,7 @@ grannynightmare.com
grapeshot.co.uk
gratecowgram.com
graterpartnership.com
graths.com
gratificationposture.com
gratingtode.com
graucoay.net
@ -11451,6 +11470,7 @@ hao61.net
haoanfang.cn
haodazhizhuangzhuang.club
haodiwh.top
haodong.site
haoerer.cn
haogame.me
haohuisheng555.cn
@ -12522,6 +12542,7 @@ ilirlyduzxb.com
ilkmawgod.site
ilkrileashes.com
illallwoe.com
illegalprotected.com
illfatedsnail.com
illicitdandily.cam
illiticguiding.com
@ -12611,6 +12632,7 @@ impactlaterhand.com
impactradius-go.com
impactradius.com
impactserving.com
impatientlyastonishing.com
impeacknow.xyz
imperialteamattended.com
imperturbablechoreinterrogation.com
@ -12902,6 +12924,7 @@ iqu-operation.com
iqzgqivb.com
ir2aok.com
iraithiz.com
iratelyveinlet.com
irchan.com
irecentlym.club
iredirect.net
@ -15806,6 +15829,7 @@ mjyjt.biz
mjywk.cn
mjzsw.vip
mk1lyl406xmp.com
mk6n4ym.cn
mkhoj.com
mkjsqrpmxqdf.com
mkjunc.cn
@ -16297,6 +16321,7 @@ myyuye.club
myz11111.cn
myz33333.cn
myzk1.com
mzcd.xyz
mzlscqarnm.com
mzokqm.cn
mzol7lbm.com
@ -17748,6 +17773,7 @@ paintifiercute.club
paiptoaz.com
paishuiban.ltd
paishuno.net
pajinse.top
pakistant.club
palasidesdoor.com
paleleaf.com
@ -17922,6 +17948,7 @@ pdqgywt.cn
pdrfvumww.com
pdsjycm.com
pdss.xyz
pdsvrtb.cn
pdvacde.com
pdxgfnnoan.com
peacebanana.com
@ -18290,6 +18317,7 @@ plantinscription.com
plants.ink
plardi.com
plashcashierbleach.com
plastic-wood.cn
platado.com
platesworked.com
platif.com
@ -18421,6 +18449,7 @@ pompouseruptionrang.com
pompysxdz.com
pon-prairie.com
ponchowafesargb.com
ponderouscentigradecredit.com
pontymonti.com
pooboafi.net
poodledopas.cam
@ -18880,6 +18909,7 @@ pstmrk.it
pstreetma.com
psugeglapha.com
psuglymave.com
psuhexitu.pro
psuhuchize.com
psulsobi.net
psupaids.com
@ -19328,6 +19358,7 @@ qkuvmwf.cn
ql.tc
ql.uzuzuz.com
qlcabgpjyh.com
qljwkthllpjsi.com
qlmqzznfcb.com
qloved.cn
qlpwqpvuw.com
@ -19498,6 +19529,7 @@ qwhbkjlawhw.com
qwnkvvtuxivur.com
qwpetywdh.com
qwtomdpb.com
qwzpslp.cn
qxfly.com
qxrprutdlcpah.xyz
qxtwkq.cn
@ -20182,6 +20214,7 @@ rjnjjin.cn
rjtgbjxfyslvdst.com
rjtpos.cn
rkllcrwtftx.com
rkoepfotesi.com
rkomf.com
rktupt.cn
rkumsvlvfeeewog.xyz
@ -21368,6 +21401,7 @@ sleeveashame.com
slgioxv.cn
slgo.club
slhoisgdhs.com
slicktrulyuptown.com
slideff.com
slightcareconditions.com
slightists.xyz
@ -22654,6 +22688,7 @@ tend.io
tendents.club
tendertest.com
tenderunderstatement.com
tenezratio.com
tengmoneron.com
tengxunwang.top
tenthsfrumpy.com
@ -23611,6 +23646,7 @@ tuzufsi.cn
tv1s4d6klh4n.com
tvbpusyqohxu.com
tvbxcg6.com
tvgvlpnpetxysl.com
tvlipevrj.com
tvnewtop.pro
tvprocessing.com
@ -24426,6 +24462,7 @@ vipcpms.com
viperydeer.com
viphdk.xyz
vipicmou.net
vipytyl.ltd
viqxlggexukmnjf.com
viqyxamy.xyz
viral481.com
@ -25318,6 +25355,7 @@ wootwood.com
woovooza.net
woowhaiz.net
wooyehnunmi.com
woqi.shop
woqkhzpu.com
woquwaimai.vip
word168.cn
@ -25592,6 +25630,7 @@ xaokiotravel.com
xapa.xyz
xapads.com
xaqdf.com
xarqnuelxtvajgp.xyz
xatczs.cn
xauthorous.club
xavingtsun.com
@ -25814,6 +25853,7 @@ xjhjtz.cn
xjhmap.cn
xjjkxcg.cn
xjngxaij.com
xjpnycwqr.com
xjsq.xyz
xk2012.com
xkkcfmytuci.xyz
@ -26071,11 +26111,13 @@ ya1vg3w.cn
yaaci.cn
yab-adimages.s3.amazonaws.com
yaba.org.cn
yabloomambloo.com
yabqg.cn
yabuka.com
yaccidedap.top
yacihhktw.com
yadro.ru
yahblemable.com
yahekby.cn
yajiuwz.xyz
yajvdoporjtz.com

87
dnsproxy/Makefile Normal file
View File

@ -0,0 +1,87 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsproxy
PKG_VERSION:=0.42.0
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=skip
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_CONFIG_DEPENDS:= \
CONFIG_DNSPROXY_COMPRESS_GOPROXY \
CONFIG_DNSPROXY_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/AdguardTeam/dnsproxy
GO_PKG_LDFLAGS:=-s -w
GO_PKG_LDFLAGS_X:=main.VersionString=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/dnsproxy/config
config DNSPROXY_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config DNSPROXY_COMPRESS_UPX
bool "Compress executable files with UPX"
depends on !mips64
default n
endef
ifeq ($(CONFIG_DNSPROXY_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.bj.bcebos.com
endif
define Package/dnsproxy
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
TITLE:=Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support
URL:=https://github.com/AdguardTeam/dnsproxy
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
USERID:=dnsproxy=411:dnsproxy=411
endef
define Package/dnsproxy/description
A simple DNS proxy server that supports all existing DNS protocols including
DNS-over-TLS, DNS-over-HTTPS, DNSCrypt, and DNS-over-QUIC.Moreover, it can
work as a DNS-over-HTTPS, DNS-over-TLS or DNS-over-QUIC server.
endef
define Build/Compile
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_DNSPROXY_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/dnsproxy
endif
endef
define Package/dnsproxy/install
$(call GoPackage/Package/Install/Bin,$(1))
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_CONF) $(CURDIR)/files/dnsproxy.config $(1)/etc/config/dnsproxy
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) $(CURDIR)/files/dnsproxy.init $(1)/etc/init.d/dnsproxy
endef
define Package/dnsproxy/conffiles
/etc/config/dnsproxy
endef
$(eval $(call GoBinPackage,dnsproxy))
$(eval $(call BuildPackage,dnsproxy))

View File

@ -0,0 +1,41 @@
# For documents, please see https://github.com/AdguardTeam/dnsproxy#usage
config dnsproxy 'global'
option enabled '0'
option listen_addr '127.0.0.1'
option listen_port '5353'
option log_file ''
option all_servers '0'
option fastest_addr '0'
option insecure '0'
option ipv6_disabled '0'
option max_go_routines ''
option rate_limit ''
option refuse_any '0'
option udp_buf_size ''
option verbose '0'
config dnsproxy 'bogus_nxdomain'
list ip_addr ''
config dnsproxy 'cache'
option enabled '0'
option cache_optimistic '0'
option size '65535'
option min_ttl ''
option max_ttl ''
config dnsproxy 'dns64'
option enabled '0'
option dns64_prefix '64:ff9b::'
config dnsproxy 'edns'
option enabled '0'
option edns_addr ''
config dnsproxy 'servers'
list bootstrap 'tls://8.8.8.8'
list fallback 'tls://9.9.9.9'
list upstream 'tls://1.1.1.1'

View File

@ -0,0 +1,115 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2021 Tianling Shen <cnsztl@immortalwrt.org>
USE_PROCD=1
START=90
CONF="dnsproxy"
PROG="/usr/bin/dnsproxy"
is_enabled() {
local enabled
config_get enabled "$1" "$2" "0"
if [ "$enabled" -eq "1" ]; then
return 0
else
return 1
fi
}
is_empty() {
local empty
config_get empty "$1" "$2" $3
if [ -z "$empty" ]; then
return 0
else
return 1
fi
}
append_param() {
procd_append_param command "$1" $2
}
append_param_arg() {
local value
config_get value "$1" "$2" $4
[ -n "$value" ] && append_param "$3" "$value"
}
append_param_bool() {
is_enabled "$1" "$2" && append_param "--${2//_/-}"
}
load_config_arg() {
append_param_bool "$1" "all_servers"
append_param_bool "$1" "fastest_addr"
append_param_bool "$1" "insecure"
append_param_bool "$1" "ipv6_disabled"
append_param_bool "$1" "refuse_any"
append_param_bool "$1" "verbose"
}
load_config_list() {
is_empty "bogus_nxdomain" "ip_addr" || config_list_foreach "bogus_nxdomain" "ip_addr" "append_param '--bogus-nxdomain'"
for i in "bootstrap" "fallback" "upstream"; do
is_empty "servers" "$i" || config_list_foreach "servers" "$i" "append_param '--$i'"
done
}
load_config_param() {
append_param_arg "global" "listen_addr" "--listen" "127.0.0.1"
append_param_arg "global" "listen_port" "--port" "5353"
append_param_arg "global" "log_file" "--output"
append_param_arg "global" "max_go_routines" "--max-go-routines"
append_param_arg "global" "rate_limit" "--ratelimit"
append_param_arg "global" "udp_buf_size" "--udp-buf-size"
is_enabled "cache" "enabled" && {
append_param "--cache"
append_param_bool "cache" "cache_optimistic"
append_param_arg "cache" "size" "--cache-size"
append_param_arg "cache" "min_ttl" "--cache-min-ttl"
append_param_arg "cache" "max_ttl" "--cache-max-ttl"
}
is_enabled "dns64" "enabled" && {
append_param "--dns64"
append_param_arg "dns64" "dns64_prefix" "--dns64-prefix"
}
is_enabled "edns" "enabled" && {
append_param "--edns"
append_param_arg "edns" "edns_addr" "--edns-addr"
}
}
start_service() {
config_load "$CONF"
is_enabled "global" "enabled" || exit 1
procd_open_instance "$CONF"
procd_set_param command "$PROG"
load_config_arg "global"
load_config_list
load_config_param
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param user dnsproxy
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "$CONF"
}

3
dnsproxy/test.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
dnsproxy --version | grep "$PKG_VERSION"

50
gmediarender/Makefile Normal file
View File

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

View File

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

View File

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

View File

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

73
gowebdav/Makefile Normal file
View File

@ -0,0 +1,73 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=gowebdav
PKG_VERSION:=0.0.3
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/1715173329/gowebdav/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=skip
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_CONFIG_DEPENDS:= \
CONFIG_GOWEBDAV_COMPRESS_GOPROXY \
CONFIG_GOWEBDAV_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/1715173329/gowebdav
GO_PKG_LDFLAGS:=-s -w
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/gowebdav
SECTION:=net
CATEGORY:=Network
SUBMENU:=File Transfer
TITLE:=A simple WebDav server written in Go
URL:=https://github.com/1715173329/gowebdav
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/gowebdav/config
config GOWEBDAV_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config GOWEBDAV_COMPRESS_UPX
bool "Compress executable files with UPX"
depends on !mips64
default n
endef
ifeq ($(CONFIG_GOWEBDAV_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.bj.bcebos.com
endif
define Build/Compile
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_GOWEBDAV_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/gowebdav
endif
endef
define Package/gowebdav/install
$(call GoPackage/Package/Install/Bin,$(1))
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) $(CURDIR)/files/gowebdav.config $(1)/etc/config/gowebdav
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(CURDIR)/files/gowebdav.init $(1)/etc/init.d/gowebdav
endef
$(eval $(call GoBinPackage,gowebdav))
$(eval $(call BuildPackage,gowebdav))

View File

@ -0,0 +1,12 @@
config gowebdav 'config'
option enable '0'
option listen_port '6086'
option username 'user'
option password 'pass'
option root_dir '/mnt'
option read_only '0'
option allow_wan '0'
option use_https '0'
option cert_cer ''
option cert_key ''

56
gowebdav/files/gowebdav.init Executable file
View File

@ -0,0 +1,56 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2021 ImmortalWrt
START=99
STOP=10
init_conf() {
config_load "gowebdav"
config_get "enable" "config" "enable" "0"
config_get "listen_port" "config" "listen_port" "6086"
config_get "username" "config" "username"
config_get "password" "config" "password"
config_get "root_dir" "config" "root_dir" "/mnt"
config_get "read_only" "config" "read_only" "0"
config_get "allow_wan" "config" "allow_wan" "0"
config_get "use_https" "config" "use_https" "0"
config_get "cert_cer" "config" "cert_cer"
config_get "cert_key" "config" "cert_key"
config_load "network"
config_get "lan_addr" "lan" "ipaddr" "192.168.1.1"
}
set_firewall() {
if [ "${set_type}" = "start" ]; then
mkdir -p "/var/etc/"
iptables -I INPUT -p tcp --dport "${listen_port}" -j ACCEPT
echo "iptables -I INPUT -p tcp --dport "${listen_port}" -j ACCEPT" > "/var/etc/gowebdav.include"
elif [ "${set_type}" = "stop" ]; then
iptables -D INPUT -p tcp --dport "${listen_port}" -j ACCEPT
echo "" > "/var/etc/gowebdav.include"
fi
}
start() {
init_conf
stop
[ "${enable}" -ne "1" ] && exit 0
mkdir -p "${root_dir}"
[ "${allow_wan}" -ne "1" ] && listen_addr="${lan_addr}" || { listen_addr="0.0.0.0"; set_type="start" && set_firewall 2>"/dev/null"; }
{ [ -n "${username}" ] && [ -n "${password}" ]; } && auth_arg="-user ${username} -password ${password}"
[ "${read_only}" -eq "1" ] && readonly_arg="-read-only"
{ [ "${use_https}" -eq "1" ] && [ -e "${cert_cer}" ] && [ -e "${cert_key}" ]; } && https_arg="-https-mode -https-cert-file ${cert_cer} -https-key-file ${cert_key}"
/usr/bin/gowebdav -dir "${root_dir}" -http "${listen_addr}:${listen_port}" ${auth_arg} ${readonly_arg} ${https_arg} &
}
stop() {
init_conf
set_type="stop" && set_firewall 2>"/dev/null"
killall "gowebdav" 2>"/dev/null"
}

146
haproxy/Makefile Normal file
View File

@ -0,0 +1,146 @@
#
# Copyright (C) 2010-2016 OpenWrt.org
# Copyright (C) 2009-2016 Thomas Heil <heil@terminal-consulting.de>
# Copyright (C) 2018 Christian Lachner <gladiac@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=haproxy
PKG_VERSION:=2.4.15
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.haproxy.org/download/2.4/src
PKG_HASH:=skip
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
Christian Lachner <gladiac@gmail.com>
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:haproxy:haproxy
include $(INCLUDE_DIR)/package.mk
define Package/haproxy/Default
SUBMENU:=Web Servers/Proxies
SECTION:=net
CATEGORY:=Network
TITLE:=TCP/HTTP Load Balancer
URL:=https://www.haproxy.org/
endef
define Package/haproxy/conffiles
/etc/haproxy.cfg
endef
Package/haproxy-nossl/conffiles = $(Package/haproxy/conffiles)
define Package/haproxy/Default/description
Open source Reliable, High Performance TCP/HTTP Load Balancer.
endef
define Package/haproxy
$(call Package/haproxy/Default)
TITLE+=with SSL support
DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libopenssl +libncurses +libreadline +libatomic
VARIANT:=ssl
endef
define Package/haproxy/description
$(call Package/haproxy/Default/description)
This package is built with SSL and LUA support.
endef
define Package/haproxy-nossl
$(call Package/haproxy/Default)
TITLE+=without SSL support
VARIANT:=nossl
DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libatomic
CONFLICTS:=haproxy
endef
define Package/haproxy-nossl/description
$(call Package/haproxy/Default/description)
This package is built without SSL support.
endef
TARGET=linux-glibc
ENABLE_LUA:=y
ifeq ($(CONFIG_USE_UCLIBC),y)
ADDON+=USE_BACKTRACE=
ADDON+=USE_LIBCRYPT=
endif
ifeq ($(CONFIG_USE_MUSL),y)
TARGET=linux-musl
endif
ifeq ($(BUILD_VARIANT),ssl)
ADDON+=USE_OPENSSL=1
ADDON+=ADDLIB="-lcrypto -lm"
endif
define Build/Compile
$(MAKE) TARGET=$(TARGET) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
CC="$(TARGET_CC)" \
PCREDIR="$(STAGING_DIR)/usr/" \
USE_LUA=1 LUA_LIB_NAME="lua5.3" LUA_INC="$(STAGING_DIR)/usr/include/lua5.3" LUA_LIB="$(STAGING_DIR)/usr/lib" \
SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530" \
USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_PTHREAD_PSHARED=1 USE_LIBATOMIC=1 USE_PROMEX=1 \
VERSION="$(PKG_VERSION)" SUBVERS="-$(PKG_RELEASE)" \
VERDATE="$(shell date -d @$(SOURCE_DATE_EPOCH) '+%Y/%m/%d')" IGNOREGIT=1 \
$(ADDON) \
CFLAGS="$(TARGET_CFLAGS) -fno-strict-aliasing -Wdeclaration-after-statement -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered -Wno-missing-field-initializers -Wno-cast-function-type -Wno-address-of-packed-member -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond -Wnull-dereference -fwrapv -fasynchronous-unwind-tables -Wno-null-dereference" \
LD="$(TARGET_CC)" \
LDFLAGS="$(TARGET_LDFLAGS)"
$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
LD="$(TARGET_CC)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(MAKE_FLAGS) \
install
$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS) -Wno-address-of-packed-member" \
LDFLAGS="$(TARGET_LDFLAGS)" \
admin/halog/halog
endef
define Package/haproxy/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
endef
Package/haproxy-nossl/install = $(Package/haproxy/install)
define Package/halog
$(call Package/haproxy)
TITLE+=halog
DEPENDS:=haproxy
endef
define Package/halog/description
HAProxy Log Analyzer
endef
define Package/halog/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/admin/halog/halog $(1)/usr/bin/
endef
$(eval $(call BuildPackage,haproxy))
$(eval $(call BuildPackage,halog))
$(eval $(call BuildPackage,haproxy-nossl))

107
haproxy/files/haproxy.cfg Normal file
View File

@ -0,0 +1,107 @@
# Example configuration file for HAProxy 2.0, refer to the url below for
# a full documentation and examples for configuration:
# https://cbonte.github.io/haproxy-dconv/2.0/configuration.html
# Global parameters
global
# Log events to a remote syslog server at given address using the
# specified facility and verbosity level. Multiple log options
# are allowed.
#log 10.0.0.1 daemon info
# Specifiy the maximum number of allowed connections.
maxconn 32000
# Raise the ulimit for the maximum allowed number of open socket
# descriptors per process. This is usually at least twice the
# number of allowed connections (maxconn * 2 + nb_servers + 1) .
ulimit-n 65535
# Drop privileges (setuid, setgid), default is "root" on OpenWrt.
uid 0
gid 0
# Perform chroot into the specified directory.
#chroot /var/run/haproxy/
# Daemonize on startup
daemon
nosplice
# Enable debugging
#debug
# Spawn given number of processes and distribute load among them,
# used for multi-core environments or to circumvent per-process
# limits like number of open file descriptors. Default is 1.
#nbproc 2
# Default parameters
defaults
# Default timeouts
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
# Example HTTP proxy listener
listen my_http_proxy
# Bind to port 81 and 444 on all interfaces (0.0.0.0)
bind :81,:444
# We're proxying HTTP here...
mode http
# Simple HTTP round robin over two servers using the specified
# source ip 192.168.1.1 .
balance roundrobin
server server01 192.168.1.10:80 source 192.168.1.1
server server02 192.168.1.20:80 source 192.168.1.1
# Serve an internal statistics page on /stats:
stats enable
stats uri /stats
# Enable HTTP basic auth for the statistics:
stats realm HA_Stats
stats auth username:password
# Example SMTP proxy listener
listen my_smtp_proxy
# Disable this instance without commenting out the section.
disabled
# Bind to port 26 and 588 on localhost
bind 127.0.0.1:26,127.0.0.1:588
# This is a TCP proxy
mode tcp
# Round robin load balancing over two servers on port 123 forcing
# the address 192.168.1.1 and port 25 as source.
balance roundrobin
#use next line for transparent proxy, so the servers can see the
#original ip-address and remove source keyword in server definition
#source 0.0.0.0 usesrc clientip
server server01 192.168.1.10:123 source 192.168.1.1:25
server server02 192.168.1.20:123 source 192.168.1.1:25
# Special health check listener for integration with external load
# balancers.
listen local_health_check
# Listen on port 60000
bind :60000
# This is a health check
mode health
# Enable HTTP-style responses: "HTTP/1.0 200 OK"
# else just print "OK".
#option httpchk

View File

@ -0,0 +1,24 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2009-2019 OpenWrt.org
START=99
STOP=80
USE_PROCD=1
HAPROXY_BIN="/usr/sbin/haproxy"
HAPROXY_CONFIG="/etc/haproxy.cfg"
start_service() {
procd_open_instance
procd_set_param respawn
procd_set_param file "$HAPROXY_CONFIG"
procd_set_param reload_signal USR2
procd_set_param command $HAPROXY_BIN -q -W -db -f "$HAPROXY_CONFIG"
procd_close_instance
}
extra_command "check" "Check haproxy config"
check() {
$HAPROXY_BIN -c -q -V -f $HAPROXY_CONFIG
}

27
haproxy/get-latest-patches.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
CLONEURL=https://git.haproxy.org/git/haproxy-2.4.git
BASE_TAG=v2.4.15
TMP_REPODIR=tmprepo
PATCHESDIR=patches
if test -d "${TMP_REPODIR}"; then rm -rf "${TMP_REPODIR}"; fi
git clone "${CLONEURL}" "${TMP_REPODIR}"
printf "Cleaning patches\n"
find ${PATCHESDIR} -type f -name "*.patch" -exec rm -f "{}" \;
i=0
for cid in $(git -C "${TMP_REPODIR}" rev-list ${BASE_TAG}..HEAD | tac); do
filename="$(printf "%03d" $i)-$(git -C "${TMP_REPODIR}" log --format=%s -n 1 "$cid" | sed -e"s/[()']//g" -e's/[^_a-zA-Z0-9+-]\+/-/g' -e's/-$//').patch"
printf "Creating %s\n" "${filename}"
git -C "${TMP_REPODIR}" show "$cid" > "${PATCHESDIR}/$filename"
git add "${PATCHESDIR}/$filename"
i=$((i+1))
done
rm -rf "${TMP_REPODIR}"
printf "finished\n"

View File

@ -1,24 +0,0 @@
#
# Copyright (C) 2018 chenhw2 <https://github.com/chenhw2/>
#
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for aliddns
LUCI_DESCRIPTION:=LuCI Support for ALiDDNS.
LUCI_DEPENDS:=+openssl-util +curl
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-aliddns
PKG_VERSION:=0.3.0
PKG_RELEASE:=1
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=chenhw2 <https://github.com/chenhw2/>
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,4 +0,0 @@
module("luci.controller.aliddns",package.seeall)
function index()
entry({"admin","services","aliddns"},cbi("aliddns"),_("AliDDNS"),58).acl_depends = { "luci-app-aliddns" }
end

View File

@ -1,56 +0,0 @@
local a=require"luci.sys"
local e=luci.model.uci.cursor()
local e=require"nixio.fs"
require("luci.sys")
local t,e,o
t=Map("aliddns",translate("AliDDNS"))
e=t:section(TypedSection,"base",translate("Base"))
e.anonymous=true
enable=e:option(Flag,"enable",translate("enable"))
enable.rmempty=false
enable=e:option(Flag,"clean",translate("Clean Before Update"))
enable.rmempty=false
token=e:option(Value,"app_key",translate("Access Key ID"))
email=e:option(Value,"app_secret",translate("Access Key Secret"))
iface=e:option(ListValue,"interface",translate("WAN-IP Source"),translate("Select the WAN-IP Source for AliDDNS, like wan/internet"))
iface:value("",translate("Select WAN-IP Source"))
iface:value("internet")
iface:value("wan")
iface.rmempty=false
main=e:option(Value,"main_domain",translate("Main Domain"),translate("For example: test.github.com -> github.com"))
main.rmempty=false
sub=e:option(Value,"sub_domain",translate("Sub Domain"),translate("For example: test.github.com -> test"))
sub.rmempty=false
time=e:option(Value,"time",translate("Inspection Time"),translate("Unit: Minute, Range: 1-59"))
time.rmempty=false
e=t:section(TypedSection,"base",translate("Update Log"))
e.anonymous=true
local a="/var/log/aliddns.log"
tvlog=e:option(TextValue,"sylogtext")
tvlog.rows=16
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

@ -1,44 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "AliDDNS"
msgstr "阿里DDNS"
msgid "enable"
msgstr "启用"
msgid "Clean Before Update"
msgstr "清除所有同名记录"
msgid "Base"
msgstr "基本设置"
msgid "WAN-IP Source"
msgstr "WAN-IP来源"
msgid "Select WAN-IP Source"
msgstr "选择WAN-IP来源"
msgid "Select the WAN-IP Source for AliDDNS, like wan/internet"
msgstr "动态域名的IP来源如wan/internet"
msgid "Main Domain"
msgstr "主域名"
msgid "Sub Domain"
msgstr "子域名"
msgid "For example: test.github.com -> github.com"
msgstr "例如: test.github.com 则填: github.com"
msgid "For example: test.github.com -> test"
msgstr "例如: test.github.com, 则填: test"
msgid "Inspection Time"
msgstr "检查时间"
msgid "Unit: Minute, Range: 1-59"
msgstr "域名检查间隔时间单位分钟范围1-59"
msgid "Update Log"
msgstr "更新记录"

View File

@ -1,4 +0,0 @@
config base 'base'
option enable '0'
option time '10'

View File

@ -1,64 +0,0 @@
#!/bin/sh /etc/rc.common
START=80
NAME=aliddns
NE_TIPS='AliDDNS NOT ENABLED'
restart() {
start
}
uci_get_by_name() {
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
echo ${ret:=$3}
}
uci_bool_by_name() {
case "$(uci_get_by_name $1 $2)" in
1|on|true|yes|enabled) return 0;;
esac
return 1
}
add_hotplug() {
cat <<EOF > "/etc/hotplug.d/iface/${START}-${NAME}"
#!/bin/sh /etc/rc.common
[ "Z\$ACTION" = "Zifup" -a "Z\$INTERFACE" = "Zwan" ] || exit 0
DATE=\$(date +'%Y-%m-%d %H:%M:%S')
( sleep 10 && ( echo "\$DATE IFUP-WAN" && /usr/sbin/aliddns ) >> /var/log/aliddns.log 2>&1 ) &
exit 0
EOF
chmod +x "/etc/hotplug.d/iface/${START}-${NAME}"
}
start() {
$(uci_bool_by_name base enable) || {
stop
return 0
}
add_hotplug
sed -i "/${NE_TIPS}/d" /var/log/aliddns.log
time=$(uci_get_by_name base time 10)
[ 0 -lt $time -a $time -lt 60 ] || time=10
[ -f /etc/crontabs/root ] || mkdir -p /etc/crontabs && touch /etc/crontabs/root
sed -i '/aliddns/d' /etc/crontabs/root
echo "*/$time * * * * /usr/sbin/aliddns >> /var/log/aliddns.log 2>&1" >> /etc/crontabs/root
/etc/init.d/cron restart
( /usr/sbin/aliddns >> /var/log/aliddns.log 2>&1 ) &
}
stop() {
rm -rf "/etc/hotplug.d/iface/${START}-${NAME}"
sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1
/etc/init.d/cron restart
echo "${NE_TIPS}" > /var/log/aliddns.log
}

View File

@ -1,10 +0,0 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@aliddns[-1]
add ucitrack aliddns
set ucitrack.@aliddns[-1].init=aliddns
commit ucitrack
EOF
exit 0

View File

@ -1,164 +0,0 @@
#!/bin/sh
NAME=aliddns
log_file=/var/log/$NAME.log
uci_get_by_name() {
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
echo ${ret:=$3}
}
uci_bool_by_name() {
case "$(uci_get_by_name $1 $2)" in
1|on|true|yes|enabled) return 0;;
esac
return 1
}
intelnetip() {
tmp_ip=`curl -sL --connect-timeout 3 ns1.dnspod.net:6666`
if [ "Z$tmp_ip" == "Z" ]; then
tmp_ip=`curl -sL --connect-timeout 3 members.3322.org/dyndns/getip`
fi
if [ "Z$tmp_ip" == "Z" ]; then
tmp_ip=`curl -sL --connect-timeout 3 14.215.150.17:6666`
fi
if [ "Z$tmp_ip" == "Z" ]; then
tmp_ip=`curl -sL --connect-timeout 3 whatismyip.akamai.com`
fi
echo -n $tmp_ip
}
resolve2ip() {
# resolve2ip domain<string>
domain=$1
tmp_ip=`nslookup $domain ns1.alidns.com 2>/dev/null | sed '/^Server/d; /#53$/d' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1`
if [ "Z$tmp_ip" == "Z" ]; then
tmp_ip=`nslookup $domain ns2.alidns.com 2>/dev/null | sed '/^Server/d; /#53$/d' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1`
fi
if [ "Z$tmp_ip" == "Z" ]; then
tmp_ip=`nslookup $domain 114.114.115.115 2>/dev/null | sed '/^Server/d; /#53$/d' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1`
fi
if [ "Z$tmp_ip" == "Z" ]; then
tmp_ip=`curl -sL --connect-timeout 3 "119.29.29.29/d?dn=$domain"`
fi
echo -n $tmp_ip
}
check_aliddns() {
echo "$DATE WAN-IP: ${ip}"
if [ "Z$ip" == "Z" ]; then
echo "$DATE ERROR, cant get WAN-IP..."
return 0
fi
current_ip=$(resolve2ip "$sub_dm.$main_dm")
if [ "Z$current_ip" == "Z" ]; then
rrid='' # NO Resolve IP Means new Record_ID
fi
echo "$DATE DOMAIN-IP: ${current_ip}"
if [ "Z$ip" == "Z$current_ip" ]; then
echo "$DATE IP dont need UPDATE..."
return 0
else
echo "$DATE UPDATING..."
return 1
fi
}
urlencode() {
# urlencode url<string>
out=''
for c in $(echo -n $1 | sed 's/[^\n]/&\n/g'); do
case $c in
[a-zA-Z0-9._-]) out="$out$c" ;;
*) out="$out$(printf '%%%02X' "'$c")" ;;
esac
done
echo -n $out
}
send_request() {
# send_request action<string> args<string>
local args="AccessKeyId=$ak_id&Action=$1&Format=json&$2&Version=2015-01-09"
local hash=$(urlencode $(echo -n "GET&%2F&$(urlencode $args)" | openssl dgst -sha1 -hmac "$ak_sec&" -binary | openssl base64))
curl -sSL --connect-timeout 5 "http://alidns.aliyuncs.com/?$args&Signature=$hash"
}
get_recordid() {
sed 's/RR/\n/g' | sed -n 's/.*RecordId[^0-9]*\([0-9]*\).*/\1\n/p' | sort -ru | sed /^$/d
}
query_recordid() {
send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$sub_dm.$main_dm&Timestamp=$timestamp"
}
update_record() {
send_request "UpdateDomainRecord" "RR=$sub_dm&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
}
add_record() {
send_request "AddDomainRecord&DomainName=$main_dm" "RR=$sub_dm&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
}
del_record() {
send_request "DeleteDomainRecord" "RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp"
}
do_ddns_record() {
if uci_bool_by_name base clean ; then
query_recordid | get_recordid | while read rr; do
echo "$DATE Clean record $sub_dm.$main_dm: $rr"
del_record $rr >/dev/null
timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ")
done
rrid=''
fi
if [ "Z$rrid" == "Z" ]; then
rrid=`query_recordid | get_recordid`
fi
if [ "Z$rrid" == "Z" ]; then
rrid=`add_record | get_recordid`
echo "$DATE ADD record $rrid"
else
update_record $rrid >/dev/null 2>&1
echo "$DATE UPDATE record $rrid"
fi
if [ "Z$rrid" == "Z" ]; then
# failed
echo "$DATE # ERROR, Please Check Config/Time"
else
# save rrid
uci set aliddns.base.record_id=$rrid
uci commit aliddns
echo "$DATE # UPDATED($ip)"
fi
}
clean_log() {
if [ $(cat $log_file 2>/dev/null | wc -l) -ge 16 ]; then
rm -f $log_file && touch $log_file
echo "$DATE Log Cleaned"
fi
}
[ -x /usr/bin/openssl -a -x /usr/bin/curl -a -x /bin/sed ] ||
( echo "Need [ openssl + curl + sed ]" && exit 1 )
ak_id=$(uci_get_by_name base app_key)
ak_sec=$(uci_get_by_name base app_secret)
rrid=$(uci_get_by_name base record_id)
main_dm=$(uci_get_by_name base main_domain)
sub_dm=$(uci_get_by_name base sub_domain)
iface=$(uci_get_by_name base interface)
if [ "Z$iface" == "Zinternet" -o "Z$iface" == "Z" ]; then
ip=$(intelnetip)
else
ip=$(ubus call network.interface.$iface status | grep '"address"' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
fi
DATE=$(date +'%Y-%m-%d %H:%M:%S')
timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ")
clean_log
check_aliddns || do_ddns_record

View File

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

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Amule
LUCI_DEPENDS:=+amule
LUCI_DEPENDS:=+amule-dlp
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk

0
luci-app-amule/root/etc/amule/amule.conf.template Executable file → Normal file
View File

View File

@ -45,8 +45,8 @@ config amule 'main'
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 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'
@ -59,10 +59,10 @@ config amule 'main'
option see_share 'nobody'
option ip_filter_system '0'
option upnp_ec_enabled '0'
option web_enabled '0'
option web_enabled '1'
option upnp_enabled '0'
option proxy_type 'socks5'
option template 'default'
option template 'AmuleWebUI-Reloaded'
option use_low_rights_user '0'
option web_port '44711'
option upnp_web_server_enabled '0'

0
luci-app-amule/root/etc/hotplug.d/iface/20-amule Executable file → Normal file
View File

3
luci-app-amule/root/etc/init.d/amule Executable file → Normal file
View File

@ -159,8 +159,7 @@ amule() {
fi
procd_add_jail amule log
procd_add_jail_mount /usr/bin/amulecmd /usr/bin/amuleweb /usr/share/amule/
procd_add_jail_mount_rw $config_dir
procd_add_jail_mount_rw $config_file
procd_add_jail_mount_rw $incoming_dir
procd_add_jail_mount_rw $temp_dir
procd_close_instance

2
luci-app-amule/root/etc/uci-defaults/luci-amule Executable file → Normal file
View File

@ -7,6 +7,8 @@ uci -q batch <<-EOF >/dev/null
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))}')

View File

@ -1,24 +0,0 @@
#
# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for eqos.
LUCI_DESCRIPTION:=LuCI support for Easy QoS(Support speed limit based on IP address).
LUCI_DEPENDS:=+tc +kmod-sched-core +kmod-ifb
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-eqos
PKG_VERSION:=1.0.0
PKG_RELEASE:=2
PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,13 +0,0 @@
module("luci.controller.eqos", package.seeall)
function index()
if not nixio.fs.access("/etc/config/eqos") then
return
end
local page
page = entry({"admin", "network", "eqos"}, cbi("eqos"), "EQoS")
page.dependent = true
page.acl_depends = { "luci-app-eqos" }
end

View File

@ -1,39 +0,0 @@
local ipc = require "luci.ip"
local m = Map("eqos", translate("Network speed control service"))
local s = m:section(TypedSection, "eqos", "")
s.anonymous = true
local e = s:option(Flag, "enabled", translate("Enable"))
e.rmempty = false
local dl = s:option(Value, "download", translate("Download speed (Mbit/s)"), translate("Total bandwidth"))
dl.datatype = "and(uinteger,min(1))"
local ul = s:option(Value, "upload", translate("Upload speed (Mbit/s)"), translate("Total bandwidth"))
ul.datatype = "and(uinteger,min(1))"
s = m:section(TypedSection, "device", translate("Speed limit based on IP address"))
s.template = "cbi/tblsection"
s.anonymous = true
s.addremove = true
s.sortable = true
local ip = s:option(Value, "ip", translate("IP address"))
ipc.neighbors({family = 4, dev = "br-lan"}, function(n)
if n.mac and n.dest then
ip:value(n.dest:string(), "%s (%s)" %{ n.dest:string(), n.mac })
end
end)
dl = s:option(Value, "download", translate("Download speed (Mbit/s)"))
dl.datatype = "and(uinteger,min(1))"
ul = s:option(Value, "upload", translate("Upload speed (Mbit/s)"))
ul.datatype = "and(uinteger,min(1))"
comment = s:option(Value, "comment", translate("Comment"))
return m

View File

@ -1 +0,0 @@
zh_Hans

View File

@ -1,44 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: LuCi Chinese Translation\n"
"Report-Msgid-Bugs-To: \n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Pootle 2.0.6\n"
msgid "EQoS"
msgstr "网速控制"
msgid "eqos"
msgstr "网速控制"
msgid "Comment"
msgstr "注解"
msgid "Download speed (Mbit/s)"
msgstr "下载速度 (Mbit/s)"
msgid "Enable"
msgstr "开启"
msgid "QoS"
msgstr "QoS"
msgid "Network speed control service"
msgstr "网速控制服务"
msgid "Upload speed (Mbit/s)"
msgstr "上传速度 (Mbit/s)"
msgid "Speed limit based on IP address"
msgstr "IP限速"
msgid "Total bandwidth"
msgstr "总带宽"
msgid "Flow control setting"
msgstr "流控设置"

View File

@ -1,12 +0,0 @@
# The bandwidth unit is Mbit/s
config eqos
option enabled 0
option download 100
option upload 20
# Limiting the bandwidth of a single Device
#config device
# option ip "192.168.1.100"
# option download 10
# option upload 5
# option comment "test"

View File

@ -1,5 +0,0 @@
#!/bin/sh
[ "$ACTION" = "ifup" ] || exit 0
[ "$INTERFACE" = "lan" ] || exit 0
/etc/init.d/eqos start

View File

@ -1,39 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
parse_device() {
local cfg="$1" ip download upload
config_get ip "$cfg" ip
config_get download "$cfg" download
config_get upload "$cfg" upload
eqos add $ip $download $upload
}
eqos_start() {
local cfg="$1" enabled download upload
config_get_bool enabled "$cfg" enabled 0
[ $enabled -eq 0 ] && return 0
config_get download "$cfg" download
config_get upload "$cfg" upload
eqos start $download $upload
config_foreach parse_device device
}
start() {
eqos stop
config_load eqos
config_foreach eqos_start eqos
}
stop() {
eqos stop
}

View File

@ -1,9 +0,0 @@
#!/bin/sh
uci -q get ucitrack.@eqos[0] > /dev/null || {
uci add ucitrack eqos > /dev/null
uci set ucitrack.@eqos[0].init=eqos
uci commit
}
exit 0

View File

@ -1,60 +0,0 @@
#!/bin/sh
dev=br-lan
stop_qos() {
tc qdisc del dev $dev root 2>/dev/null
tc qdisc del dev $dev ingress 2>/dev/null
tc qdisc del dev ${dev}-ifb root 2>/dev/null
ip link del dev ${dev}-ifb 2>/dev/null
}
start_qos() {
local dl=$1
local up=$2
tc qdisc add dev $dev root handle 1: htb
tc class add dev $dev parent 1: classid 1:1 htb rate ${dl}mbit
ip link add dev ${dev}-ifb name ${dev}-ifb type ifb
ip link set dev ${dev}-ifb up
tc qdisc add dev ${dev}-ifb root handle 1: htb
tc class add dev ${dev}-ifb parent 1: classid 1:1 htb rate ${up}mbit
tc qdisc add dev $dev ingress
tc filter add dev $dev parent ffff: protocol ip u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ${dev}-ifb
}
case "$1" in
"stop")
stop_qos
;;
"start")
stop_qos
start_qos $2 $3
;;
"add")
ip="$2"
dl="$3"
up="$4"
cnt=$(tc class show dev $dev | wc -l)
tc class add dev $dev parent 1:1 classid 1:1$cnt htb rate ${dl}mbit ceil ${dl}mbit
tc filter add dev $dev parent 1:0 protocol ip u32 match ip dst $ip flowid 1:1$cnt
tc class add dev ${dev}-ifb parent 1:1 classid 1:1$cnt htb rate ${up}mbit ceil ${up}mbit
tc filter add dev ${dev}-ifb parent 1:0 protocol ip u32 match ip src $ip flowid 1:1$cnt
;;
*)
echo "Usage: $0 <command> [options]"
echo "Commands:"
echo " start dl_rate up_rate #Total bandwidth (Mbit/s)"
echo " stop"
echo " add ip dl_rate up_rate #Limiting the bandwidth of a single IP (Mbit/s)"
echo "Example:"
echo " $0 start 30 20 # Total bandwidth: down 30Mbit/s up 20Mbit/s"
echo " $0 add 192.168.22.12 10 2 # down 10Mbit/s up 2Mbit/s"
;;
esac

View File

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

View File

@ -1,3 +1,4 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

View File

@ -0,0 +1,15 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-go-aliyundrive-webdav
PKG_VERSION:=1.0.2
PKG_RELEASE:=20211031
PKG_MAINTAINER:=jerrykuku <jerrykuku@qq.com>
LUCI_TITLE:=Luci for go-aliyundrive-webdav
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+lua +libuci-lua +go-aliyundrive-webdav
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,82 @@
# luci-app-go-aliyundrive-webdav
<div align="center">
<a href="/LICENSE.txt">
<img src="https://img.shields.io/github/license/jerrykuku/luci-app-go-aliyundrive-webdav?style=flat-square" alt="">
</a><a href="https://github.com/jerrykuku/luci-app-go-aliyundrive-webdav/pulls">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="">
</a><a href="https://github.com/jerrykuku/luci-app-go-aliyundrive-webdav/issues/new">
<img src="https://img.shields.io/badge/Issues-welcome-brightgreen.svg?style=flat-square">
</a><a href="https://github.com/jerrykuku/luci-app-go-aliyundrive-webdav/releases">
<img src="https://img.shields.io/github/release/jerrykuku/luci-app-go-aliyundrive-webdav.svg?style=flat-square">
</a><a href="hhttps://github.com/jerrykuku/luci-app-go-aliyundrive-webdav/releases">
<img src="https://img.shields.io/github/downloads/jerrykuku/luci-app-go-aliyundrive-webdav/total?style=flat-square">
</a><a href="https://t.me/jerryk6">
<img src="https://img.shields.io/badge/Contact-telegram-blue?style=flat-square">
</a>
</div>
# 介绍
本项目是 [go-aliyun-webdav](https://github.com/LinkLeong/go-aliyun-webdav) 的Luci 控制面板。
由 2021.10.31 收录于 [Lean openwrt](https://github.com/coolsnowwolf/lede) 源码中。
### 如何编译
假设你的Lean openwrt最新版本19.07 在 lede 目录下
```
cd lede/package/lean/
git clone https://github.com/jerrykuku/go-aliyundrive-webdav.git #主程序
git clone https://github.com/jerrykuku/luci-app-go-aliyundrive-webdav.git
make menuconfig
#选择 LUci->Application->luci-app-go-aliyundrive-webdav
make -j$(($(nproc) + 1)) V=s #随固件编译
make package/lean/luci-app-go-aliyundrive-webdav/compile V=s #单独编译插件
```
# 客户端兼容性
| 客户端 | 下载 | 上传 | 备注 |
| :-----| ----: | :----: | :----: |
| 群辉Cloud Sync | 可用 | 可用 | 单向同步非常稳定 |
| Rclone | 可用 | 可用 | 推荐,支持各个系统 |
| Mac原生 | 可用 | 可用 | 适配有问题,不建议使用 |
| Windows原生 | 可用 | 有点小问题 | 不建议,适配有点问题,上传报错 |
| RaiDrive | 可用 | 可用 | Windows平台下建议用这个 |
# 浏览器获取refreshToken方式
1. 先通过浏览器建议chrome打开阿里云盘官网并登录https://www.aliyundrive.com/drive/
2. 登录成功后按F12打开开发者工具点击Application点击Local Storage点击 Local Storage下的 [https://www.aliyundrive.com/](https://www.aliyundrive.com/)点击右边的token此时可以看到里面的数据其中就有refresh_token把其值复制出来即可。格式为小写字母和数字不要复制双引号。例子ca6bf2175d73as2188efg81f87e55f11
3. 第二步有点繁琐,大家结合下面的截图就看懂了
![image](https://user-images.githubusercontent.com/32785355/119246278-e6760880-bbb2-11eb-877c-aca16cf75d89.png)
# 功能说明
## 支持的功能
1. 查看文件夹、查看文件
2. 文件移动目录
3. 文件重命名
4. 文件下载
5. 文件删除
6. 文件上传
7. 支持WebDav权限校验默认账户密码admin/123456
8. 文件在线编辑
9. Webdav下的流媒体播放等功能
## 已知问题
1. 没有做文件sha1校验不保证上传文件的100%准确性(一般场景下,是没问题的)
2. 通过文件名和文件大小判断是否重复。也就是说如果一个文件即使发生了更新,但其大小没有任何改变,是不会自动上传的
3. 不支持文件名包含 `/` 字符
4. 部分客户端兼容性不好
# 免责声明
1. 本软件为免费开源项目,无任何形式的盈利行为。
2. 本软件服务于阿里云盘,旨在让阿里云盘功能更强大。如有侵权,请与我联系,会及时处理。
3. 本软件皆调用官方接口实现无任何“Hack”行为无破坏官方接口行为。
5. 本软件仅做流量转发,不拦截、存储、篡改任何用户数据。
6. 严禁使用本软件进行盈利、损坏官方、散落任何违法信息等行为。
7. 本软件不作任何稳定性的承诺,如因使用本软件导致的文件丢失、文件破坏等意外情况,均与本软件无关。

View File

@ -0,0 +1,38 @@
-- Copyright (C) 2021 jerryk <jerrykuku@qq.com>
-- This is free software, licensed under the APACHE LICENSE, VERSION 2.0.
module("luci.controller.go-aliyundrive-webdav", package.seeall)
function index()
if not nixio.fs.access("/etc/config/go-aliyundrive-webdav") then
return
end
entry({"admin", "services", "go-aliyundrive-webdav"}, alias("admin", "services", "go-aliyundrive-webdav", "client"), _("Go AliyunDrive WebDAV"), 10).dependent = true -- 首页
entry({"admin", "services", "go-aliyundrive-webdav", "client"}, cbi("go-aliyundrive-webdav/client"), _("Settings"), 1).leaf = true -- 客户端配置
entry({"admin", "services", "go-aliyundrive-webdav", "log"}, cbi("go-aliyundrive-webdav/log"), _("Log"), 2).leaf = true -- 日志页面
entry({"admin", "services", "go-aliyundrive-webdav", "status"}, call("action_status")).leaf = true
entry({"admin", "services", "go-aliyundrive-webdav", "logtail"}, call("action_logtail")).leaf = true
end
function action_status()
local e = {}
e.running = luci.sys.call("pidof go-aliyundrive-webdav >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function action_logtail()
local fs = require "nixio.fs"
local log_path = "/var/log/go-aliyundrive-webdav.log"
local e = {}
e.running = luci.sys.call("pidof go-aliyundrive-webdav >/dev/null") == 0
if fs.access(log_path) then
e.log = luci.sys.exec("tail -n 100 %s | sed 's/\\x1b\\[[0-9;]*m//g'" % log_path)
else
e.log = ""
end
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -0,0 +1,49 @@
-- Copyright (C) 2021 jerryk <jerrykuku@qq.com>
-- This is free software, licensed under the APACHE LICENSE, VERSION 2.0.
local uci = luci.model.uci.cursor()
local m, e
m = Map("go-aliyundrive-webdav")
m.title = translate("Go AliyunDrive WebDAV")
m.description = translate("<a href=\"https://github.com/LinkLeong/go-aliyun-webdav\" target=\"_blank\">Project GitHub URL</a>")
m:section(SimpleSection).template = "go-aliyundrive-webdav/go-aliyundrive-webdav_status"
e = m:section(TypedSection, "go-aliyundrive-webdav")
e.anonymous = true
enable = e:option(Flag, "enabled", translate("Enabled"))
enable.rmempty = false
rt_token = e:option(Value, "rt", translate("Refresh Token"))
rt_token.description = translate("<a href=\"https://github.com/LinkLeong/go-aliyun-webdav#%E6%B5%8F%E8%A7%88%E5%99%A8%E8%8E%B7%E5%8F%96refreshtoken%E6%96%B9%E5%BC%8F\" target=\"_blank\">How to get refresh token</a>")
port = e:option(Value, "port", translate("Port"))
port.default = "8085"
port.datatype = "port"
path = e:option(Value, "path", translate("Mounting directory"))
path.description = translate("Access aliyundrive directory, defaults /.")
path.default = "/"
user = e:option(Value, "user", translate("Username"))
user.default = "admin"
pwd = e:option(Value, "pwd", translate("Password"))
pwd.password = true
pwd.default = "123456"
verbose = e:option(Flag, "verbose", translate("Enable detailed logging"))
verbose.default = "0"
verbose.rmempty = false
verbose.optional = false
local e = luci.http.formvalue("cbi.apply")
if e then
io.popen("/etc/init.d/go-aliyundrive-webdav restart")
end
return m

View File

@ -0,0 +1,9 @@
log = SimpleForm("logview")
log.submit = false
log.reset = false
t = log:field(DummyValue, '', '')
t.rawhtml = true
t.template = 'go-aliyundrive-webdav/go-aliyundrive-webdav_log'
return log

View File

@ -0,0 +1,15 @@
<%+cbi/valueheader%>
<textarea id="logview" class="cbi-input-textarea" style="width: 100%" rows="30" readonly="readonly"></textarea>
<script type="text/javascript">
const LOG_URL = '<%=luci.dispatcher.build_url("admin", "services", "go-aliyundrive-webdav", "logtail")%>';
XHR.poll(1, LOG_URL, null, (x, d) => {
let logview = document.getElementById("logview");
if (!d.running) {
XHR.halt();
}
logview.value = d.log;
logview.scrollTop = logview.scrollHeight;
});
</script>
<%+cbi/valuefooter%>

View File

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

View File

@ -0,0 +1,55 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "Go AliyunDrive"
msgstr "Go 阿里云盘"
msgid "Go AliyunDrive WebDAV"
msgstr "Go 阿里云盘 WebDAV"
msgid "Enabled"
msgstr "启用"
msgid "Refresh Token"
msgstr "Refresh Token"
msgid "Port"
msgstr "监听端口"
msgid "Mounting directory"
msgstr "挂载目录"
msgid "Access aliyundrive directory, defaults /."
msgstr "访问 aliyundrive 目录,默认为 / 。"
msgid "Username"
msgstr "用户名"
msgid "Password"
msgstr "密码"
msgid "Collecting data..."
msgstr "获取数据中..."
msgid "RUNNING"
msgstr "运行中"
msgid "NOT RUNNING"
msgstr "未运行"
msgid "Settings"
msgstr "设置"
msgid "Log"
msgstr "日志"
msgid "Enable detailed logging"
msgstr "启用详细日志记录"
msgid "<a href=\"https://github.com/LinkLeong/go-aliyun-webdav\" target=\"_blank\">Project GitHub URL</a>"
msgstr "<a href=\"https://github.com/LinkLeong/go-aliyun-webdav\" target=\"_blank\">GitHub 项目地址</a>"
msgid "<a href=\"https://github.com/LinkLeong/go-aliyun-webdav#%E6%B5%8F%E8%A7%88%E5%99%A8%E8%8E%B7%E5%8F%96refreshtoken%E6%96%B9%E5%BC%8F\" target=\"_blank\">How to get refresh token</a>"
msgstr "<a href=\"https://github.com/LinkLeong/go-aliyun-webdav#%E6%B5%8F%E8%A7%88%E5%99%A8%E8%8E%B7%E5%8F%96refreshtoken%E6%96%B9%E5%BC%8F\" target=\"_blank\">查看获取 refresh token 的方法</a>"

View File

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

View File

@ -0,0 +1,11 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@go-aliyundrive-webdav[-1]
add ucitrack go-aliyundrive-webdav
set ucitrack.@go-aliyundrive-webdav[-1].init=go-aliyundrive-webdav
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

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

View File

@ -1,21 +0,0 @@
# Copyright (C) 2020 Openwrt.org
#
# This is a free software, use it under GNU General Public License v3.0.
#
# Created By ImmortalWrt
# https://github.com/project-openwrt
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-gost
PKG_VERSION:=1.0
PKG_RELEASE:=1
LUCI_TITLE:=LuCI support for Gost
LUCI_DEPENDS:=+gost
LUCI_PKGARCH:=all
PKG_MAINTAINER:=ImmortalWrt
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,24 +0,0 @@
-- This is a free software, use it under GNU General Public License v3.0.
-- Created By ImmortalWrt
-- https://github.com/immortalwrt
module("luci.controller.gost", package.seeall)
function index()
if not nixio.fs.access("/etc/config/gost") then
return
end
local page
page = entry({"admin", "services", "gost"}, cbi("gost"), _("Gost"), 100)
page.dependent = true
page.acl_depends = { "luci-app-gost" }
entry({"admin", "services", "gost", "status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep gost >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -1,20 +0,0 @@
-- Created By ImmortalWrt
-- https://github.com/immortalwrt
mp = Map("gost", translate("Gost"))
mp.description = translate("A simple security tunnel written in Golang.")
mp:section(SimpleSection).template = "gost/gost_status"
s = mp:section(TypedSection, "gost")
s.anonymous=true
s.addremove=false
enable = s:option(Flag, "enable", translate("Enable"))
enable.default = 0
enable.rmempty = false
run_command = s:option(Value, "run_command", translate("Command"))
run_command.rmempty = false
return mp

View File

@ -1 +0,0 @@
zh_Hans

View File

@ -1,17 +0,0 @@
msgid "Gost"
msgstr "Gost"
msgid "A simple security tunnel written in Golang."
msgstr "GO语言实现的安全隧道。"
msgid "RUNNING"
msgstr "运行中"
msgid "NOT RUNNING"
msgstr "未运行"
msgid "Enable"
msgstr "启用"
msgid "Command"
msgstr "命令"

View File

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

View File

@ -271,6 +271,7 @@
18a8f5a1c1.com
18clicks.com
18tzx.com
19811231.me
1999019.com
199b8977fc.com
199zw.com
@ -512,6 +513,7 @@
3338877.com
3381e74f70adfb59.com
338336.com
338f4d497f.com
3393.com
33across.com
33ceaea337.cfd
@ -593,6 +595,7 @@
42837932b3d.com
42a5d530ec972d8994.com
42d61f012e27b36d53.com
42fd278b95.com
43137c93a82b0e81da.com
4399.space
4480dy.net
@ -607,6 +610,7 @@
48331375c351e.com
485d0bd3f4.com
48d58df525.com
493b0eda03.com
493b98cce8bc1a2dd.com
4affiliate.net
4b6994dfa47cee4.com
@ -995,6 +999,7 @@
833e4c13ecc.com
8341.store
835551.com
840df00e08.com
8456.xyz
8547459af5da02.com
8563p.cn
@ -1430,6 +1435,7 @@ absorbinginject.com
abstractedauthority.com
absurdwater.com
abtasty.com
abundantshells.com
abundled.club
abusedbabysitters.com
abuseewarlock.com
@ -3658,6 +3664,7 @@ arkn81.com
arliest.com
arlottencert.club
armashair.site
armaturepaletteopenminded.com
armedgroin.com
armiesgaspclue.com
armlyemoan.com
@ -4998,6 +5005,7 @@ blck4d.com
blcobmv.cn
bleaborahm.one
bleinu.com
blendorbraker.com
blenkbenched.casa
bleopi.com
blessgarments.com
@ -5528,6 +5536,7 @@ byvuwhubi.com
bzlpa.cn
bznxc6721.xyz
bzrmxfxu.com
bzwcgscqnf.com
c-5uwzmx78pmca09x24aiux2euavx2ekwu.g00.msn.com
c.28rv.com
c.bannerflow.net
@ -5549,6 +5558,7 @@ c1.nowlinux.com
c10ed2b8b417880.com
c12bleue.com
c1exchange.com
c212.net
c3t-system-err.club
c3y1oja.cn
c40.xyz
@ -5736,6 +5746,7 @@ catwenbat.com
catwrite.com
catynydy.com
cauntercanulae.com
caunuscoagel.com
caupdcloud.cn
causecherry.com
causerestrainrecorder.com
@ -5809,6 +5820,7 @@ cdn.bannerflow.com
cdn.branch.io
cdn.freshmarketer.com
cdn.heapanalytics.com
cdn.house
cdn.imvkan.com
cdn.keywee.co
cdn.onesignal.com
@ -6184,6 +6196,7 @@ cj-cy.com
cj.com
cjbmanagement.com
cjde.xyz
cjenxpjxxhdwtp.xyz
cjezgbjbltos.com
cjf25jklrwqt.com
cjgcedu.com
@ -7270,6 +7283,7 @@ d162nnmwf9bggr.cloudfront.net
d175dtblugd1dn.cloudfront.net
d188elxamt3utn.cloudfront.net
d188m5xxcpvuue.cloudfront.net
d18e74vjvmvza1.cloudfront.net
d18g6t7whf8ejf.cloudfront.net
d18mealirgdbbz.cloudfront.net
d18t35yyry2k49.cloudfront.net
@ -8306,6 +8320,7 @@ dokauzob.top
dolinaphtalic.com
dollarade.com
dollarhene.com
dolleddhaman.com
dollsdeclare.com
dolohen.com
dolphinanthill.com
@ -8986,6 +9001,7 @@ ejectsurvivalfollower.com
ejghw.cn
ejieban.com
ejktj.com
ejnjapw.cn
ejoonsoo.net
ejunshi.com
ejurzsax.com
@ -9399,6 +9415,7 @@ ewasadirec.com
ewedivotsfop.com
ewetwitter.com
ewithjam.club
ewmpvsajrhxbuev.xyz
ewooe6df.com
ewrerew29w09.com
ewruuqe5p8ca.com
@ -10939,6 +10956,7 @@ godfulsiums.com
godloveme.cn
godspeaks.net
godvwcft.com
goercoshes.com
goergleeds.com
gogoplexer.com
gohillgo.com
@ -11083,6 +11101,7 @@ grannynightmare.com
grapeshot.co.uk
gratecowgram.com
graterpartnership.com
graths.com
gratificationposture.com
gratingtode.com
graucoay.net
@ -11451,6 +11470,7 @@ hao61.net
haoanfang.cn
haodazhizhuangzhuang.club
haodiwh.top
haodong.site
haoerer.cn
haogame.me
haohuisheng555.cn
@ -12522,6 +12542,7 @@ ilirlyduzxb.com
ilkmawgod.site
ilkrileashes.com
illallwoe.com
illegalprotected.com
illfatedsnail.com
illicitdandily.cam
illiticguiding.com
@ -12611,6 +12632,7 @@ impactlaterhand.com
impactradius-go.com
impactradius.com
impactserving.com
impatientlyastonishing.com
impeacknow.xyz
imperialteamattended.com
imperturbablechoreinterrogation.com
@ -12902,6 +12924,7 @@ iqu-operation.com
iqzgqivb.com
ir2aok.com
iraithiz.com
iratelyveinlet.com
irchan.com
irecentlym.club
iredirect.net
@ -15806,6 +15829,7 @@ mjyjt.biz
mjywk.cn
mjzsw.vip
mk1lyl406xmp.com
mk6n4ym.cn
mkhoj.com
mkjsqrpmxqdf.com
mkjunc.cn
@ -16297,6 +16321,7 @@ myyuye.club
myz11111.cn
myz33333.cn
myzk1.com
mzcd.xyz
mzlscqarnm.com
mzokqm.cn
mzol7lbm.com
@ -17748,6 +17773,7 @@ paintifiercute.club
paiptoaz.com
paishuiban.ltd
paishuno.net
pajinse.top
pakistant.club
palasidesdoor.com
paleleaf.com
@ -17922,6 +17948,7 @@ pdqgywt.cn
pdrfvumww.com
pdsjycm.com
pdss.xyz
pdsvrtb.cn
pdvacde.com
pdxgfnnoan.com
peacebanana.com
@ -18290,6 +18317,7 @@ plantinscription.com
plants.ink
plardi.com
plashcashierbleach.com
plastic-wood.cn
platado.com
platesworked.com
platif.com
@ -18421,6 +18449,7 @@ pompouseruptionrang.com
pompysxdz.com
pon-prairie.com
ponchowafesargb.com
ponderouscentigradecredit.com
pontymonti.com
pooboafi.net
poodledopas.cam
@ -18880,6 +18909,7 @@ pstmrk.it
pstreetma.com
psugeglapha.com
psuglymave.com
psuhexitu.pro
psuhuchize.com
psulsobi.net
psupaids.com
@ -19328,6 +19358,7 @@ qkuvmwf.cn
ql.tc
ql.uzuzuz.com
qlcabgpjyh.com
qljwkthllpjsi.com
qlmqzznfcb.com
qloved.cn
qlpwqpvuw.com
@ -19498,6 +19529,7 @@ qwhbkjlawhw.com
qwnkvvtuxivur.com
qwpetywdh.com
qwtomdpb.com
qwzpslp.cn
qxfly.com
qxrprutdlcpah.xyz
qxtwkq.cn
@ -20182,6 +20214,7 @@ rjnjjin.cn
rjtgbjxfyslvdst.com
rjtpos.cn
rkllcrwtftx.com
rkoepfotesi.com
rkomf.com
rktupt.cn
rkumsvlvfeeewog.xyz
@ -21368,6 +21401,7 @@ sleeveashame.com
slgioxv.cn
slgo.club
slhoisgdhs.com
slicktrulyuptown.com
slideff.com
slightcareconditions.com
slightists.xyz
@ -22654,6 +22688,7 @@ tend.io
tendents.club
tendertest.com
tenderunderstatement.com
tenezratio.com
tengmoneron.com
tengxunwang.top
tenthsfrumpy.com
@ -23611,6 +23646,7 @@ tuzufsi.cn
tv1s4d6klh4n.com
tvbpusyqohxu.com
tvbxcg6.com
tvgvlpnpetxysl.com
tvlipevrj.com
tvnewtop.pro
tvprocessing.com
@ -24426,6 +24462,7 @@ vipcpms.com
viperydeer.com
viphdk.xyz
vipicmou.net
vipytyl.ltd
viqxlggexukmnjf.com
viqyxamy.xyz
viral481.com
@ -25318,6 +25355,7 @@ wootwood.com
woovooza.net
woowhaiz.net
wooyehnunmi.com
woqi.shop
woqkhzpu.com
woquwaimai.vip
word168.cn
@ -25592,6 +25630,7 @@ xaokiotravel.com
xapa.xyz
xapads.com
xaqdf.com
xarqnuelxtvajgp.xyz
xatczs.cn
xauthorous.club
xavingtsun.com
@ -25814,6 +25853,7 @@ xjhjtz.cn
xjhmap.cn
xjjkxcg.cn
xjngxaij.com
xjpnycwqr.com
xjsq.xyz
xk2012.com
xkkcfmytuci.xyz
@ -26071,11 +26111,13 @@ ya1vg3w.cn
yaaci.cn
yab-adimages.s3.amazonaws.com
yaba.org.cn
yabloomambloo.com
yabqg.cn
yabuka.com
yaccidedap.top
yacihhktw.com
yadro.ru
yahblemable.com
yahekby.cn
yajiuwz.xyz
yajvdoporjtz.com

674
luci-app-npc/LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

19
luci-app-npc/Makefile Executable file
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 Nps Client
LUCI_DEPENDS:=+wget +npc
LUCI_PKGARCH:=all
PKG_VERSION:=1.1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

9
luci-app-npc/README.md Executable file
View File

@ -0,0 +1,9 @@
依赖: [npc][1]
截图:
![截图][2]
[1]: https://github.com/lloyd18/npc
[2]: https://raw.githubusercontent.com/lloyd18/luci-app-npc/master/Snipaste_2020-07-29_05-36-52.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,17 @@
module("luci.controller.npc",package.seeall)
function index()
if not nixio.fs.access("/etc/config/npc")then
return
end
local e
e=entry({"admin","services","npc"},cbi("npc"),_("Npc"),100)
e.i18n="npc"
e.dependent=true
entry({"admin","services","npc","status"},call("status")).leaf=true
end
function status()
local e={}
e.running=luci.sys.call("pgrep npc > /dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -0,0 +1,62 @@
m=Map("npc")
m.title=translate("Nps Client")
m.description=translate("Nps is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.")
m:section(SimpleSection).template="npc/npc_status"
s=m:section(TypedSection,"npc")
s.addremove=false
s.anonymous=true
s:tab("basic",translate("Basic Setting"))
enable=s:taboption("basic",Flag,"enabled",translate("Enable"))
enable.rmempty=false
server=s:taboption("basic",Value,"server_addr",translate("Server"))
server.datatype="host"
server.optional=false
server.rmempty=false
port=s:taboption("basic",Value,"server_port",translate("Port"))
port.datatype="port"
port.default="8024"
port.optional=false
port.rmempty=false
protocol=s:taboption("basic",ListValue,"protocol",translate("Protocol Type"))
protocol.default="tcp"
protocol:value("tcp",translate("TCP Protocol"))
protocol:value("kcp",translate("KCP Protocol"))
auto_reconnection=s:taboption("basic",ListValue,"auto_reconnection",translate("Auto Reconnection"))
auto_reconnection.default="true"
auto_reconnection:value("true",translate("True"))
auto_reconnection:value("false",translate("False"))
vkey=s:taboption("basic",Value,"vkey",translate("vkey"))
vkey.optional=false
vkey.password=true
vkey.rmempty=false
compress=s:taboption("basic",Flag,"compress",translate("Enable Compression"),translate("The contents will be compressed to speed up the traffic forwarding speed, but this will consume some additional cpu resources."))
compress.default="1"
compress.rmempty=false
crypt=s:taboption("basic",Flag,"crypt",translate("Enable Encryption"),translate("Encrypted the communication between Npc and Nps, will effectively prevent the traffic intercepted."))
crypt.default="1"
crypt.rmempty=false
log_level=s:taboption("basic",ListValue,"log_level",translate("Log Level"))
log_level:value(0,"Emergency")
log_level:value(1,"Alert")
log_level:value(2,"Critical")
log_level:value(3,"Error")
log_level:value(4,"Warning")
log_level:value(5,"Notice")
log_level:value(6,"Info")
log_level:value(7,"Debug")
log_level.default="3"
return m

View File

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

42
luci-app-npc/po/zh_Hans/npc.po Executable file
View File

@ -0,0 +1,42 @@
# zh_CN translation for npc.
# Copyright (C) 2015 Yoyodyne, Inc. (msgids)
# This file is distributed under the same license as the gettext package.
#
msgid ""
msgstr ""
"PO-Revision-Date: 2015-09-01 09:53中国标准时间\n"
"Last-Translator: mujw <mujw@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"
msgid "Nps Client"
msgstr "Nps 客户端"
msgid "Server"
msgstr "Server"
msgid "Auto Reconnection"
msgstr "自动重连"
msgid "Nps is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
msgstr "Nps 是一款轻量级、高性能、功能强大的内网穿透代理服务器"
msgid "Basic Setting"
msgstr "基本设置"
msgid "Enable Compression"
msgstr "压缩传输"
msgid "Enable Encryption"
msgstr "加密传输"
msgid "Protocol Type"
msgstr "协议类型"
msgid "The contents will be compressed to speed up the traffic forwarding speed, but this will consume some additional cpu resources."
msgstr "压缩传输内容,加快流量转发速度,会额外消耗 cpu 资源"
msgid "Encrypted the communication between Npc and Nps, will effectively prevent the traffic intercepted."
msgstr "加密传输 npc 与 nps 之间的通信内容,会有效防止流量被拦截"

View File

@ -0,0 +1,12 @@
config npc 'config'
option enabled '0'
option server_addr '1.1.1.1'
option server_port '8024'
option protocol 'tcp'
option compress '1'
option crypt '1'
option vkey 'aaa'
option log_level '4'
option auto_reconnection 'true'

View File

@ -0,0 +1,83 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
START=50
USE_PROCD=1
LOGFILE="npc.log"
tmp_conf_dir="/tmp/etc/"
tmp_conf_file="npc.conf"
tmp_conf_path="$tmp_conf_dir$tmp_conf_file"
export Enabled
export server_addr server_port protocol vkey compress crypt log_level auto_reconnection
npc_header() {
config_get Enabled $1 enabled
config_get server_addr $1 server_addr
config_get server_port $1 server_port
config_get protocol $1 protocol
config_get vkey $1 vkey
config_get compress $1 compress
config_get crypt $1 crypt
config_get log_level $1 log_level
config_get auto_reconnection $1 auto_reconnection
}
npc_write_bool() {
val="$1"
conffile="$2"
if [ "${val}" = "0" ]; then
echo "${val}=false" >> $conffile
else
echo "${val}=true" >> $conffile
fi
}
npc_gen_conf() {
if [ ! -d "$tmp_conf_dir" ]; then
mkdir -p "$tmp_conf_dir"
fi
echo "[common]" >$tmp_conf_path
echo "server_addr=${server_addr}:${server_port}" >> $tmp_conf_path
echo "conn_type=${protocol}" >> $tmp_conf_path
echo "vkey=${vkey}" >>$tmp_conf_path
echo "auto_reconnection=${auto_reconnection}" >> $tmp_conf_path
npc_write_bool compress $tmp_conf_path
npc_write_bool crypt $tmp_conf_path
}
start_service() {
config_load npc
config_foreach npc_header npc
if [ "$Enabled" = "1" ];then
npc_gen_conf npc
logger -t FRPC 'Starting Nps Client service'
#service_start /usr/bin/npc -config=$tmp_conf_path -log_level=$Log_level -log_path=$LOGFILE
procd_open_instance
procd_set_param command /usr/bin/npc -config=$tmp_conf_path -log_level=$log_level
procd_set_param file $tmp_conf_path
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
fi
}
service_triggers()
{
procd_add_reload_trigger "npc"
}
reload_service()
{
echo "restarting npc service"
stop
start
}

View File

@ -1,9 +1,9 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@gost[-1]
add ucitrack gost
set ucitrack.@gost[-1].init=gost
delete ucitrack.@npc[-1]
add ucitrack npc
set ucitrack.@npc[-1].init=npc
commit ucitrack
EOF

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