package lean: move to packages
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
562a046e2c
commit
c69515fcaf
@ -1,86 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic-Go
|
||||
PKG_VERSION:=0.2.10
|
||||
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:=2103562e399d04fcce0aa017057357e6fcec8beb6dc65c17ad1bdc06f38d6b7a
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Silvan <cnsilvan@gmail.com>
|
||||
|
||||
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"
|
||||
default y
|
||||
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))
|
||||
@ -1,21 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDdzCCAl+gAwIBAgIJAKX8LdIETDklMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV
|
||||
BAYTAkNOMSQwIgYDVQQDDBtVbmJsb2NrTmV0ZWFzZU11c2ljIFJvb3QgQ0ExHTAb
|
||||
BgNVBAoMFEdpdEh1Yi5jb20gQG5vbmRhbmVlMB4XDTE5MDUxODE2MDU0NVoXDTI0
|
||||
MDUxNjE2MDU0NVowUjELMAkGA1UEBhMCQ04xJDAiBgNVBAMMG1VuYmxvY2tOZXRl
|
||||
YXNlTXVzaWMgUm9vdCBDQTEdMBsGA1UECgwUR2l0SHViLmNvbSBAbm9uZGFuZWUw
|
||||
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQD23K6Ti2TfLJToCmpCAVgE
|
||||
Xb8+qTMfrifCpnKlJ+hrL+4KI1j4vSqTOOatqmxGSXZdF/j2kJuI40YThaokcgYx
|
||||
GFcPcEftSCYGWy8o20u2hzTkkW3KW9wlsDRIXICFXVIsHeSDwz+aVSudkyJHjfaS
|
||||
aLNb5pPovE7MRj8tDbp55scaSqhEcOe3m1ZlwlCeeXvD7RLKr3xhBKbGEqlJAjFq
|
||||
RNGzuqylqyJVBLScNHC7Lcf4n6pKr1yPGOeLePOUrIwtj0ynHUcBfeMuCVCsIKL8
|
||||
vy/oNwlDrZaAMfu5QQslzEf87KY1QgtI6Ppii+tzbmVx1ZxnlaCKqiuwlgBoi/5r
|
||||
AgMBAAGjUDBOMB0GA1UdDgQWBBRDhbGjnXEUouE9wNFS2k9PtgYYjDAfBgNVHSME
|
||||
GDAWgBRDhbGjnXEUouE9wNFS2k9PtgYYjDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3
|
||||
DQEBCwUAA4IBAQDRUh5+JFLEALXQkhPfwrVf4sCXTwLMwVujTPo3NMbhpWiP4cnn
|
||||
XHGCD5V57bBwjeD6NSrczDIdnN9uTJyFmLNVFMZBguEIeZfLUJLJ6w1ZhfgciX1D
|
||||
9djyyo6eclkHvi+aPZKfzgMmc5BvHcjyUyS5MzI23kUW6WXUDn3IDIUKrfaH9Mjc
|
||||
/d4DDZVKQCYrLoBL+XO7pEHUY0u9XZVYWEavQ5tSN8XY1SDrO0yGUpRWET0ltubE
|
||||
zV7W0LOhuoVCiemboc5H8+njBjCis8obAo1XMmDZzW189L9GPFxHNWlka+KlajZB
|
||||
tMo90PooZYEOw1rTUrzHb+VZY/tYIAAomGZ0
|
||||
-----END CERTIFICATE-----
|
||||
@ -1,22 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDkjCCAnqgAwIBAgIJAK/bIUIlE36LMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV
|
||||
BAYTAkNOMSQwIgYDVQQDDBtVbmJsb2NrTmV0ZWFzZU11c2ljIFJvb3QgQ0ExHTAb
|
||||
BgNVBAoMFEdpdEh1Yi5jb20gQG5vbmRhbmVlMB4XDTIwMDUxNjE3MTIxM1oXDTIx
|
||||
MDUxNjE3MTIxM1owezELMAkGA1UEBhMCQ04xETAPBgNVBAcMCEhhbmd6aG91MSww
|
||||
KgYDVQQKDCNOZXRFYXNlIChIYW5nemhvdSkgTmV0d29yayBDby4sIEx0ZDERMA8G
|
||||
A1UECwwISVQgRGVwdC4xGDAWBgNVBAMMDyoubXVzaWMuMTYzLmNvbTCCASIwDQYJ
|
||||
KoZIhvcNAQEBBQADggEPADCCAQoCggEBALobECypwEoe8VqM/FJvBRR3p2T+ZWdi
|
||||
MSPrwfiRJr5p7OMtWBlLveCBV85+R3feidYbQTXlvVTdToY+GN6mFE1x6zG2dvLD
|
||||
s4UuRnipmvGcFYhIRTX8J4AJiN8VMtW0TNXscRMudpz/FAVtsRrggRaThYg4f/rI
|
||||
oAPMqKMsS4JoYhxs9ED6E6/tpj3XmSg1ekaXhgacYSYHeyxizZwoOFVCLH3TG5sF
|
||||
sD6CYNnukYol8bR+VRpvHftIYss5Yz+DyyhYEAMJm1CfQo+xoGR3D0ozbT3hUnzm
|
||||
fEoOhmSp3sALrFVE4iJSuajoh2/3xhmcyi3xZdWyq4F8hpb+URyaoW0CAwEAAaNC
|
||||
MEAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwKQYDVR0RBCIwIIINbXVzaWMuMTYzLmNv
|
||||
bYIPKi5tdXNpYy4xNjMuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQB+zW0o1169aGQI
|
||||
7GA/8BQ769svpkpdy/lfvkokapFjzoxLTBQhjMo9rqzmGOwr9ksePwQqSDXn685W
|
||||
mKnEl0CzhBrKnL5x3gHus8bg591xpW+01xAFXSyLITOfMJqMEdY7ylymkm0XZ3aN
|
||||
vm+yFdP1fr/bZNw6Wrprg3i7eGhj7TdBXRA96usVgBcnCkC1SzEZfnDZsKl9o8Xx
|
||||
TSOpvzIMSaD7++Bp7BdzA5oCCydv2c++zV/sgCPIr26Jq8UQac+qQP5SMlYyGbAl
|
||||
vIQRRZyfQ4fPonYDnEPHWFCMyBkQIN39LMhDRsUgn8bT0rnP91xkNAd9S4VWbNDA
|
||||
5TMiQy3F
|
||||
-----END CERTIFICATE-----
|
||||
@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAuhsQLKnASh7xWoz8Um8FFHenZP5lZ2IxI+vB+JEmvmns4y1Y
|
||||
GUu94IFXzn5Hd96J1htBNeW9VN1Ohj4Y3qYUTXHrMbZ28sOzhS5GeKma8ZwViEhF
|
||||
NfwngAmI3xUy1bRM1exxEy52nP8UBW2xGuCBFpOFiDh/+sigA8yooyxLgmhiHGz0
|
||||
QPoTr+2mPdeZKDV6RpeGBpxhJgd7LGLNnCg4VUIsfdMbmwWwPoJg2e6RiiXxtH5V
|
||||
Gm8d+0hiyzljP4PLKFgQAwmbUJ9Cj7GgZHcPSjNtPeFSfOZ8Sg6GZKnewAusVUTi
|
||||
IlK5qOiHb/fGGZzKLfFl1bKrgXyGlv5RHJqhbQIDAQABAoIBAEmAvtalBMlBh1mY
|
||||
LV/xcTQwPfDpeOtoILhrOOUPjxnNhD4FfrIe9BNjgmaQAXIadp4VjZ/X6PtHnOfw
|
||||
RqpJNeOQhq/PvRMMsC59pF+rvQKH/wkgYhV8Ta2IFoLlQHqfB2nGRLKquzYumJ28
|
||||
QSK4YMOl6CtxBTrrWiemAUTRDdGm8tARiipJH1SEJrS6d/NoRoJx2vixFgD2eS6X
|
||||
bjnhGjIzvX/w5FWjctqj+SFITP1UI62b6DyWsPOkoosKNteK+Ulz+K6ZFvOx7day
|
||||
XgUoTcVpwCVr2dVGhJtOrbKPcl1jYCYHJAHwzUZND4x4yftm1mnnsi3bthYqbtHQ
|
||||
vxLE9YECgYEA9hiZxwiVvLjSe1xT/D75HbB8S1XSnwzpMmqgzStguxCQ0Qg5yiLI
|
||||
UKRDY8UZvEDV4i2bQGy7mk8lFvX1q2z7Q30+dtT9r2N9a6ujMk5RMfo2BZg/poI6
|
||||
yDWe2tKUg9cTwfgni4TutLOYkpz3VDPIQHs3k2mpNh7f+8X4RIybDqkCgYEAwZhp
|
||||
uWMV38Bb0WytswHXL1dRuwBskKqALUBY61dtXkyBuocj8AuRRxfxfZpgJRrHFxDX
|
||||
O9bQ2nxpVlwKsR6DJDUdxU3+kvwyPfseU5XUBey8WdkuAKD7cKZOHMhFVWccks0U
|
||||
YJzykNrxB+rGTiwVKa0MOhipuJ7boerwwaN2SyUCgYBP9Ow5o4tq9q3EUNoksZ0k
|
||||
zUuE+oxlCr/VlplKL9bM0HQMxlxoVWa59LTEfKyA4pvbUbAIfYtydlZ5oE5CdTUp
|
||||
105tM4R88Jk2W1y5ooJ093OH29CKW/OXSvyi4hpIv592vRa0GOupoFRpBkDBhdWB
|
||||
RcdnyMOmht+FIOwp8XkLiQKBgAUK3j4Y6ZnxXbLfvMp70soF4TgYs7s05a/IDEjc
|
||||
9xlMrthX6sS22GrcocqeucBdqS/dnW2Ok9QNB4VbUl/4pnvL8mGQPYBAl2Jr5wdQ
|
||||
ULxyxRkmAf+8MbBmdIRlZwDpdaIRO2Wk0OCbA0osgEvK9CYovrfIqqsHYDsgbnLs
|
||||
ugkNAoGBAJok06BN05caPXXLQ2pMwI/7mjcZFjcOMxSloYi7LFkxlyvoTqReAeSa
|
||||
yOb6W/7obS1X8ms/EAkqiyzJuPtNZJCW/nvV0iCoZ/NxLuyHnFaO344GBAweol+S
|
||||
Jx0MY8KuDCyeGErc2xdz/yr3ld2PSTq71dhBluGyba2YX+peJ2Yv
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@ -1,54 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic
|
||||
PKG_VERSION:=0.25.3
|
||||
PKG_RELEASE:=6
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/nondanee/UnblockNeteaseMusic.git
|
||||
PKG_SOURCE_DATE:=2020-12-22
|
||||
PKG_SOURCE_VERSION:=b8d5f4b4fe59cef9c021b99f3cf2606d99fa4790
|
||||
PKG_MIRROR_HASH:=bd7fa102415ae8dbcd22829fce5ad0cd358a0869547c30f10271389e6c698317
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/UnblockNeteaseMusic
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=Revive Netease Cloud Music (NodeJS)
|
||||
URL:=https://github.com/nondanee/UnblockNeteaseMusic
|
||||
DEPENDS:=+node +libopenssl
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
xzcat $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
echo -e $(PKG_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/core_ver
|
||||
echo -e $(PKG_SOURCE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/local_ver
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/UnblockNeteaseMusic/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusic
|
||||
$(CP) $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/* $(1)/usr/share/UnblockNeteaseMusic
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,UnblockNeteaseMusic))
|
||||
@ -1,73 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=adbyby
|
||||
PKG_VERSION:=2.7
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/adbyby
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Powerful adblock module to block ad.
|
||||
DEPENDS:=@(i386||x86_64||arm||aarch64||mipsel||mips)
|
||||
URL:=http://www.adbyby.com/
|
||||
endef
|
||||
|
||||
define Package/adbyby/description
|
||||
Adbyby is a powerful adblock module to block ad,just like adblock.
|
||||
endef
|
||||
|
||||
ifeq ($(ARCH),i386)
|
||||
ADBYBY_DIR:=x86
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
ADBYBY_DIR:=amd64
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
ADBYBY_DIR:=armv7
|
||||
ifeq ($(CONFIG_HAS_FPU),)
|
||||
ADBYBY_DIR:=arm
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),aarch64)
|
||||
ADBYBY_DIR:=armv7
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),mips)
|
||||
ADBYBY_DIR:=mips
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),mipsel)
|
||||
ADBYBY_DIR:=mipsle
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/adbyby/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby
|
||||
$(INSTALL_BIN) ./files/adbyby.sh $(1)/usr/share/adbyby/
|
||||
$(INSTALL_CONF) ./files/adhook.ini $(1)/usr/share/adbyby/
|
||||
$(INSTALL_CONF) ./files/user.action $(1)/usr/share/adbyby/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby/data
|
||||
$(INSTALL_DATA) ./files/data/* $(1)/usr/share/adbyby/data/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby/doc
|
||||
$(INSTALL_DATA) ./files/doc/* $(1)/usr/share/adbyby/doc/
|
||||
|
||||
$(INSTALL_BIN) ./files/$(ADBYBY_DIR)/adbyby $(1)/usr/share/adbyby/adbyby
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,adbyby))
|
||||
@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
PROG_PATH=/usr/share/adbyby
|
||||
err=0
|
||||
until [ $err -ge 5 ]; do
|
||||
if [ -n "$(pgrep $PROG_PATH/adbyby)" ]; then
|
||||
iptables-save | grep ADBYBY >/dev/null || \
|
||||
/etc/init.d/adbyby add_rule
|
||||
sleep 10
|
||||
err=0
|
||||
else
|
||||
$PROG_PATH/adbyby --no-daemon &>/dev/null &
|
||||
sleep 1
|
||||
err=$((err+1))
|
||||
fi
|
||||
done
|
||||
/etc/init.d/adbyby del_rule
|
||||
@ -1,14 +0,0 @@
|
||||
[cfg]
|
||||
### 2.1 ###
|
||||
listen-address=0.0.0.0:8118
|
||||
buffer-limit=1024
|
||||
keep-alive-timeout=30
|
||||
socket-timeout=60
|
||||
### 2.5 ###
|
||||
max_client_connections=0
|
||||
### 2.6 ###
|
||||
stack_size=200
|
||||
auto_restart=0
|
||||
### 2.7 ###
|
||||
debug=0
|
||||
ipset=0
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,25 +0,0 @@
|
||||
! -----¸üÐÂʱ¼ä: 2018-10-08 23:07:52 by:xwhyc-----
|
||||
.php?ad=
|
||||
/99rejs/js
|
||||
/agetsou.js^
|
||||
/c@*!25.js|$script
|
||||
/cococ-66/$script
|
||||
/defaultts.tc.qq.com/*.ts?index=0&start=0&
|
||||
/defaultts.tc.qq.com/*.ts?index=0&start=0&end=*&ver=4
|
||||
/gg_js/
|
||||
/imgs.js?t=
|
||||
/js/adtop.js|
|
||||
/js/guanggao_gg.js?d=
|
||||
/js/sss/ad.js
|
||||
/static/js/aall.js
|
||||
/unionjs/$script
|
||||
/variety.tc.qq.com/*.mp4^*fmt=hd
|
||||
/variety.tc.qq.com/*.mp4^*fmt=shd
|
||||
/video.dispatch.tc.qq.com/*.mp4^*sdtfrom=
|
||||
/view/image/QT_HY.jpg?t=
|
||||
/view/js/slade.js|$script
|
||||
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=hd
|
||||
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=shd
|
||||
/vmind.qqvideo.tc.qq.com/*.mp4^*sdtfrom=
|
||||
/vmindhls.tc.qq.com/*ugc=0&ga=0&gv=0&start=
|
||||
/zzhzgg.js
|
||||
@ -1,15 +0,0 @@
|
||||
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
|
||||
! -------------- 规则基于abp规则,并进行了字符替换部分的扩展-----------------------------
|
||||
! ABP规则请参考https://adblockplus.org/zh_CN/filters,下面为大致摘要
|
||||
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
|
||||
! "*" 为字符通配符,能够匹配0长度或任意长度的字符串,该通配符不能与正则语法混用。
|
||||
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
|
||||
! "|" 为管线符号,来表示地址的最前端或最末端
|
||||
! "||" 为子域通配符,方便匹配主域名下的所有子域。
|
||||
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
|
||||
! "##" 为元素选择器标识符,后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
|
||||
!! 元素隐藏暂不支持全局规则和排除规则
|
||||
!! 字符替换扩展
|
||||
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
|
||||
! 支持通配符*和?
|
||||
! -------------------------------------------------------------------------------------------
|
||||
@ -1,30 +0,0 @@
|
||||
! -----更新时间: 2018-10-08 23:06:11 by:xwhyc-----------------------------------------------
|
||||
! -----广告反馈:http://www.adbyby.com/help.htm QQ群: 79547134(满), 364066294(满),470705224(满),534897434,438394572--------------
|
||||
|
||||
|
||||
!-------------------------------------------
|
||||
/showadv/
|
||||
3199.cn###ad640,[id^="ad0"]
|
||||
76fengyun.com###down_box{display:block!important;}.gggg,.ggao
|
||||
9553.com##[class="zm"]
|
||||
962.net##.show_ad,.g-962-ad
|
||||
amazon.cn##.adv-float-div
|
||||
downsx.rocks##.adbox,.Left-ad3_fixed,.google-ad2_fixed
|
||||
edu-acc.cn###doyoo_monitor
|
||||
fx678.com##[class^="adv-"]
|
||||
||76fengyun.com/body22233.js
|
||||
||76fengyun.com/file/$s@onclick="window.open('*');startWait();"@onclick="window.open(document.getElementById('downpage_link').href);startWait();"@
|
||||
||atanx.alicdn.com/t/tanxssp.js?_v=
|
||||
||biquguan.com/guan/$script
|
||||
||djv99sxoqpv11.cloudfront.net
|
||||
||jmxlaser.com
|
||||
||jump2.bdimg.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
|
||||
||nxkycx.com
|
||||
||res.jklan.cn/wp-content/themes/tt/js/system.js?ver=$s@function goto()@function xxx()@
|
||||
||tieba.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
|
||||
||ychap.com
|
||||
!-----------------------
|
||||
/qkostn.js|
|
||||
|http://mark.l.qq.com/fcgi-bin/get_video_mark_all*&strAdParam=
|
||||
!---------adbyby---------
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
;¸üйæÔòurl,dir,size,reverse,reverse
|
||||
http://update.adbyby.com/rule3/lazy.jpg \data\lazy.txt 385337 4 0
|
||||
http://update.adbyby.com/rule3/video.jpg \data\video.txt 1028 4 0
|
||||
http://update.adbyby.com/rule3/user.action \user.action 512 5 0
|
||||
http://update.adbyby.com/rule3/clean.ini \data\clean.ini 2167 0 0
|
||||
http://update.adbyby.com/rule3/adclear.ini \data\adclear.ini 4901 0 0
|
||||
https://github.com/gchangchen/suho/raw/master/adhook.dll \adhook.dll 117248 0 0 2.4.3.2
|
||||
https://github.com/gchangchen/suho/raw/master/adhook64.dll \adhook64.dll 142848 0 0 2.4.3.2
|
||||
https://github.com/gchangchen/suho/raw/master/adbyby.exe \adbyby.exe 1004183 1 0 2.4.4.0
|
||||
|
||||
Binary file not shown.
@ -1,102 +0,0 @@
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=aMule
|
||||
PKG_VERSION:=2.3.2
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/amule-project/amule.git
|
||||
PKG_SOURCE_DATE:=2021-01-30
|
||||
PKG_SOURCE_VERSION:=c3a1018329633234ac941055b64a43b9e2df7fad
|
||||
PKG_MIRROR_HASH:=f03b60e909346c4d984aeb9cf3a115b5b43fa6158ee01ed41b99e7217b436bb7
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
define Package/amule/config
|
||||
config AMULE_CRYPTOPP_STATIC_LINKING
|
||||
bool "Link libcryptopp statically"
|
||||
default n
|
||||
endef
|
||||
|
||||
TARGET_LDFLAGS+= -liconv
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--disable-static \
|
||||
--disable-rpath \
|
||||
--with-gnu-ld \
|
||||
--disable-ccache \
|
||||
--disable-optimize \
|
||||
--disable-profile \
|
||||
--disable-monolithic \
|
||||
--enable-amule-daemon \
|
||||
--enable-amulecmd \
|
||||
--enable-webserver \
|
||||
--disable-amule-gui \
|
||||
--disable-cas \
|
||||
--disable-wxcas \
|
||||
--disable-ed2k \
|
||||
--disable-alc \
|
||||
--disable-alcc \
|
||||
--disable-fileview \
|
||||
--disable-plasmamule \
|
||||
--without-wxdebug \
|
||||
--enable-dlp \
|
||||
--enable-upnp \
|
||||
--with-zlib="$(STAGING_DIR)/usr" \
|
||||
--with-gdlib-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-libpng-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-wx-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-crypto-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-libiconv-prefix="$(ICONV_PREFIX)" \
|
||||
--with-libintl-prefix="$(INTL_PREFIX)" \
|
||||
--with-libupnp-prefix="$(STAGING_DIR)/usr" \
|
||||
--without-x \
|
||||
--disable-debug
|
||||
|
||||
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/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/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,amule))
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,22 +0,0 @@
|
||||
--- a/m4/libupnp.m4
|
||||
+++ b/m4/libupnp.m4
|
||||
@@ -57,7 +57,6 @@ dnl Test for --with-libupnp-prefix
|
||||
])
|
||||
|
||||
dnl Check for libupnp >= MIN_LIBUPNP_VERSION
|
||||
- AS_IF([test $cross_compiling = no], [
|
||||
AC_MSG_CHECKING([for libupnp version >= MIN_LIBUPNP_VERSION])
|
||||
AS_IF([test -n "$PKG_CONFIG"], [
|
||||
AS_IF([$PKG_CONFIG libupnp --exists], [
|
||||
@@ -84,11 +83,6 @@ dnl Check for libupnp >= MIN_LIBUPNP_VER
|
||||
])
|
||||
AC_MSG_RESULT([$result$resultstr])
|
||||
libupnp_error="libupnp >= MIN_LIBUPNP_VERSION not found$resultstr"
|
||||
- ], [
|
||||
-dnl Currently cross-compilation with libupnp is not supported.
|
||||
- result=no
|
||||
- libupnp_error="cross compiling"
|
||||
- ])
|
||||
|
||||
dnl Execute the right action.
|
||||
AS_IF([test ${result:-no} = yes], [$2], [$3])
|
||||
@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=antileech
|
||||
PKG_VERSION:=2.3.2
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_DEPENDS:=libgd
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/antileech
|
||||
SUBMENU:=P2P
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=AntiLeech for amule
|
||||
URL:=http://www.amule.org/
|
||||
DEPENDS:=+libc +amule +libwxbase
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(SED) "s:^AC_CHECK_PROG.WXCONFIG,.*::g" $(PKG_BUILD_DIR)/configure.ac
|
||||
$(SED) "s:wx-config --cppflags:$(STAGING_DIR)/usr/bin/wx-config --cppflags:g" $(PKG_BUILD_DIR)/configure.ac
|
||||
|
||||
cd $(PKG_BUILD_DIR); $(SHELL) ./autogen.sh
|
||||
$(call Build/Configure/Default)
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += HOSTCC="$(HOSTCC)"
|
||||
|
||||
define Package/antileech/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/amule
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/share/amule/libantiLeech.so* $(1)/usr/share/amule/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,antileech))
|
||||
@ -1,63 +0,0 @@
|
||||
/**
|
||||
* Author: Bill Lee<bill.lee.y@gmail.com>
|
||||
* License: GNU GPL
|
||||
*/
|
||||
//---------------------
|
||||
#ifndef CSTRING_WX_H
|
||||
#define CSTRING_WX_H
|
||||
|
||||
//#include <wx/wx.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
class CString : public wxString{
|
||||
public:
|
||||
CString(){}
|
||||
CString(wxChar c, size_t n=1): wxString(c, n){}
|
||||
CString(const wxChar* str): wxString(str){}
|
||||
CString(const wxString& str): wxString(str){}
|
||||
CString(const CString& str): wxString(str){}
|
||||
//---------------------
|
||||
CString& operator=(const wxChar* str){
|
||||
wxString::operator=(str);
|
||||
return *this;
|
||||
}
|
||||
//operator*() from wxString;
|
||||
size_t GetLength()const{ return Length(); }
|
||||
wxChar GetAt(size_t nIndex)const{ return GetChar(nIndex); }
|
||||
//IsEmpty() from wxString;
|
||||
CString& TrimLeft(wxChar c){
|
||||
size_t pos = find_first_not_of(c);
|
||||
if(pos == 0)
|
||||
return *this;
|
||||
erase(0, pos);
|
||||
return *this;
|
||||
}
|
||||
CString& TrimRight(wxChar c){
|
||||
size_t pos = find_last_not_of(c) + 1;
|
||||
if(pos == Length())
|
||||
return *this;
|
||||
erase(pos, Length() - pos);
|
||||
return *this;
|
||||
}
|
||||
CString Trim(){
|
||||
CString ret(*this);
|
||||
ret.wxString::Trim(false); /* wxString::Trim(bool fromright = true) */
|
||||
ret.wxString::Trim(true);
|
||||
return ret;
|
||||
}
|
||||
//Find(wxChar) and Find(wxChar*) from wxString;
|
||||
int Find(const CString& str)const{ return wxString::Find(str.c_str()); }
|
||||
int ReverseFind(const wxChar c)const{ return wxString::Find(c, true); }
|
||||
int ReverseFind(const wxChar* str)const{ return rfind(str); }
|
||||
int ReverseFind(const CString& str)const{ return rfind(str); }
|
||||
CString Right(size_t len)const{ return wxString::Right(len); }
|
||||
CString Left(size_t len)const{ return wxString::Left(len); }
|
||||
#if wxCHECK_VERSION(2, 9, 0)
|
||||
CString Mid(size_t first, size_t count = wxString::npos)const{
|
||||
#else
|
||||
CString Mid(size_t first, size_t count = wxSTRING_MAXLEN)const{
|
||||
#endif
|
||||
return wxString::Mid(first, count);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: Interface.cpp
|
||||
*
|
||||
* Description: A part of aMule DLP
|
||||
*
|
||||
* Created: 2011-02-24 19:49
|
||||
*
|
||||
* Author: Bill Lee , bill.lee.y@gmail.com
|
||||
*
|
||||
* Copyright (c) 2011, Bill Lee
|
||||
* License: GNU General Public License
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
|
||||
/* ##### HEADER FILE INCLUDES ################################################### */
|
||||
#include "antiLeech.h"
|
||||
|
||||
/* ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################ */
|
||||
extern "C" IantiLeech* createAntiLeechInstant(){
|
||||
return new CantiLeech;
|
||||
}
|
||||
extern "C" int destoryAntiLeechInstant(IantiLeech* ptr){
|
||||
delete ptr;
|
||||
return 0;
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
pkgdir = $(datadir)/amule
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
pkg_LTLIBRARIES = libantiLeech.la
|
||||
libantiLeech_la_CPPFLAGS = ${ANTILEECH_CPPFLAGS}
|
||||
libantiLeech_la_LDFLAGS = ${ANTILEECH_LDFLAGS} -module -avoid-version --no-la-files
|
||||
libantiLeech_la_SOURCES = \
|
||||
antiLeech.h \
|
||||
antiLeech_wx.h \
|
||||
CString_wx.h \
|
||||
antiLeech.cpp \
|
||||
antiLeech_wx.cpp \
|
||||
Interface.cpp
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,161 +0,0 @@
|
||||
#ifndef ANTILEECH_H
|
||||
#define ANTILEECH_H
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "antiLeech_wx.h"
|
||||
#include "CString_wx.h"
|
||||
|
||||
class IantiLeech
|
||||
{
|
||||
public:
|
||||
virtual ~IantiLeech(){}; /* Bill Lee: Not be used currently */
|
||||
//BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD,LPVOID);
|
||||
virtual DWORD GetDLPVersion() = 0;
|
||||
//old versions to keep compatible
|
||||
/* //drop old version support
|
||||
virtual LPCTSTR DLPCheckModstring(LPCTSTR modversion, LPCTSTR clientversion);
|
||||
virtual LPCTSTR DLPCheckUsername(LPCTSTR username);
|
||||
virtual LPCTSTR DLPCheckNameAndHash(CString username, CString& userhash);
|
||||
*/
|
||||
//new versions
|
||||
virtual LPCTSTR DLPCheckModstring_Hard(LPCTSTR modversion, LPCTSTR clientversion) = 0;
|
||||
virtual LPCTSTR DLPCheckModstring_Soft(LPCTSTR modversion, LPCTSTR clientversion) = 0;
|
||||
virtual LPCTSTR DLPCheckUsername_Hard(LPCTSTR username) = 0;
|
||||
virtual LPCTSTR DLPCheckUsername_Soft(LPCTSTR username) = 0;
|
||||
virtual LPCTSTR DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion) = 0;
|
||||
virtual LPCTSTR DLPCheckMessageSpam(LPCTSTR messagetext) = 0;
|
||||
|
||||
|
||||
virtual LPCTSTR DLPCheckUserhash(const PBYTE userhash) = 0;
|
||||
|
||||
|
||||
virtual LPCTSTR DLPCheckHelloTag(UINT tagnumber) = 0;
|
||||
virtual LPCTSTR DLPCheckInfoTag(UINT tagnumber) = 0;
|
||||
|
||||
//void TestFunc();
|
||||
|
||||
//Bill Lee: no need in interface abstract class
|
||||
//private:
|
||||
// static bool IsTypicalHex (const CString& addon);
|
||||
};
|
||||
|
||||
//Bill Lee: never call delete on IantiLeech, use destoryAntiLeechInstat instead.
|
||||
extern "C" IantiLeech* createAntiLeechInstant();
|
||||
extern "C" int destoryAntiLeechInstant(IantiLeech*);
|
||||
|
||||
class CantiLeech: public IantiLeech
|
||||
{
|
||||
public:
|
||||
//BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD,LPVOID);
|
||||
virtual DWORD GetDLPVersion(){ return DLPVersion; }
|
||||
//old versions to keep compatible
|
||||
/* //drop old version support
|
||||
virtual LPCTSTR DLPCheckModstring(LPCTSTR modversion, LPCTSTR clientversion);
|
||||
virtual LPCTSTR DLPCheckUsername(LPCTSTR username);
|
||||
virtual LPCTSTR DLPCheckNameAndHash(CString username, CString& userhash);
|
||||
*/
|
||||
//new versions
|
||||
virtual LPCTSTR DLPCheckModstring_Hard(LPCTSTR modversion, LPCTSTR clientversion);
|
||||
virtual LPCTSTR DLPCheckModstring_Soft(LPCTSTR modversion, LPCTSTR clientversion);
|
||||
virtual LPCTSTR DLPCheckUsername_Hard(LPCTSTR username);
|
||||
virtual LPCTSTR DLPCheckUsername_Soft(LPCTSTR username);
|
||||
virtual LPCTSTR DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion);
|
||||
virtual LPCTSTR DLPCheckMessageSpam(LPCTSTR messagetext);
|
||||
|
||||
|
||||
virtual LPCTSTR DLPCheckUserhash(const PBYTE userhash);
|
||||
|
||||
|
||||
virtual LPCTSTR DLPCheckHelloTag(UINT tagnumber);
|
||||
virtual LPCTSTR DLPCheckInfoTag(UINT tagnumber);
|
||||
|
||||
//void TestFunc();
|
||||
|
||||
private:
|
||||
static const DWORD DLPVersion;
|
||||
static bool IsTypicalHex (const CString& addon);
|
||||
};
|
||||
|
||||
//<<< new tags from eMule 0.04x
|
||||
#define CT_UNKNOWNx0 0x00 // Hybrid Horde protocol
|
||||
#define CT_UNKNOWNx12 0x12 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx13 0x13 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx14 0x14 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx15 0x15 // http://www.haspepapa-welt.de (DodgeBoards) & DarkMule |eVorte|X|
|
||||
#define CT_UNKNOWNx16 0x16 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx17 0x17 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx4D 0x4D // pimp my mule (00de)
|
||||
#define CT_UNKNOWNxE6 0xE6 // http://www.haspepapa-welt.de
|
||||
#define CT_UNKNOWNx22 0x22 // DarkMule |eVorte|X|
|
||||
#define CT_UNKNOWNx5D 0x5D // md4
|
||||
#define CT_UNKNOWNx63 0x63 // ?
|
||||
#define CT_UNKNOWNx64 0x64 // ?
|
||||
#define CT_UNKNOWNx69 0x69 // eMuleReactor //Xman don't use this, it's webcache!
|
||||
#define CT_UNKNOWNx6B 0x6B // md4
|
||||
#define CT_UNKNOWNx6C 0x6C // md4
|
||||
#define CT_UNKNOWNx74 0x74 // md4
|
||||
#define CT_UNKNOWNx76 0x76 // www.donkey2002.to
|
||||
#define CT_UNKNOWNx79 0x79 // Bionic
|
||||
#define CT_UNKNOWNx7A 0x7A // NewDarkMule
|
||||
#define CT_UNKNOWNx83 0x83 // Fusspi
|
||||
#define CT_UNKNOWNx87 0x87 // md4
|
||||
#define CT_UNKNOWNx88 0x88 // DarkMule v6 |eVorte|X|
|
||||
#define CT_UNKNOWNx8c 0x8c // eMule v0.27c [LSD7c]
|
||||
#define CT_UNKNOWNx8d 0x8d // unknown Leecher - (client version:60)
|
||||
#define CT_UNKNOWNx94 0x94 // 00.de community //Xman 20.08.05
|
||||
#define CT_UNKNOWNx97 0x97 // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNx98 0x98 // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNx99 0x99 // eMule v0.26d [RAMMSTEIN 8b]
|
||||
#define CT_UNKNOWNx9C 0x9C // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNxbb 0xbb // emule.de (client version:60)
|
||||
#define CT_UNKNOWNxc4 0xc4 //MD5 Community from new bionic - hello
|
||||
#define CT_UNKNOWNxC8 0xc8 // MD5 Community from new bionic - hello //Xman x4
|
||||
#define CT_UNKNOWNxCA 0xCA // NewDarkMule
|
||||
#define CT_UNKNOWNxCD 0xCD // www.donkey2002.to
|
||||
#define CT_UNKNOWNxCE 0xCE // FRZ community //Xman 20.08.05
|
||||
#define CT_UNKNOWNxCF 0xCF // FRZ community //Xman 20.08.05
|
||||
#define CT_UNKNOWNxDA 0xDA // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNxEC 0xec // SpeedMule and clones //Xman x4
|
||||
#define CT_UNKNOWNxF0 0xF0 // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNxF4 0xF4 // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNxD2 0xD2 // Chinese Leecher //SquallATF
|
||||
//#define CT_UNKNOWNx85 0x85 // viper-israel.org and eChanblardNext //zz_fly, viper become good
|
||||
|
||||
#define CT_FRIENDSHARING 0x66 //eWombat [SNAFU]
|
||||
#define CT_DARK 0x54 //eWombat [SNAFU]
|
||||
#define FRIENDSHARING_ID 0x5F73F1A0 // Magic Key, DO NOT CHANGE!
|
||||
|
||||
// unknown eMule tags
|
||||
#define ET_MOD_UNKNOWNx12 0x12 // http://www.haspepapa-welt.de
|
||||
#define ET_MOD_UNKNOWNx13 0x13 // http://www.haspepapa-welt.de
|
||||
#define ET_MOD_UNKNOWNx14 0x14 // http://www.haspepapa-welt.de
|
||||
#define ET_MOD_UNKNOWNx17 0x17 // http://www.haspepapa-welt.de
|
||||
#define ET_MOD_UNKNOWNx2F 0x2F // eMule v0.30 [OMEGA v.07 Heiko]
|
||||
#define ET_MOD_UNKNOWNx30 0x30 // aMule 1.2.0
|
||||
#define ET_MOD_UNKNOWNx36 0x36 // eMule v0.26
|
||||
#define ET_MOD_UNKNOWNx3C 0x3C // enkeyDev.6 / LamerzChoice 9.9a
|
||||
#define ET_MOD_UNKNOWNx41 0x41 // CrewMod (pre-release mod based on Plus) identification
|
||||
#define ET_MOD_UNKNOWNx42 0x42 // CrewMod (pre-release mod based on Plus) key verification
|
||||
#define ET_MOD_UNKNOWNx43 0x43 // CrewMod (pre-release mod based on Plus) version info
|
||||
#define ET_MOD_UNKNOWNx50 0x50 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNx59 0x59 // emule 0.40 / eMule v0.30 [LSD.12e]
|
||||
#define ET_MOD_UNKNOWNx5B 0x5B // eMule v0.26
|
||||
#define ET_MOD_UNKNOWNx60 0x60 // eMule v0.30a Hunter.6 + eMule v0.26
|
||||
#define ET_MOD_UNKNOWNx64 0x64 // LSD.9dT / Athlazan(0.29c)Alpha.3
|
||||
#define ET_MOD_UNKNOWNx76 0x76 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define ET_MOD_UNKNOWNx84 0x84 // eChanblardv3.2
|
||||
#define ET_MOD_UNKNOWNx85 0x85 // ?
|
||||
#define ET_MOD_UNKNOWNx86 0x86 // ?
|
||||
#define ET_MOD_UNKNOWNx93 0x93 // ?
|
||||
#define ET_MOD_UNKNOWNxA6 0xA6 // eMule v0.26
|
||||
#define ET_MOD_UNKNOWNxB1 0xB1 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNxB4 0xB4 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNxC8 0xC8 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNxC9 0xC9 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNxDA 0xDA // Rumata (rus)(Plus v1f) - leecher mod?
|
||||
//>>> eWombat [SNAFU_V3]
|
||||
|
||||
#undef __declspec
|
||||
#endif
|
||||
@ -1,25 +0,0 @@
|
||||
//Author: greensea <gs@bbxy.net>
|
||||
#include "antiLeech_wx.h" //Modified by Bill Lee.
|
||||
|
||||
//Bug fixed by Orzogc Lee
|
||||
LPCTSTR StrStrI(LPCTSTR haystack, LPCTSTR needle){
|
||||
//Bill Lee: allocate wchar array on the stack
|
||||
wchar_t haystacki[512];
|
||||
wchar_t needlei[512];
|
||||
int i = 0;
|
||||
do{
|
||||
haystacki[i] = towlower(haystack[i]);
|
||||
if(i == 511)
|
||||
break;
|
||||
}while(haystack[i++]); //As haystacki is allocated on the stack, it wans't set 0. So the NULL needs to be copy.
|
||||
i = 0;
|
||||
do{
|
||||
needlei[i] = towlower(needle[i]);
|
||||
if(i == 511)
|
||||
break;
|
||||
}while(needle[i++]);
|
||||
const wchar_t* ret = wcsstr(haystacki, needlei);
|
||||
if(ret != NULL)
|
||||
ret = ret - haystacki + haystack;
|
||||
return ret;
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
#ifndef ANTILEECH_WX_H
|
||||
#define ANTILEECH_WX_H
|
||||
|
||||
#include <wx/defs.h>
|
||||
#include <string.h>
|
||||
#include <wctype.h> // for towlower()
|
||||
|
||||
#define LPCTSTR const wxChar*
|
||||
#define BOOL bool
|
||||
//#define _T(var) wxT(var) //defined in wxWidgets
|
||||
#define DWORD wxUint32
|
||||
#define UINT wxUint16
|
||||
#define WINAPI
|
||||
#define HINSTANCE
|
||||
#define LPVOID void*
|
||||
#define PBYTE unsigned char*
|
||||
#define TCHAR wxChar
|
||||
#define _TINT wxInt32
|
||||
#define SSIZE_T ptrdiff_t
|
||||
|
||||
#define StrCmpI _tcsicmp
|
||||
#define _tcsicmp _wcsicmp
|
||||
|
||||
#define _istdigit(var) iswdigit(var)
|
||||
#define _istcntrl(var) iswcntrl(var)
|
||||
#define _istpunct(var) iswpunct(var)
|
||||
#define _istspace(var) iswspace(var)
|
||||
#define _istxdigit(var) iswxdigit(var)
|
||||
inline float _tstof(const wchar_t* str){
|
||||
wchar_t** ptail = NULL;
|
||||
return wcstof(str, ptail);
|
||||
}
|
||||
//This function is not used. by Orzogc Lee
|
||||
//But I think there is no need to removing, linker will remove it.
|
||||
/*
|
||||
inline void tolowers(wxChar* str){
|
||||
int i = 0;
|
||||
do{
|
||||
str[i] = towlower(str[i]);
|
||||
}while(str[++i]);
|
||||
}
|
||||
*/
|
||||
#define _tcsstr(haystack, needle) wcsstr(haystack, needle)
|
||||
#define _tcslen(var) wcslen(var)
|
||||
#define StrStr(a, b) wcsstr(a, b)
|
||||
#define StrStrIW(a, b) StrStrI(a, b)
|
||||
|
||||
LPCTSTR StrStrI(LPCTSTR haystack, LPCTSTR needle);
|
||||
//Bill Lee: I think inlining this function make no senses, because it is a very large operation.
|
||||
|
||||
#define _wcsicmp(a, b) wcscasecmp(a, b)
|
||||
#define StrCmpIW(a, b) wcscasecmp(a, b)
|
||||
|
||||
#endif
|
||||
@ -1,8 +0,0 @@
|
||||
mkdir -pv m4
|
||||
libtoolize
|
||||
aclocal
|
||||
aclocal -I m4
|
||||
automake --add-missing --copy
|
||||
autoconf
|
||||
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
# Copyright (C) 2011 Bill Lee <bill.lee.y@gmail.com>
|
||||
# License: GNU GPL v3 or any later version released by Free Software Foundation
|
||||
|
||||
#AC_PREREQ([2.65])
|
||||
AC_INIT([antiLeech], [44], [https://github.com/persmule/amule-dlp/issues])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_INIT_AUTOMAKE()
|
||||
AC_CONFIG_SRCDIR([antiLeech.cpp])
|
||||
#AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_MAKE_SET
|
||||
AM_DISABLE_STATIC
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
#Check for wx-config
|
||||
|
||||
AC_CHECK_PROG(WXCONFIG, [wx-config], [wx-config])
|
||||
ANTILEECH_CPPFLAGS=$(wx-config --cppflags)
|
||||
|
||||
AC_SUBST(ANTILEECH_CPPFLAGS)
|
||||
|
||||
# Checks for libraries.
|
||||
ANTILEECH_LDFLAGS=
|
||||
|
||||
AC_SUBST(ANTILEECH_LDFLAGS)
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS([string.h], [wx/string.h], [wx/defs.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_STDBOOL
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
# Checks for library functions.
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
@ -1,61 +0,0 @@
|
||||
--- antiLeech.cpp.win 2016-02-15 19:31:18.748711749 +0800
|
||||
+++ antiLeech.cpp 2016-02-15 20:49:25.691484626 +0800
|
||||
@@ -17,8 +17,11 @@
|
||||
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
-#include <atlstr.h>
|
||||
+#include "CString_wx.h"
|
||||
#include "antiLeech.h"
|
||||
+#define __declspec(var) CantiLeech::
|
||||
+#define SPECIAL_DLP_VERSION
|
||||
+#define ALL_VERYCD_MOD
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
@@ -51,7 +54,10 @@ LPCTSTR apszSnafuTag[]=
|
||||
//,_T("[eChanblardNext]") //21 zz_fly
|
||||
};
|
||||
|
||||
+const DWORD CantiLeech::DLPVersion = 4405;
|
||||
|
||||
+//deactivate M$WIN-specific codes
|
||||
+#if 0
|
||||
BOOL WINAPI DllMain (
|
||||
HANDLE hModule,
|
||||
DWORD dwFunction,
|
||||
@@ -74,6 +80,7 @@ void __declspec(dllexport) TestFunc()
|
||||
{
|
||||
::MessageBox(NULL,_T("Inside the DLL!"),_T("Nix"),0);
|
||||
}
|
||||
+#endif
|
||||
|
||||
//old versions just to keep compatible
|
||||
/* //drop old version support
|
||||
@@ -285,7 +292,7 @@ LPCTSTR __declspec(dllexport) DLPCheckNa
|
||||
*/
|
||||
//end old version ------------------------------------------
|
||||
|
||||
-bool IsTypicalHex(CString& addon)
|
||||
+bool CantiLeech::IsTypicalHex(const CString& addon)
|
||||
{
|
||||
if(addon.GetLength()>25 || addon.GetLength()<5)
|
||||
return false;
|
||||
@@ -1244,7 +1251,7 @@ LPCTSTR __declspec(dllexport) DLPCheckUs
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-LPCTSTR __declspec(dllexport) DLPCheckNameAndHashAndMod(CString username, CString& userhash, CString& modversion)
|
||||
+LPCTSTR __declspec(dllexport) DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion)
|
||||
{
|
||||
if(username.IsEmpty() || userhash.IsEmpty())
|
||||
return NULL;
|
||||
@@ -1309,7 +1316,7 @@ LPCTSTR __declspec(dllexport) DLPCheckNa
|
||||
|
||||
//Check for aedit
|
||||
//remark: a unmodded emule can't send a space at last sign
|
||||
- if(modversion.IsEmpty() && username.Right(1)==32)
|
||||
+ if(modversion.IsEmpty() && username.Right(1)==_T(" "))
|
||||
return _T("AEdit");
|
||||
|
||||
//Check for Hex-Modstring
|
||||
@ -1,46 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddns-scripts_aliyun
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_MAINTAINER:=Sense <sensec@gmail.com>
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=IP Addresses and Names
|
||||
TITLE:=DDNS extension for AliYun.com
|
||||
PKGARCH:=all
|
||||
DEPENDS:=ddns-scripts +wget-ssl +openssl-util
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Dynamic DNS Client scripts extension for AliYun.com
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ddns $(1)/usr/share/ddns/default
|
||||
$(INSTALL_BIN) $(CURDIR)/files/update_aliyun_com.sh $(1)/usr/lib/ddns
|
||||
$(INSTALL_DATA) $(CURDIR)/files/aliyun.com.json $(1)/usr/share/ddns/default
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
# if NOT run buildroot then stop service
|
||||
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
|
||||
exit 0 # suppress errors
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "aliyun.com",
|
||||
"ipv4": {
|
||||
"url": "update_aliyun_com.sh"
|
||||
},
|
||||
"ipv6": {
|
||||
"url": "update_aliyun_com.sh"
|
||||
}
|
||||
}
|
||||
@ -1,247 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 用于阿里云解析的DNS更新脚本
|
||||
# 2017-2018 Sense <sensec at gmail dot com>
|
||||
# 阿里云解析API文档 https://help.aliyun.com/document_detail/29739.html
|
||||
#
|
||||
# 本脚本由 dynamic_dns_functions.sh 内的函数 send_update() 调用
|
||||
#
|
||||
# 需要在 /etc/config/ddns 中设置的选项
|
||||
# option username - 阿里云API访问账号 Access Key ID。可通过 aliyun.com 帐号管理的 accesskeys 获取, 或者访问 https://ak-console.aliyun.com
|
||||
# option password - 阿里云API访问密钥 Access Key Secret
|
||||
# option domain - 完整的域名。建议主机与域名之间使用 @符号 分隔,否则将以第一个 .符号 之前的内容作为主机名
|
||||
#
|
||||
|
||||
# 检查传入参数
|
||||
[ -z "$username" ] && write_log 14 "配置错误!保存阿里云API访问账号的'用户名'不能为空"
|
||||
[ -z "$password" ] && write_log 14 "配置错误!保存阿里云API访问密钥的'密码'不能为空"
|
||||
|
||||
# 检查外部调用工具
|
||||
[ -n "$WGET_SSL" ] || write_log 13 "使用阿里云API需要 GNU Wget 支持,请先安装"
|
||||
command -v sed >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 sed 支持,请先安装"
|
||||
command -v openssl >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 openssl-util 支持,请先安装"
|
||||
|
||||
# 包含用于解析 JSON 格式返回值的函数
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
# 变量声明
|
||||
local __HOST __DOMAIN __TYPE __URLBASE __CMDBASE __URLARGS __SEPARATOR __RECID
|
||||
[ $use_https -eq 0 ] && __URLBASE="http://alidns.aliyuncs.com/" || __URLBASE="https://alidns.aliyuncs.com/"
|
||||
__SEPARATOR="&"
|
||||
|
||||
# 从 $domain 分离主机和域名
|
||||
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
|
||||
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
|
||||
__HOST="${domain%%@*}"
|
||||
__DOMAIN="${domain#*@}"
|
||||
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
|
||||
|
||||
# 设置记录类型
|
||||
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
|
||||
|
||||
# 构造基本通信命令
|
||||
build_command() {
|
||||
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
|
||||
# 绑定用于通信的主机/IP
|
||||
if [ -n "$bind_network" ]; then
|
||||
local bind_ip run_prog
|
||||
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
|
||||
eval "$run_prog bind_ip $bind_network" || \
|
||||
write_log 13 "无法使用 '$run_prog $bind_network' 获取本地IP地址 - 错误代码: '$?'"
|
||||
write_log 7 "强制使用IP '$bind_ip' 通信"
|
||||
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
|
||||
fi
|
||||
# 强制设定IP版本
|
||||
if [ $force_ipversion -eq 1 ]; then
|
||||
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
|
||||
fi
|
||||
# 设置CA证书参数
|
||||
if [ $use_https -eq 1 ]; then
|
||||
if [ "$cacert" = "IGNORE" ]; then
|
||||
__CMDBASE="$__CMDBASE --no-check-certificate"
|
||||
elif [ -f "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
|
||||
elif [ -d "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
|
||||
elif [ -n "$cacert" ]; then
|
||||
write_log 14 "在 '$cacert' 中未找到用于 HTTPS 通信的有效证书"
|
||||
fi
|
||||
fi
|
||||
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
|
||||
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
|
||||
}
|
||||
|
||||
# 用于阿里云API的通信函数
|
||||
aliyun_transfer() {
|
||||
local __PARAM=$*
|
||||
local __CNT=0
|
||||
local __RUNPROG __ERR PID_SLEEP
|
||||
|
||||
[ $# -eq 0 ] && write_log 12 "'aliyun_transfer()' 出错 - 参数数量错误"
|
||||
|
||||
while : ; do
|
||||
build_Request $__PARAM
|
||||
__RUNPROG="$__CMDBASE '${__URLBASE}?${__URLARGS}'"
|
||||
|
||||
write_log 7 "#> $__RUNPROG"
|
||||
eval $__RUNPROG
|
||||
__ERR=$?
|
||||
[ $__ERR -eq 0 ] && return 0
|
||||
|
||||
write_log 3 "wget 错误代码: '$__ERR'"
|
||||
write_log 7 "$(cat $ERRFILE)"
|
||||
|
||||
if [ $VERBOSE -gt 1 ]; then
|
||||
write_log 4 "传输失败 - 详细模式: $VERBOSE - 出错后不再重试"
|
||||
return 1
|
||||
fi
|
||||
|
||||
__CNT=$(( $__CNT + 1 ))
|
||||
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
|
||||
write_log 14 "$retry_count 次重试后传输还是失败"
|
||||
|
||||
write_log 4 "传输失败 - $__CNT/$retry_count 在 $RETRY_SECONDS 秒后重试"
|
||||
sleep $RETRY_SECONDS &
|
||||
PID_SLEEP=$!
|
||||
wait $PID_SLEEP
|
||||
PID_SLEEP=0
|
||||
done
|
||||
}
|
||||
|
||||
# 百分号编码
|
||||
percentEncode() {
|
||||
if [ -z "${1//[A-Za-z0-9_.~-]/}" ]; then
|
||||
echo -n "$1"
|
||||
else
|
||||
local string=$1; local i=0; local ret chr
|
||||
while [ $i -lt ${#string} ]; do
|
||||
chr=${string:$i:1}
|
||||
[ -z "${chr#[^A-Za-z0-9_.~-]}" ] && chr=$(printf '%%%02X' "'$chr")
|
||||
ret="$ret$chr"
|
||||
i=$(( $i + 1 ))
|
||||
done
|
||||
echo -n "$ret"
|
||||
fi
|
||||
}
|
||||
|
||||
# 构造阿里云解析请求参数
|
||||
build_Request() {
|
||||
local args=$*; local string
|
||||
local HTTP_METHOD="GET"
|
||||
|
||||
# 添加请求参数
|
||||
__URLARGS=
|
||||
for string in $args; do
|
||||
case "${string%%=*}" in
|
||||
Format|TTL|Version|AccessKeyId|SignatureMethod|Timestamp|SignatureVersion|SignatureNonce|Signature) ;; # 过滤公共参数
|
||||
*) __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}");;
|
||||
esac
|
||||
done
|
||||
__URLARGS="${__URLARGS:1}"
|
||||
|
||||
# 附加公共参数
|
||||
string="Format=JSON"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="TTL=600";__URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="Version=2015-01-09"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="AccessKeyId=$username"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="SignatureMethod=HMAC-SHA1"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="Timestamp="$(date -u '+%Y-%m-%dT%H:%M:%SZ'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="SignatureVersion=1.0"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="SignatureNonce="$(cat '/proc/sys/kernel/random/uuid'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
|
||||
# 对请求参数进行排序,用于生成签名
|
||||
string=$(echo -n "$__URLARGS" | sed 's/\'"${__SEPARATOR}"'/\n/g' | sort | sed ':label; N; s/\n/\'"${__SEPARATOR}"'/g; b label')
|
||||
# 构造用于计算签名的字符串
|
||||
string="${HTTP_METHOD}${__SEPARATOR}"$(percentEncode "/")"${__SEPARATOR}"$(percentEncode "$string")
|
||||
# 字符串计算签名HMAC值
|
||||
local signature=$(echo -n "$string" | openssl dgst -sha1 -hmac "${password}&" -binary)
|
||||
# HMAC值编码成字符串,得到签名值
|
||||
signature=$(echo -n "$signature" | openssl base64)
|
||||
|
||||
# 附加签名参数
|
||||
string="Signature=$signature"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
}
|
||||
|
||||
# 添加解析记录
|
||||
add_domain() {
|
||||
local value
|
||||
aliyun_transfer "Action=AddDomainRecord" "DomainName=${__DOMAIN}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败"
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var value "RecordId"
|
||||
[ -z "$value" ] && write_log 14 "添加新解析记录失败"
|
||||
write_log 7 "添加新解析记录成功"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 修改解析记录
|
||||
update_domain() {
|
||||
local value
|
||||
aliyun_transfer "Action=UpdateDomainRecord" "RecordId=${__RECID}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败"
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var value "RecordId"
|
||||
[ -z "$value" ] && write_log 14 "修改解析记录失败"
|
||||
write_log 7 "修改解析记录成功"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 启用解析记录
|
||||
enable_domain() {
|
||||
local value
|
||||
aliyun_transfer "Action=SetDomainRecordStatus" "RecordId=${__RECID}" "Status=Enable" || write_log 14 "服务器通信失败"
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var value "Status"
|
||||
[ "$value" != "Enable" ] && write_log 14 "启用解析记录失败"
|
||||
write_log 7 "启用解析记录成功"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 获取子域名解析记录列表
|
||||
describe_domain() {
|
||||
local count value; local ret=0
|
||||
aliyun_transfer "Action=DescribeSubDomainRecords" "SubDomain=${__HOST}.${__DOMAIN}" || write_log 14 "服务器通信失败"
|
||||
write_log 7 "获取到解析记录: $(cat "$DATFILE" 2> /dev/null)"
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var count "TotalCount"
|
||||
if [ $count -eq 0 ]; then
|
||||
write_log 7 "解析记录不存在"
|
||||
ret=1
|
||||
else
|
||||
local i=1;
|
||||
while [ $i -le $count ]; do
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_select "DomainRecords" >/dev/null 2>&1
|
||||
json_select "Record" >/dev/null 2>&1
|
||||
json_select $i >/dev/null 2>&1
|
||||
i=$(( $i + 1 ))
|
||||
json_get_var value "Type"
|
||||
if [ "$value" != "${__TYPE}" ]; then
|
||||
write_log 7 "当前解析类型: ${__TYPE}, 获得不匹配类型: $value"
|
||||
ret=1; continue
|
||||
else
|
||||
ret=0
|
||||
json_get_var __RECID "RecordId"
|
||||
write_log 7 "获得解析记录ID: ${__RECID}, 类型: $value"
|
||||
json_get_var value "Locked"
|
||||
[ $value -ne 0 ] && write_log 14 "解析记录被锁定"
|
||||
json_get_var value "Status"
|
||||
[ "$value" != "ENABLE" ] && ret=$(( $ret | 2 )) && write_log 7 "解析记录被禁用"
|
||||
json_get_var value "Value"
|
||||
[ "$value" != "${__IP}" ] && ret=$(( $ret | 4 )) && write_log 7 "地址需要修改"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
return $ret
|
||||
}
|
||||
|
||||
build_command
|
||||
describe_domain
|
||||
ret=$?
|
||||
if [ $ret -eq 1 ]; then
|
||||
sleep 3 && add_domain
|
||||
else
|
||||
[ $(( $ret & 2 )) -ne 0 ] && sleep 3 && enable_domain
|
||||
[ $(( $ret & 4 )) -ne 0 ] && sleep 3 && update_domain
|
||||
fi
|
||||
|
||||
return 0
|
||||
@ -1,46 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddns-scripts_dnspod
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_MAINTAINER:=Small_5
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=IP Addresses and Names
|
||||
TITLE:=DDNS extension for Dnspod.com/Dnspod.cn
|
||||
PKGARCH:=all
|
||||
DEPENDS:=ddns-scripts +wget-ssl +ca-certificates
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Dynamic DNS Client scripts extension for Dnspod.com/Dnspod.cn
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ddns $(1)/usr/share/ddns/default
|
||||
$(INSTALL_BIN) $(CURDIR)/files/*.sh $(1)/usr/lib/ddns
|
||||
$(INSTALL_DATA) $(CURDIR)/files/*.json $(1)/usr/share/ddns/default
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
# if NOT run buildroot then stop service
|
||||
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
|
||||
exit 0 # suppress errors
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "dnspod.cn",
|
||||
"ipv4": {
|
||||
"url": "update_dnspod_cn.sh"
|
||||
},
|
||||
"ipv6": {
|
||||
"url": "update_dnspod_cn.sh"
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "dnspod.com",
|
||||
"ipv4": {
|
||||
"url": "update_dnspod_com.sh"
|
||||
},
|
||||
"ipv6": {
|
||||
"url": "update_dnspod_com.sh"
|
||||
}
|
||||
}
|
||||
@ -1,154 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#检查传入参数
|
||||
[ -z "$username" ] && write_log 14 "Configuration error! [User name] cannot be empty"
|
||||
[ -z "$password" ] && write_log 14 "Configuration error! [Password] cannot be empty"
|
||||
|
||||
#检查外部调用工具
|
||||
[ -n "$WGET_SSL" ] || write_log 13 "GNU Wget support is required to use dnspod API. Please install first"
|
||||
|
||||
# 变量声明
|
||||
local __URLBASE __HOST __DOMAIN __TYPE __CMDBASE __POST __POST1 __RECIP __RECID __value __TTL
|
||||
__URLBASE="https://dnsapi.cn/"
|
||||
|
||||
# 从 $domain 分离主机和域名
|
||||
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
|
||||
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
|
||||
__HOST="${domain%%@*}"
|
||||
__DOMAIN="${domain#*@}"
|
||||
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
|
||||
|
||||
# 设置记录类型
|
||||
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
|
||||
|
||||
# 构造基本通信命令
|
||||
build_command() {
|
||||
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
|
||||
# 绑定用于通信的主机/IP
|
||||
if [ -n "$bind_network" ]; then
|
||||
local bind_ip run_prog
|
||||
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
|
||||
eval "$run_prog bind_ip $bind_network" || \
|
||||
write_log 13 "Unable to get local IP address with '$run_prog $ bind_network' - error code: '$?'"
|
||||
write_log 7 "Forced use of IP '$bind_ip' communication"
|
||||
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
|
||||
fi
|
||||
# 强制设定IP版本
|
||||
if [ $force_ipversion -eq 1 ]; then
|
||||
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
|
||||
fi
|
||||
# 设置CA证书参数
|
||||
if [ $use_https -eq 1 ]; then
|
||||
if [ "$cacert" = "IGNORE" ]; then
|
||||
__CMDBASE="$__CMDBASE --no-check-certificate"
|
||||
elif [ -f "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
|
||||
elif [ -d "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
|
||||
elif [ -n "$cacert" ]; then
|
||||
write_log 14 "A valid certificate for HTTPS communication was not found in '$cacert'"
|
||||
fi
|
||||
fi
|
||||
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
|
||||
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
|
||||
__CMDBASE="$__CMDBASE --post-data"
|
||||
}
|
||||
|
||||
# 用于Dnspod API的通信函数
|
||||
dnspod_transfer() {
|
||||
local __A=$1
|
||||
local __CNT=0
|
||||
local __ERR=0
|
||||
local __B PID_SLEEP
|
||||
case "$__A" in
|
||||
0)
|
||||
__B="$__CMDBASE '$__POST' ${__URLBASE}Record.List"
|
||||
;;
|
||||
1)
|
||||
__B="$__CMDBASE '$__POST1' ${__URLBASE}Record.Create"
|
||||
;;
|
||||
2)
|
||||
__B="$__CMDBASE '$__POST1&record_id=$__RECID&ttl=$__TTL' ${__URLBASE}Record.Modify"
|
||||
;;
|
||||
esac
|
||||
|
||||
while : ; do
|
||||
write_log 7 "#> $__B"
|
||||
eval $__B
|
||||
__ERR=`jsonfilter -i $DATFILE -e "@.status.code"`
|
||||
|
||||
[ $__ERR -eq 1 ] && return 0
|
||||
[ $__A -eq 0 ] && [ $__ERR -eq 10 ] && return 0
|
||||
write_log 3 "Error message:[$(jsonfilter -i $DATFILE -e "@.status.message")]"
|
||||
|
||||
if [ $VERBOSE -gt 1 ]; then
|
||||
write_log 4 "Transfer failed - detailed mode: $VERBOSE - Do not try again after an error"
|
||||
return 1
|
||||
fi
|
||||
|
||||
__CNT=$(( $__CNT + 1 ))
|
||||
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && write_log 14 "Transfer failed after $retry_count retries"
|
||||
|
||||
write_log 4 "Transfer failed - $__CNT Try again in $RETRY_SECONDS seconds"
|
||||
sleep $RETRY_SECONDS &
|
||||
PID_SLEEP=$!
|
||||
wait $PID_SLEEP
|
||||
PID_SLEEP=0
|
||||
done
|
||||
}
|
||||
|
||||
#添加解析记录
|
||||
add_domain() {
|
||||
dnspod_transfer 1
|
||||
write_log 7 "Add new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP] successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
#修改解析记录
|
||||
update_domain() {
|
||||
dnspod_transfer 2
|
||||
write_log 7 "Modify new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP],[TTL:$__TTL] successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
#获取域名解析记录
|
||||
describe_domain() {
|
||||
ret=0
|
||||
__POST="login_token=$username,$password&format=json&domain=$__DOMAIN&sub_domain=$__HOST&record_type=$__TYPE"
|
||||
__POST1="$__POST&value=$__IP&record_type=$__TYPE&record_line_id=0"
|
||||
dnspod_transfer 0
|
||||
__TMP=`jsonfilter -i $DATFILE -e "@.records[@.type!='NS']"`
|
||||
__value=`jsonfilter -s "$__TMP" -e "@.name"`
|
||||
if [ "$__value" == "" ]; then
|
||||
write_log 7 "Parsing record:[${__HOST}.${__DOMAIN}] does not exist"
|
||||
ret=1
|
||||
else
|
||||
__RECID=`jsonfilter -s "$__TMP" -e "@.id"`
|
||||
__value=`jsonfilter -s "$__TMP" -e "@.type"`
|
||||
__TTL=`jsonfilter -s "$__TMP" -e "@.ttl"`
|
||||
write_log 7 "Get parsing recordID:[$__RECID]"
|
||||
if [ "$__value" != "$__TYPE" ]; then
|
||||
write_log 7 "Current parsing [type:$__TYPE], get mismatched [type:$__value]"
|
||||
write_log 7 "Address needs to be modified, local address:[$__IP]"
|
||||
ret=2
|
||||
else
|
||||
__RECIP=`jsonfilter -s "$__TMP" -e "@.value"`
|
||||
if [ "$__RECIP" != "$__IP" ]; then
|
||||
write_log 7 "Address needs to be modified, local address:[$__IP]"
|
||||
ret=2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
build_command
|
||||
describe_domain
|
||||
if [ $ret == 1 ];then
|
||||
sleep 3 && add_domain
|
||||
elif [ $ret == 2 ];then
|
||||
sleep 3 && update_domain
|
||||
else
|
||||
write_log 7 "Local IP:[$__IP] parsing records IP:[$__RECIP] address does not need to be modified"
|
||||
fi
|
||||
|
||||
return 0
|
||||
@ -1,164 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#检查传入参数
|
||||
[ -z "$username" ] && write_log 14 "Configuration error! [User name] cannot be empty"
|
||||
[ -z "$password" ] && write_log 14 "Configuration error! [Password] cannot be empty"
|
||||
|
||||
#检查外部调用工具
|
||||
[ -n "$WGET_SSL" ] || write_log 13 "GNU Wget support is required to use Alibaba Cloud API. Please install first"
|
||||
|
||||
# 变量声明
|
||||
local __URLBASE __HOST __DOMAIN __TYPE __CMDBASE __TOKEN __POST __POST1 __RECIP __RECID __value __TTL
|
||||
__URLBASE="https://api.dnspod.com/"
|
||||
|
||||
# 从 $domain 分离主机和域名
|
||||
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
|
||||
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
|
||||
__HOST="${domain%%@*}"
|
||||
__DOMAIN="${domain#*@}"
|
||||
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
|
||||
|
||||
# 设置记录类型
|
||||
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
|
||||
|
||||
# 构造基本通信命令
|
||||
build_command() {
|
||||
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
|
||||
# 绑定用于通信的主机/IP
|
||||
if [ -n "$bind_network" ]; then
|
||||
local bind_ip run_prog
|
||||
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
|
||||
eval "$run_prog bind_ip $bind_network" || \
|
||||
write_log 13 "Unable to get local IP address with '$run_prog $ bind_network' - error code: '$?'"
|
||||
write_log 7 "Forced use of IP '$bind_ip' communication"
|
||||
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
|
||||
fi
|
||||
# 强制设定IP版本
|
||||
if [ $force_ipversion -eq 1 ]; then
|
||||
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
|
||||
fi
|
||||
# 设置CA证书参数
|
||||
if [ $use_https -eq 1 ]; then
|
||||
if [ "$cacert" = "IGNORE" ]; then
|
||||
__CMDBASE="$__CMDBASE --no-check-certificate"
|
||||
elif [ -f "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
|
||||
elif [ -d "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
|
||||
elif [ -n "$cacert" ]; then
|
||||
write_log 14 "A valid certificate for HTTPS communication was not found in '$cacert'"
|
||||
fi
|
||||
fi
|
||||
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
|
||||
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
|
||||
__CMDBASE="$__CMDBASE --post-data"
|
||||
}
|
||||
|
||||
# 用于Dnspod API的通信函数
|
||||
dnspod_transfer() {
|
||||
local __A=$1
|
||||
local __CNT=0
|
||||
local __ERR=0
|
||||
local __B __C PID_SLEEP
|
||||
case "$__A" in
|
||||
0)
|
||||
__B="$__CMDBASE 'login_email=$username&login_password=$password&format=json' ${__URLBASE}Auth"
|
||||
__C=$__B
|
||||
;;
|
||||
1)
|
||||
__B="$__CMDBASE '$__POST' ${__URLBASE}Record.List"
|
||||
__C=1
|
||||
;;
|
||||
2)
|
||||
__B="$__CMDBASE '$__POST1' ${__URLBASE}Record.Create"
|
||||
__C=1
|
||||
;;
|
||||
3)
|
||||
__B="$__CMDBASE '$__POST1&record_id=$__RECID&ttl=$__TTL' ${__URLBASE}Record.Modify"
|
||||
__C=1
|
||||
;;
|
||||
esac
|
||||
|
||||
while : ; do
|
||||
[ $__C -eq 1 ] && __C=$(echo -e "$__B" | sed -e "s/${__TOKEN#*,}/***PW***/g")
|
||||
write_log 7 "#> $__C"
|
||||
eval $__B
|
||||
__ERR=`jsonfilter -i $DATFILE -e "@.status.code"`
|
||||
|
||||
[ $__ERR -eq 1 ] && return 0
|
||||
[ $__A -eq 1 ] && [ $__ERR -eq 10 ] && return 0
|
||||
write_log 3 "Error message:[$(jsonfilter -i $DATFILE -e "@.status.message")]"
|
||||
|
||||
if [ $VERBOSE -gt 1 ]; then
|
||||
write_log 4 "Transfer failed - detailed mode: $VERBOSE - Do not try again after an error"
|
||||
return 1
|
||||
fi
|
||||
|
||||
__CNT=$(( $__CNT + 1 ))
|
||||
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && write_log 14 "Transfer failed after $retry_count retries"
|
||||
|
||||
write_log 4 "Transfer failed - $__CNT Try again in $RETRY_SECONDS seconds"
|
||||
sleep $RETRY_SECONDS &
|
||||
PID_SLEEP=$!
|
||||
wait $PID_SLEEP
|
||||
PID_SLEEP=0
|
||||
done
|
||||
}
|
||||
|
||||
#添加解析记录
|
||||
add_domain() {
|
||||
dnspod_transfer 2
|
||||
write_log 7 "Add new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP] successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
#修改解析记录
|
||||
update_domain() {
|
||||
dnspod_transfer 3
|
||||
write_log 7 "Modify new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP],[TTL:$__TTL] successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
#获取域名解析记录
|
||||
describe_domain() {
|
||||
ret=0
|
||||
dnspod_transfer 0
|
||||
__TOKEN=`jsonfilter -i $DATFILE -e "@.user_token"`
|
||||
__POST="user_token=$__TOKEN&format=json&domain=$__DOMAIN&sub_domain=$__HOST"
|
||||
__POST1="$__POST&value=$__IP&record_type=$__TYPE&record_line=default"
|
||||
dnspod_transfer 1
|
||||
__TMP=`jsonfilter -i $DATFILE -e "@.records[@.type!='NS']"`
|
||||
__value=`jsonfilter -s "$__TMP" -e "@.name"`
|
||||
if [ "$__value" == "" ]; then
|
||||
write_log 7 "Parsing record:[${__HOST}.${__DOMAIN}] does not exist"
|
||||
ret=1
|
||||
else
|
||||
__RECID=`jsonfilter -s "$__TMP" -e "@.id"`
|
||||
__value=`jsonfilter -s "$__TMP" -e "@.type"`
|
||||
__TTL=`jsonfilter -s "$__TMP" -e "@.ttl"`
|
||||
write_log 7 "Get parsing recordID:[$__RECID]"
|
||||
if [ "$__value" != "$__TYPE" ]; then
|
||||
write_log 7 "Current parsing [type:$__TYPE], get mismatched [type:$__value]"
|
||||
write_log 7 "Address needs to be modified, local address:[$__IP]"
|
||||
ret=2
|
||||
else
|
||||
__RECIP=`jsonfilter -s "$__TMP" -e "@.value"`
|
||||
if [ "$__RECIP" != "$__IP" ]; then
|
||||
write_log 7 "Address needs to be modified, local address:[$__IP]"
|
||||
ret=2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
build_command
|
||||
describe_domain
|
||||
if [ $ret == 1 ];then
|
||||
sleep 3 && add_domain
|
||||
elif [ $ret == 2 ];then
|
||||
sleep 3 && update_domain
|
||||
else
|
||||
write_log 7 "Local IP:[$__IP] parsing records IP:[$__RECIP] address does not need to be modified"
|
||||
fi
|
||||
|
||||
return 0
|
||||
@ -1,61 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsforwarder
|
||||
PKG_VERSION:=6.1.15
|
||||
PKG_RELEASE:=11
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/1715173329/dnsforwarder.git
|
||||
PKG_SOURCE_DATE:=2018-06-26
|
||||
PKG_SOURCE_VERSION:=587e61ae4d75dc976f538088b715a3c8ee26c144
|
||||
PKG_MIRROR_HASH:=7c141040ae384d254d90b3c3ee502d87330c9fdcd201ff29a669336a27b176d4
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Dennis <openwrt@tossp.com>
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dnsforwarder
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A simple DNS forwarder
|
||||
URL:=https://github.com/holmium/dnsforwarder
|
||||
DEPENDS:=+coreutils +coreutils-base64 +dnsmasq-full +libpthread +wget-ssl
|
||||
endef
|
||||
|
||||
define Package/dnsforwarder/description
|
||||
Forwarding queries to customized domains (and their subdomains) to specified servers
|
||||
over a specified protocol (UDP or TCP). non-standard ports are supported.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= --enable-downloader=wget
|
||||
|
||||
define Package/dnsforwarder/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnsforwarder $(1)/usr/bin/dnsforwarder
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) files/etc/config/dnsforwarder $(1)/etc/config/dnsforwarder
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) files/etc/init.d/dnsforwarder $(1)/etc/init.d/dnsforwarder
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/dnsforwarder
|
||||
$(INSTALL_CONF) files/etc/dnsforwarder/gfw.txt $(1)/etc/dnsforwarder/gfw.txt
|
||||
$(INSTALL_DIR) $(1)/usr/share/dnsforwarder
|
||||
$(INSTALL_BIN) files/usr/share/dnsforwarder/gfwlist.sh $(1)/usr/share/dnsforwarder/gfwlist.sh
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dnsforwarder))
|
||||
@ -1,79 +0,0 @@
|
||||
|
||||
config arguments
|
||||
option enabled '0'
|
||||
option addr '127.0.0.1:5053'
|
||||
|
||||
config config
|
||||
option cache 'true'
|
||||
option cache_size '102400'
|
||||
option cache_ignore 'false'
|
||||
option gfw 'true'
|
||||
list block_ip '74.125.127.102'
|
||||
list block_ip '74.125.155.102'
|
||||
list block_ip '74.125.39.102'
|
||||
list block_ip '74.125.39.113'
|
||||
list block_ip '209.85.229.138'
|
||||
list block_ip '128.121.126.139'
|
||||
list block_ip '159.106.121.75'
|
||||
list block_ip '169.132.13.103'
|
||||
list block_ip '192.67.198.6'
|
||||
list block_ip '202.106.1.2'
|
||||
list block_ip '202.181.7.85'
|
||||
list block_ip '203.161.230.171'
|
||||
list block_ip '203.98.7.65'
|
||||
list block_ip '207.12.88.98'
|
||||
list block_ip '208.56.31.43'
|
||||
list block_ip '209.145.54.50'
|
||||
list block_ip '209.220.30.174'
|
||||
list block_ip '209.36.73.33'
|
||||
list block_ip '211.94.66.147'
|
||||
list block_ip '213.169.251.35'
|
||||
list block_ip '216.221.188.182'
|
||||
list block_ip '216.234.179.13'
|
||||
list block_ip '243.185.187.39'
|
||||
list block_ip '37.61.54.158'
|
||||
list block_ip '4.36.66.178'
|
||||
list block_ip '46.82.174.68'
|
||||
list block_ip '59.24.3.173'
|
||||
list block_ip '64.33.88.161'
|
||||
list block_ip '64.33.99.47'
|
||||
list block_ip '64.66.163.251'
|
||||
list block_ip '65.104.202.252'
|
||||
list block_ip '65.160.219.113'
|
||||
list block_ip '66.45.252.237'
|
||||
list block_ip '69.55.52.253'
|
||||
list block_ip '72.14.205.104'
|
||||
list block_ip '72.14.205.99'
|
||||
list block_ip '78.16.49.15'
|
||||
list block_ip '8.7.198.45'
|
||||
list block_ip '93.46.8.89'
|
||||
list block_ip '37.61.54.158'
|
||||
list block_ip '243.185.187.39'
|
||||
list block_ip '190.93.247.4'
|
||||
list block_ip '190.93.246.4'
|
||||
list block_ip '190.93.245.4'
|
||||
list block_ip '190.93.244.4'
|
||||
list block_ip '65.49.2.178'
|
||||
list block_ip '189.163.17.5'
|
||||
list block_ip '23.89.5.60'
|
||||
list block_ip '49.2.123.56'
|
||||
list block_ip '54.76.135.1'
|
||||
list block_ip '77.4.7.92'
|
||||
list block_ip '118.5.49.6'
|
||||
list block_ip '159.24.3.173'
|
||||
list block_ip '188.5.4.96'
|
||||
list block_ip '197.4.4.12'
|
||||
list block_ip '220.250.64.24'
|
||||
list block_ip '243.185.187.30'
|
||||
list block_ip '249.129.46.48'
|
||||
list block_ip '253.157.14.165'
|
||||
option block_ipv6 'false'
|
||||
list cache_control 'tossp.com $orig'
|
||||
list cache_control '* fixed 3600'
|
||||
option log 'false'
|
||||
list udp_group '9.9.9.9,119.29.29.29,223.5.5.5,114.114.114.114 * on'
|
||||
option block_negative_resp 'true'
|
||||
list udp_local '0.0.0.0:5053'
|
||||
list udp_local '[::0]:5053'
|
||||
option domain_statistic 'false'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,262 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=60
|
||||
|
||||
extra_command "makeconfig"
|
||||
extra_command "makegfwlist"
|
||||
extra_command "health"
|
||||
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
PID_PATH=/var/run/dnsforwarder
|
||||
PID_FILE=${PID_PATH}/dns.pid
|
||||
DNSFORWARDER_CONF=/tmp/dnsforwarder.conf
|
||||
|
||||
add_cron()
|
||||
{
|
||||
sed -i '/dnsforwarder/d' $CRON_FILE
|
||||
echo '*/5 * * * * /etc/init.d/dnsforwarder health' >> $CRON_FILE
|
||||
echo '0 1 * * 0 /etc/init.d/dnsforwarder makegfwlist' >> $CRON_FILE
|
||||
crontab $CRON_FILE
|
||||
}
|
||||
|
||||
del_cron()
|
||||
{
|
||||
sed -i '/dnsforwarder/d' $CRON_FILE
|
||||
/etc/init.d/cron restart
|
||||
}
|
||||
|
||||
fixflowoffload(){
|
||||
dns=$(uci get flowoffload.@flow[0].dns 2>/dev/null)
|
||||
if [ $dns -eq 1 ]; then
|
||||
uci set flowoffload.@flow[0].dns=0 && uci commit flowoffload
|
||||
/etc/init.d/flowoffload restart
|
||||
fi
|
||||
}
|
||||
|
||||
makelist() {
|
||||
[ -z "$2" ] && return
|
||||
local i
|
||||
local t="$1"; shift
|
||||
for i in "$@"
|
||||
do
|
||||
echo "$t $i"
|
||||
done
|
||||
}
|
||||
|
||||
health(){
|
||||
rm /var/log/dnsforwarder.log.* 2>/dev/null
|
||||
local pid=$(cat ${PID_FILE} 2>/dev/null)
|
||||
if [ -n "${pid}" -a -d /proc/$pid ]; then
|
||||
echo "[health] process exists ${pid}"
|
||||
else
|
||||
echo "[health] Dnsforwarder is not running ${pid}"
|
||||
start
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
makegfwlist(){
|
||||
local GFW_FILE='/etc/dnsforwarder/gfw.txt'
|
||||
local GFW_TMP_FILE='/tmp/dnsforwarder-gfw.old'
|
||||
local TSTIME=`date '+%Y-%m-%d %H:%M:%S'`
|
||||
touch ${GFW_TMP_FILE}
|
||||
cat /etc/config/gfw.list 2>/dev/null > /tmp/edf.ts
|
||||
cat /etc/dnsmasq.ssr/gfw_base.conf 2>/dev/null | awk -F '/' '{print $2}' | sed 's/^.//g' >> /tmp/edf.ts
|
||||
cat /etc/dnsmasq.ssr/gfw_list.conf 2>/dev/null | awk -F '/' '{print $2}' | sed 's/^.//g' >> /tmp/edf.ts
|
||||
sort /tmp/edf.ts | uniq > /tmp/edf.ts
|
||||
/usr/share/dnsforwarder/gfwlist.sh -i -l -o /tmp/dnsforwarder-gfw.tmp --extra-domain-file /tmp/edf.ts
|
||||
if [ $? != 0 ]; then
|
||||
echo 'Failed to fetch gfwlist'
|
||||
logger -t Failed to fetch gfwlist
|
||||
return 2
|
||||
fi
|
||||
local gfw=$(cat /tmp/dnsforwarder-gfw.tmp)
|
||||
echo "# GenerationAt TS_BUILD_TIME" > ${GFW_TMP_FILE}.new
|
||||
echo "protocol tcp" >> ${GFW_TMP_FILE}.new
|
||||
echo "server 8.8.8.8,8.8.4.4,1.1.1.1,1.0.0.1,208.67.222.222,208.67.220.220,209.244.0.3,209.244.0.4,8.26.56.26,8.20.247.20,156.154.70.1,156.154.71.1,199.85.126.10" >> ${GFW_TMP_FILE}.new
|
||||
echo -e 'proxy no\n\n\n' >> ${GFW_TMP_FILE}.new
|
||||
echo "${gfw}" >> ${GFW_TMP_FILE}.new
|
||||
if [ "`cat ${GFW_TMP_FILE}.new | md5sum`" == "`cat ${GFW_TMP_FILE} | md5sum`" ]; then
|
||||
printf "[\e[32m%s\e[0m]\n" "hold"
|
||||
else
|
||||
cp ${GFW_TMP_FILE}.new ${GFW_TMP_FILE}
|
||||
cp ${GFW_TMP_FILE} ${GFW_FILE}
|
||||
sed -i "s/TS_BUILD_TIME/${TSTIME}/g" ${GFW_FILE}
|
||||
printf "[\e[33m%s\e[0m]" "PID"
|
||||
restart
|
||||
fi
|
||||
}
|
||||
|
||||
makeconfig () {
|
||||
config_load dnsforwarder
|
||||
|
||||
local log=$(uci get dnsforwarder.@config[0].log 2>/dev/null)
|
||||
local log_size=$(uci get dnsforwarder.@config[0].log_size 2>/dev/null)
|
||||
|
||||
local gfw=$(uci get dnsforwarder.@config[0].gfw 2>/dev/null)
|
||||
|
||||
local udp_local=$(uci -d ',' get dnsforwarder.@config[0].udp_local 2>/dev/null)
|
||||
local udp_local_list=$(uci get dnsforwarder.@config[0].udp_local 2>/dev/null)
|
||||
local tcp_group=$(uci get dnsforwarder.@config[0].tcp_group 2>/dev/null)
|
||||
local udp_group=$(uci get dnsforwarder.@config[0].udp_group 2>/dev/null)
|
||||
local group_file=$(uci get dnsforwarder.@config[0].group_file 2>/dev/null)
|
||||
local block_ip=$(uci -d ',' get dnsforwarder.@config[0].block_ip 2>/dev/null)
|
||||
local ip_substituting=$(uci -d ',' get dnsforwarder.@config[0].ip_substituting 2>/dev/null)
|
||||
local block_negative_resp=$(uci get dnsforwarder.@config[0].block_negative_resp 2>/dev/null)
|
||||
local append_host=$(uci get dnsforwarder.@config[0].append_host 2>/dev/null)
|
||||
local block_ipv6=$(uci get dnsforwarder.@config[0].block_ipv6 2>/dev/null)
|
||||
|
||||
local cache=$(uci get dnsforwarder.@config[0].cache 2>/dev/null)
|
||||
local cache_size=$(uci get dnsforwarder.@config[0].cache_size 2>/dev/null)
|
||||
local cache_ignore=$(uci get dnsforwarder.@config[0].cache_ignore 2>/dev/null)
|
||||
local cache_control=$(uci get dnsforwarder.@config[0].cache_control 2>/dev/null)
|
||||
|
||||
local domain_statistic=$(uci get dnsforwarder.@config[0].domain_statistic 2>/dev/null)
|
||||
local udp_local_addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
udp_local_addr=${udp_local_addr/:/#}
|
||||
|
||||
echo "LogOn ${log}" > $DNSFORWARDER_CONF
|
||||
if [ $log = "true" ]; then
|
||||
rm /var/log/dnsforwarder.log.* 2>/dev/null
|
||||
echo '' > /var/log/dnsforwarder.log
|
||||
echo "LogFileThresholdLength ${log_size}" >> $DNSFORWARDER_CONF
|
||||
echo "LogFileFolder /var/log" >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
|
||||
[ -n "$udp_local" ] && echo "UDPLocal ${udp_local}" >> $DNSFORWARDER_CONF
|
||||
[ -n "$udp_local_addr" ] && eval "makelist 'server=' $udp_local_addr" > /tmp/dnsmasq.dnsforwarder.conf
|
||||
sed -i "s/ //g" /tmp/dnsmasq.dnsforwarder.conf
|
||||
|
||||
eval "makelist 'TCPGroup' $tcp_group" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'UDPGroup' $udp_group" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'GroupFile' $group_file" >> $DNSFORWARDER_CONF
|
||||
|
||||
if [ $gfw = "true" ]; then
|
||||
echo 'GroupFile /etc/dnsforwarder/gfw.txt' >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
|
||||
echo "BlockIP ${block_ip}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'IPSubstituting' $ip_substituting" >> $DNSFORWARDER_CONF
|
||||
echo "BlockNegativeResponse ${block_negative_resp}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'AppendHosts' $append_host" >> $DNSFORWARDER_CONF
|
||||
echo "BlockIpv6WhenIpv4Exists ${block_ipv6}" >> $DNSFORWARDER_CONF
|
||||
|
||||
echo "UseCache ${cache}" >> $DNSFORWARDER_CONF
|
||||
if [ $cache = "true" ]; then
|
||||
echo "CacheSize ${cache_size}" >> $DNSFORWARDER_CONF
|
||||
echo "MemoryCache false" >> $DNSFORWARDER_CONF
|
||||
echo "CacheFile /tmp/dnsforwarder.cache" >> $DNSFORWARDER_CONF
|
||||
echo "IgnoreTTL ${cache_ignore}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'CacheControl' $cache_control" >> $DNSFORWARDER_CONF
|
||||
echo "ReloadCache true" >> $DNSFORWARDER_CONF
|
||||
echo "OverwriteCache true" >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
echo "DomainStatistic ${domain_statistic}" >> $DNSFORWARDER_CONF
|
||||
if [ $domain_statistic = "true" ]; then
|
||||
touch /tmp/dnsforwarder-statistic.html
|
||||
mkdir -p /root/.dnsforwarder
|
||||
rm /root/.dnsforwarder/statistic.html 2 > /dev/null
|
||||
ln -s /tmp/dnsforwarder-statistic.html /root/.dnsforwarder/statistic.html
|
||||
local domain_statistic_tag='<!-- TS DNSFORWARDER -->'
|
||||
echo "DomainStatisticTempletFile /tmp/dnsforwarder-statistic.html" >> $DNSFORWARDER_CONF
|
||||
echo "StatisticInsertionPosition ${domain_statistic_tag}" >> $DNSFORWARDER_CONF
|
||||
echo "StatisticUpdateInterval 60" >> $DNSFORWARDER_CONF
|
||||
echo "${domain_statistic_tag}" > /tmp/dnsforwarder-statistic.html
|
||||
fi
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
echo luci for dnsforwarder
|
||||
local vt_enabled=$(uci get dnsforwarder.@arguments[0].enabled 2>/dev/null)
|
||||
if [ $vt_enabled = 0 ]; then
|
||||
echo dnsforwarder is not enabled
|
||||
exit
|
||||
fi
|
||||
makeconfig
|
||||
fixflowoffload
|
||||
dnsforwarder -f $DNSFORWARDER_CONF -d
|
||||
sleep 10
|
||||
mkdir -p ${PID_PATH}
|
||||
pid=$(ps | awk '$5 ~ /\[dnsforwarder\]/ {print $1}')
|
||||
echo "dnsforwarder running pid is ${pid}"
|
||||
logger -t The pid of dnsforwarder is ${PID_FILE} ${pid}
|
||||
echo ${pid} > ${PID_FILE}
|
||||
/etc/init.d/dnsforwarder enable
|
||||
local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null)
|
||||
local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
[ -n "${addr}" ] && addr=${addr/:/#}
|
||||
|
||||
if [ "${dnsmasq}" = "1" ]; then
|
||||
uci delete dhcp.@dnsmasq[0].server 2>/dev/null
|
||||
# uci add_list dhcp.@dnsmasq[0].server=$addr
|
||||
uci delete dhcp.@dnsmasq[0].resolvfile 2>/dev/null
|
||||
uci set dhcp.@dnsmasq[0].noresolv=1
|
||||
uci set dhcp.@dnsmasq[0].serversfile=/tmp/dnsmasq.dnsforwarder.conf
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
fi
|
||||
local dnsmasq_server_addr=$(uci get dhcp.@dnsmasq[0].server 2>/dev/null)
|
||||
if [ -n "${dnsmasq_server_addr}" ]; then
|
||||
uci set dhcp.@dnsmasq[0].noresolv=1
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
fi
|
||||
add_cron
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
del_cron
|
||||
logger -t stopping dnsforwarder
|
||||
local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null)
|
||||
addr=${addr/:/#}
|
||||
if [ "${dnsmasq}" = "1" ]; then
|
||||
uci del_list dhcp.@dnsmasq[0].server=$addr 2>/dev/null
|
||||
fi
|
||||
uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.d/resolv.conf.auto 2>/dev/null
|
||||
uci delete dhcp.@dnsmasq[0].noresolv 2>/dev/null
|
||||
uci delete dhcp.@dnsmasq[0].serversfile 2>/dev/null
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
[ -e ${PID_FILE} ] && {
|
||||
pid=$(cat ${PID_FILE})
|
||||
logger -t killing dnsforwarder pid ${pid}
|
||||
echo killing dnsforwarder pid ${pid}
|
||||
kill ${pid}
|
||||
rm -f ${PID_FILE}
|
||||
} || {
|
||||
logger -t Cannot find dnsforwarder pid file
|
||||
}
|
||||
}
|
||||
|
||||
restart()
|
||||
{
|
||||
pid=$(cat ${PID_FILE} 2>/dev/null)
|
||||
echo Dnsforwarder pid file is ${pid}
|
||||
[ -n "$pid" ] && {
|
||||
echo stopping pid ${pid}
|
||||
logger -t There is dnsforwarder pid ${pid}
|
||||
stop
|
||||
} || {
|
||||
logger -t Dnsforwarder is not running
|
||||
}
|
||||
sleep 7
|
||||
local vt_enabled=$(uci get dnsforwarder.@arguments[0].enabled 2>/dev/null)
|
||||
echo dnsforwarder status is ${vt_enabled}
|
||||
logger -t Dnsforwarder is initializing enabled is ${vt_enabled}
|
||||
if [ ${vt_enabled} = 1 ]; then
|
||||
[ -n "$pid" ] && {
|
||||
logger -t There is dnsforwarder pid ${pid}
|
||||
stop
|
||||
} || {
|
||||
logger -t Dnsforwarder is not running
|
||||
}
|
||||
|
||||
logger -t Restarting dnsforwarder
|
||||
start
|
||||
else
|
||||
/etc/init.d/dnsforwarder disable
|
||||
fi
|
||||
}
|
||||
@ -1,313 +0,0 @@
|
||||
#/bin/sh
|
||||
|
||||
# Name: gfwlist2dnsmasq.sh
|
||||
# Desription: A shell script which convert gfwlist into dnsmasq rules.
|
||||
# Version: 0.8.0 (2017.12.25)
|
||||
# Author: Cokebar Chi
|
||||
# Website: https://github.com/cokebar
|
||||
|
||||
_green() {
|
||||
printf '\033[1;31;32m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
_red() {
|
||||
printf '\033[1;31;31m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
_yellow() {
|
||||
printf '\033[1;31;33m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat <<-EOF
|
||||
|
||||
Name: gfwlist2dnsmasq.sh
|
||||
Desription: A shell script which convert gfwlist into dnsmasq rules.
|
||||
Version: 0.8.0 (2017.12.25)
|
||||
Author: Cokebar Chi
|
||||
Website: https://github.com/cokebar
|
||||
|
||||
Usage: sh gfwlist2dnsmasq.sh [options] -o FILE
|
||||
Valid options are:
|
||||
-d, --dns <dns_ip>
|
||||
DNS IP address for the GfwList Domains (Default: 127.0.0.1)
|
||||
-p, --port <dns_port>
|
||||
DNS Port for the GfwList Domains (Default: 5353)
|
||||
-s, --ipset <ipset_name>
|
||||
Ipset name for the GfwList domains
|
||||
(If not given, ipset rules will not be generated.)
|
||||
-o, --output <FILE>
|
||||
/path/to/output_filename
|
||||
-i, --insecure
|
||||
Force bypass certificate validation (insecure)
|
||||
-l, --domain-list
|
||||
Convert Gfwlist into domain list instead of dnsmasq rules
|
||||
(If this option is set, DNS IP/Port & ipset are not needed)
|
||||
--exclude-domain-file <FILE>
|
||||
Delete specific domains in the result from a domain list text file
|
||||
Please put one domain per line
|
||||
--extra-domain-file <FILE>
|
||||
Include extra domains to the result from a domain list text file
|
||||
This file will be processed after the exclude-domain-file
|
||||
Please put one domain per line
|
||||
-h, --help
|
||||
Usage
|
||||
EOF
|
||||
exit $1
|
||||
}
|
||||
|
||||
clean_and_exit(){
|
||||
# Clean up temp files
|
||||
printf 'Cleaning up... '
|
||||
rm -rf $TMP_DIR
|
||||
_green 'Done\n\n'
|
||||
[ $1 -eq 0 ] && _green 'Job Finished.\n\n' || _red 'Exit with Error code '$1'.\n'
|
||||
exit $1
|
||||
}
|
||||
|
||||
check_depends(){
|
||||
which sed base64 curl >/dev/null
|
||||
if [ $? != 0 ]; then
|
||||
_red 'Error: Missing Dependency.\nPlease check whether you have the following binaries on you system:\nwhich, sed, base64, curl.\n'
|
||||
exit 3
|
||||
fi
|
||||
|
||||
SYS_KERNEL=`uname -s`
|
||||
if [ $SYS_KERNEL = "Darwin" -o $SYS_KERNEL = "FreeBSD" ]; then
|
||||
BASE64_DECODE='base64 -D'
|
||||
SED_ERES='sed -E'
|
||||
else
|
||||
BASE64_DECODE='base64 -d'
|
||||
SED_ERES='sed -r'
|
||||
fi
|
||||
}
|
||||
|
||||
get_args(){
|
||||
OUT_TYPE='DNSMASQ_RULES'
|
||||
DNS_IP='127.0.0.1'
|
||||
DNS_PORT='5353'
|
||||
IPSET_NAME=''
|
||||
FILE_FULLPATH=''
|
||||
CURL_EXTARG=''
|
||||
WITH_IPSET=0
|
||||
EXTRA_DOMAIN_FILE=''
|
||||
EXCLUDE_DOMAIN_FILE=''
|
||||
IPV4_PATTERN='^((2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)\.){3}(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)$'
|
||||
IPV6_PATTERN='^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?$'
|
||||
|
||||
while [ ${#} -gt 0 ]; do
|
||||
case "${1}" in
|
||||
--help | -h)
|
||||
usage 0
|
||||
;;
|
||||
--domain-list | -l)
|
||||
OUT_TYPE='DOMAIN_LIST'
|
||||
;;
|
||||
--insecure | -i)
|
||||
CURL_EXTARG='--insecure'
|
||||
;;
|
||||
--dns | -d)
|
||||
DNS_IP="$2"
|
||||
shift
|
||||
;;
|
||||
--port | -p)
|
||||
DNS_PORT="$2"
|
||||
shift
|
||||
;;
|
||||
--ipset | -s)
|
||||
IPSET_NAME="$2"
|
||||
shift
|
||||
;;
|
||||
--output | -o)
|
||||
OUT_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
--extra-domain-file)
|
||||
EXTRA_DOMAIN_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
--exclude-domain-file)
|
||||
EXCLUDE_DOMAIN_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
_red "Invalid argument: $1"
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
|
||||
# Check path & file name
|
||||
if [ -z $OUT_FILE ]; then
|
||||
_red 'Error: Please specify the path to the output file(using -o/--output argument).\n'
|
||||
exit 1
|
||||
else
|
||||
if [ -z ${OUT_FILE##*/} ]; then
|
||||
_red 'Error: '$OUT_FILE' is a path, not a file.\n'
|
||||
exit 1
|
||||
else
|
||||
if [ ${OUT_FILE}a != ${OUT_FILE%/*}a ] && [ ! -d ${OUT_FILE%/*} ]; then
|
||||
_red 'Error: Folder do not exist: '${OUT_FILE%/*}'\n'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $OUT_TYPE = 'DNSMASQ_RULES' ]; then
|
||||
# Check DNS IP
|
||||
IPV4_TEST=$(echo $DNS_IP | grep -E $IPV4_PATTERN)
|
||||
IPV6_TEST=$(echo $DNS_IP | grep -E $IPV6_PATTERN)
|
||||
if [ "$IPV4_TEST" != "$DNS_IP" -a "$IPV6_TEST" != "$DNS_IP" ]; then
|
||||
_red 'Error: Please enter a valid DNS server IP address.\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check DNS port
|
||||
if [ $DNS_PORT -lt 1 -o $DNS_PORT -gt 65535 ]; then
|
||||
_red 'Error: Please enter a valid DNS server port.\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check ipset name
|
||||
if [ -z $IPSET_NAME ]; then
|
||||
WITH_IPSET=0
|
||||
else
|
||||
IPSET_TEST=$(echo $IPSET_NAME | grep -E '^\w+$')
|
||||
if [ "$IPSET_TEST" != "$IPSET_NAME" ]; then
|
||||
_red 'Error: Please enter a valid IP set name.\n'
|
||||
exit 1
|
||||
else
|
||||
WITH_IPSET=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z $EXTRA_DOMAIN_FILE ] && [ ! -f $EXTRA_DOMAIN_FILE ]; then
|
||||
_yellow 'WARNING:\nExtra domain file does not exist, ignored.\n\n'
|
||||
EXTRA_DOMAIN_FILE=''
|
||||
fi
|
||||
|
||||
if [ ! -z $EXCLUDE_DOMAIN_FILE ] && [ ! -f $EXCLUDE_DOMAIN_FILE ]; then
|
||||
_yellow 'WARNING:\nExclude domain file does not exist, ignored.\n\n'
|
||||
EXCLUDE_DOMAIN_FILE=''
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
process(){
|
||||
# Set Global Var
|
||||
BASE_URL='https://github.com/gfwlist/gfwlist/raw/master/gfwlist.txt'
|
||||
TMP_DIR=`mktemp -d /tmp/gfwlist2dnsmasq.XXXXXX`
|
||||
BASE64_FILE="$TMP_DIR/base64.txt"
|
||||
GFWLIST_FILE="$TMP_DIR/gfwlist.txt"
|
||||
DOMAIN_TEMP_FILE="$TMP_DIR/gfwlist2domain.tmp"
|
||||
DOMAIN_FILE="$TMP_DIR/gfwlist2domain.txt"
|
||||
CONF_TMP_FILE="$TMP_DIR/gfwlist.conf.tmp"
|
||||
OUT_TMP_FILE="$TMP_DIR/gfwlist.out.tmp"
|
||||
|
||||
# Fetch GfwList and decode it into plain text
|
||||
printf 'Fetching GfwList... '
|
||||
local tscurl='curl -L --connect-timeout 5 -m 300 --retry 3 --retry-delay 1'
|
||||
$tscurl $CURL_EXTARG -o$BASE64_FILE $BASE_URL \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://gitlab.com/gfwlist/gfwlist/raw/master/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://git.tuxfamily.org/gfwlist/gfwlist.git/plain/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://pagure.io/gfwlist/raw/master/f/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE http://repo.or.cz/gfwlist.git/blob_plain/HEAD:/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://bitbucket.org/gfwlist/gfwlist/raw/HEAD/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE $BASE_URL
|
||||
if [ $? != 0 ]; then
|
||||
_red '\nFailed to fetch gfwlist.txt. Please check your Internet connection.\n'
|
||||
clean_and_exit 2
|
||||
fi
|
||||
$BASE64_DECODE $BASE64_FILE > $GFWLIST_FILE || ( _red 'Failed to decode gfwlist.txt. Quit.\n'; clean_and_exit 2 )
|
||||
_green 'Done.\n\n'
|
||||
|
||||
# Convert
|
||||
IGNORE_PATTERN='^\!|\[|^@@|(https?://){0,1}[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'
|
||||
HEAD_FILTER_PATTERN='s#^(\|\|?)?(https?://)?##g'
|
||||
TAIL_FILTER_PATTERN='s#/.*$|%2F.*$##g'
|
||||
DOMAIN_PATTERN='([a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)+)'
|
||||
HANDLE_WILDCARD_PATTERN='s#^(([a-zA-Z0-9]*\*[-a-zA-Z0-9]*)?(\.))?([a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)+)(\*)?#\4#g'
|
||||
|
||||
printf 'Converting GfwList to ' && _green $OUT_TYPE && printf ' ...\n'
|
||||
_yellow '\nWARNING:\nThe following lines in GfwList contain regex, and might be ignored:\n\n'
|
||||
cat $GFWLIST_FILE | grep -n '^/.*$'
|
||||
_yellow "\nThis script will try to convert some of the regex rules. But you should know this may not be a equivalent conversion.\nIf there's regex rules which this script do not deal with, you should add the domain manually to the list.\n\n"
|
||||
grep -vE $IGNORE_PATTERN $GFWLIST_FILE | $SED_ERES $HEAD_FILTER_PATTERN | $SED_ERES $TAIL_FILTER_PATTERN | grep -E $DOMAIN_PATTERN | $SED_ERES $HANDLE_WILDCARD_PATTERN > $DOMAIN_TEMP_FILE
|
||||
|
||||
printf 'google.com\ngoogle.ad\ngoogle.ae\ngoogle.com.af\ngoogle.com.ag\ngoogle.com.ai\ngoogle.al\ngoogle.am\ngoogle.co.ao\ngoogle.com.ar\ngoogle.as\ngoogle.at\ngoogle.com.au\ngoogle.az\ngoogle.ba\ngoogle.com.bd\ngoogle.be\ngoogle.bf\ngoogle.bg\ngoogle.com.bh\ngoogle.bi\ngoogle.bj\ngoogle.com.bn\ngoogle.com.bo\ngoogle.com.br\ngoogle.bs\ngoogle.bt\ngoogle.co.bw\ngoogle.by\ngoogle.com.bz\ngoogle.ca\ngoogle.cd\ngoogle.cf\ngoogle.cg\ngoogle.ch\ngoogle.ci\ngoogle.co.ck\ngoogle.cl\ngoogle.cm\ngoogle.cn\ngoogle.com.co\ngoogle.co.cr\ngoogle.com.cu\ngoogle.cv\ngoogle.com.cy\ngoogle.cz\ngoogle.de\ngoogle.dj\ngoogle.dk\ngoogle.dm\ngoogle.com.do\ngoogle.dz\ngoogle.com.ec\ngoogle.ee\ngoogle.com.eg\ngoogle.es\ngoogle.com.et\ngoogle.fi\ngoogle.com.fj\ngoogle.fm\ngoogle.fr\ngoogle.ga\ngoogle.ge\ngoogle.gg\ngoogle.com.gh\ngoogle.com.gi\ngoogle.gl\ngoogle.gm\ngoogle.gp\ngoogle.gr\ngoogle.com.gt\ngoogle.gy\ngoogle.com.hk\ngoogle.hn\ngoogle.hr\ngoogle.ht\ngoogle.hu\ngoogle.co.id\ngoogle.ie\ngoogle.co.il\ngoogle.im\ngoogle.co.in\ngoogle.iq\ngoogle.is\ngoogle.it\ngoogle.je\ngoogle.com.jm\ngoogle.jo\ngoogle.co.jp\ngoogle.co.ke\ngoogle.com.kh\ngoogle.ki\ngoogle.kg\ngoogle.co.kr\ngoogle.com.kw\ngoogle.kz\ngoogle.la\ngoogle.com.lb\ngoogle.li\ngoogle.lk\ngoogle.co.ls\ngoogle.lt\ngoogle.lu\ngoogle.lv\ngoogle.com.ly\ngoogle.co.ma\ngoogle.md\ngoogle.me\ngoogle.mg\ngoogle.mk\ngoogle.ml\ngoogle.com.mm\ngoogle.mn\ngoogle.ms\ngoogle.com.mt\ngoogle.mu\ngoogle.mv\ngoogle.mw\ngoogle.com.mx\ngoogle.com.my\ngoogle.co.mz\ngoogle.com.na\ngoogle.com.nf\ngoogle.com.ng\ngoogle.com.ni\ngoogle.ne\ngoogle.nl\ngoogle.no\ngoogle.com.np\ngoogle.nr\ngoogle.nu\ngoogle.co.nz\ngoogle.com.om\ngoogle.com.pa\ngoogle.com.pe\ngoogle.com.pg\ngoogle.com.ph\ngoogle.com.pk\ngoogle.pl\ngoogle.pn\ngoogle.com.pr\ngoogle.ps\ngoogle.pt\ngoogle.com.py\ngoogle.com.qa\ngoogle.ro\ngoogle.ru\ngoogle.rw\ngoogle.com.sa\ngoogle.com.sb\ngoogle.sc\ngoogle.se\ngoogle.com.sg\ngoogle.sh\ngoogle.si\ngoogle.sk\ngoogle.com.sl\ngoogle.sn\ngoogle.so\ngoogle.sm\ngoogle.sr\ngoogle.st\ngoogle.com.sv\ngoogle.td\ngoogle.tg\ngoogle.co.th\ngoogle.com.tj\ngoogle.tk\ngoogle.tl\ngoogle.tm\ngoogle.tn\ngoogle.to\ngoogle.com.tr\ngoogle.tt\ngoogle.com.tw\ngoogle.co.tz\ngoogle.com.ua\ngoogle.co.ug\ngoogle.co.uk\ngoogle.com.uy\ngoogle.co.uz\ngoogle.com.vc\ngoogle.co.ve\ngoogle.vg\ngoogle.co.vi\ngoogle.com.vn\ngoogle.vu\ngoogle.ws\ngoogle.rs\ngoogle.co.za\ngoogle.co.zm\ngoogle.co.zw\ngoogle.cat\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'Google search domains... ' && _green 'Added\n'
|
||||
|
||||
# Add blogspot domains
|
||||
printf 'blogspot.ca\nblogspot.co.uk\nblogspot.com\nblogspot.com.ar\nblogspot.com.au\nblogspot.com.br\nblogspot.com.by\nblogspot.com.co\nblogspot.com.cy\nblogspot.com.ee\nblogspot.com.eg\nblogspot.com.es\nblogspot.com.mt\nblogspot.com.ng\nblogspot.com.tr\nblogspot.com.uy\nblogspot.de\nblogspot.gr\nblogspot.in\nblogspot.mx\nblogspot.ch\nblogspot.fr\nblogspot.ie\nblogspot.it\nblogspot.pt\nblogspot.ro\nblogspot.sg\nblogspot.be\nblogspot.no\nblogspot.se\nblogspot.jp\nblogspot.in\nblogspot.ae\nblogspot.al\nblogspot.am\nblogspot.ba\nblogspot.bg\nblogspot.ch\nblogspot.cl\nblogspot.cz\nblogspot.dk\nblogspot.fi\nblogspot.gr\nblogspot.hk\nblogspot.hr\nblogspot.hu\nblogspot.ie\nblogspot.is\nblogspot.kr\nblogspot.li\nblogspot.lt\nblogspot.lu\nblogspot.md\nblogspot.mk\nblogspot.my\nblogspot.nl\nblogspot.no\nblogspot.pe\nblogspot.qa\nblogspot.ro\nblogspot.ru\nblogspot.se\nblogspot.sg\nblogspot.si\nblogspot.sk\nblogspot.sn\nblogspot.tw\nblogspot.ug\nblogspot.cat\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'Blogspot domains... ' && _green 'Added\n'
|
||||
|
||||
# Add twimg.edgesuite.net
|
||||
printf 'twimg.edgesuite.net\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'twimg.edgesuite.net... ' && _green 'Added\n'
|
||||
|
||||
# Delete exclude domains
|
||||
if [ ! -z $EXCLUDE_DOMAIN_FILE ]; then
|
||||
for line in $(cat $EXCLUDE_DOMAIN_FILE)
|
||||
do
|
||||
cat $DOMAIN_TEMP_FILE | grep -vF -f $EXCLUDE_DOMAIN_FILE > $DOMAIN_FILE
|
||||
done
|
||||
printf 'Domains in exclude domain file '$EXCLUDE_DOMAIN_FILE'... ' && _green 'Deleted\n'
|
||||
else
|
||||
cat $DOMAIN_TEMP_FILE > $DOMAIN_FILE
|
||||
fi
|
||||
|
||||
# Add extra domains
|
||||
if [ ! -z $EXTRA_DOMAIN_FILE ]; then
|
||||
cat $EXTRA_DOMAIN_FILE >> $DOMAIN_FILE
|
||||
printf 'Extra domain file '$EXTRA_DOMAIN_FILE'... ' && _green 'Added\n'
|
||||
fi
|
||||
|
||||
if [ $OUT_TYPE = 'DNSMASQ_RULES' ]; then
|
||||
# Convert domains into dnsmasq rules
|
||||
if [ $WITH_IPSET -eq 1 ]; then
|
||||
_green 'Ipset rules included.'
|
||||
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'\
|
||||
ipset=/\1/'$IPSET_NAME'#g' > $CONF_TMP_FILE
|
||||
else
|
||||
_green 'Ipset rules not included.'
|
||||
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'#g' > $CONF_TMP_FILE
|
||||
fi
|
||||
|
||||
# Generate output file
|
||||
echo '# dnsmasq rules generated by gfwlist' > $OUT_TMP_FILE
|
||||
echo "# Last Updated on $(date "+%Y-%m-%d %H:%M:%S")" >> $OUT_TMP_FILE
|
||||
echo '# ' >> $OUT_TMP_FILE
|
||||
cat $CONF_TMP_FILE >> $OUT_TMP_FILE
|
||||
cp $OUT_TMP_FILE $OUT_FILE
|
||||
else
|
||||
sort -u $DOMAIN_FILE > $OUT_TMP_FILE
|
||||
fi
|
||||
|
||||
cp $OUT_TMP_FILE $OUT_FILE
|
||||
printf '\nConverting GfwList to '$OUT_TYPE'... ' && _green 'Done\n\n'
|
||||
|
||||
# Clean up
|
||||
clean_and_exit 0
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ -z "$1" ]; then
|
||||
usage 0
|
||||
else
|
||||
check_depends
|
||||
get_args "$@"
|
||||
_green '\nJob Started.\n\n'
|
||||
process
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@ -1,39 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dsmboot
|
||||
PKG_VERSION:=5.2
|
||||
PKG_RELEASE:=5967.1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dsmboot
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Synology DSM pxeboot from TFTP
|
||||
endef
|
||||
|
||||
define Package/dsmboot/description
|
||||
DSM 5.2 boot from TFTP
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/dsmboot/install
|
||||
$(INSTALL_DIR) $(1)/root
|
||||
$(CP) ./files/dsm.iso $(1)/root/
|
||||
$(CP) ./files/menu.lst $(1)/root/
|
||||
$(CP) ./files/pxelinux.0 $(1)/root/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/dsmboot $(1)/etc/uci-defaults/yyy-dsmboot
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dsmboot))
|
||||
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set dhcp.@dnsmasq[0].enable_tftp='1'
|
||||
set dhcp.@dnsmasq[0].dhcp_boot='pxelinux.0'
|
||||
set dhcp.@dnsmasq[0].tftp_root='/root'
|
||||
commit dhcp
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
@ -1,9 +0,0 @@
|
||||
default 0
|
||||
timeout 0
|
||||
fallback 0
|
||||
|
||||
title Synology DSM
|
||||
map --mem (pd)/dsm.iso (hd32)
|
||||
map --hook
|
||||
chainloader (hd32)
|
||||
|
||||
Binary file not shown.
@ -1,54 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 Lean <coolsnowwolf@gmail.com>
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gmediarender
|
||||
PKG_VERSION:=0.0.8
|
||||
PKG_RELEASE=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/hzeller/gmrender-resurrect.git
|
||||
PKG_SOURCE_DATE:=2021-01-15
|
||||
PKG_SOURCE_VERSION:=7cd74525e89a1dcd8869b8f6f67f2565afa59abe
|
||||
PKG_MIRROR_HASH:=98514528690a6bcf0d6611c12f1dd498e795943085e916501f5442c19d98e162
|
||||
|
||||
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/gmediarender
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=A Headless UPnP Renderer
|
||||
DEPENDS:=+glib2 +gstreamer1 +libgstreamer1 +gstreamer1-libs +libupnp
|
||||
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/gmediarender $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,gmediarender))
|
||||
@ -1,41 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2015 Justin Liu
|
||||
# Author: Justin Liu <rssnsj@gmail.com>
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ipset-lists
|
||||
PKG_VERSION:=20181104
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ipset-lists
|
||||
CATEGORY:=Network
|
||||
TITLE:=Service for IPSET address tables
|
||||
MAINTAINER:=Justin Liu <rssnsj@gmail.com>
|
||||
DEPENDS:=+ipset
|
||||
endef
|
||||
|
||||
define Package/ipset-lists/conffiles
|
||||
/etc/gfwlist/china-banned
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/ipset-lists/install
|
||||
$(CP) files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/ipset-lists/postinst
|
||||
#!/bin/sh
|
||||
if [ -e /etc/openwrt_release ]; then
|
||||
/etc/init.d/ipset.sh restart
|
||||
/etc/init.d/ipset.sh enable || :
|
||||
fi
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ipset-lists))
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,95 +0,0 @@
|
||||
v.youku.com
|
||||
api.youku.com
|
||||
v2.tudou.com
|
||||
www.tudou.com
|
||||
s.plcloud.music.qq.com
|
||||
i.y.qq.com
|
||||
hot.vrs.sohu.com
|
||||
live.tv.sohu.com
|
||||
pad.tv.sohu.com
|
||||
my.tv.sohu.com
|
||||
hot.vrs.letv.com
|
||||
data.video.qiyi.com
|
||||
cache.video.qiyi.com
|
||||
cache.vip.qiyi.com
|
||||
vv.video.qq.com
|
||||
tt.video.qq.com
|
||||
ice.video.qq.com
|
||||
tjsa.video.qq.com
|
||||
a10.video.qq.com
|
||||
xyy.video.qq.com
|
||||
vcq.video.qq.com
|
||||
vsh.video.qq.com
|
||||
vbj.video.qq.com
|
||||
bobo.video.qq.com
|
||||
flvs.video.qq.com
|
||||
bkvv.video.qq.com
|
||||
info.zb.qq.com
|
||||
geo.js.kankan.xunlei.com
|
||||
web-play.pptv.com
|
||||
web-play.pplive.cn
|
||||
dyn.ugc.pps.tv
|
||||
v.pps.tv
|
||||
inner.kandian.com
|
||||
ipservice.163.com
|
||||
so.open.163.com
|
||||
zb.s.qq.com
|
||||
ip.kankan.xunlei.com
|
||||
vxml.56.com
|
||||
music.sina.com.cn
|
||||
play.baidu.com
|
||||
v.iask.com
|
||||
tv.weibo.com
|
||||
wtv.v.iask.com
|
||||
video.sina.com.cn
|
||||
www.yinyuetai.com
|
||||
api.letv.com
|
||||
live.gslb.letv.com
|
||||
static.itv.letv.com
|
||||
ip.apps.cntv.cn
|
||||
vdn.apps.cntv.cn
|
||||
vdn.live.cntv.cn
|
||||
vip.sports.cntv.cn
|
||||
a.play.api.3g.youku.com
|
||||
i.play.api.3g.youku.com
|
||||
api.3g.youku.com
|
||||
tv.api.3g.youku.com
|
||||
play.api.3g.youku.com
|
||||
play.api.3g.tudou.com
|
||||
tv.api.3g.tudou.com
|
||||
api.3g.tudou.com
|
||||
api.tv.sohu.com
|
||||
access.tv.sohu.com
|
||||
iface.iqiyi.com
|
||||
iface2.iqiyi.com
|
||||
cache.m.iqiyi.com
|
||||
dynamic.app.m.letv.com
|
||||
dynamic.meizi.app.m.letv.com
|
||||
dynamic.search.app.m.letv.com
|
||||
dynamic.live.app.m.letv.com
|
||||
listso.m.areainfo.ppstream.com
|
||||
epg.api.pptv.com
|
||||
play.api.pptv.com
|
||||
m.letv.com
|
||||
interface.bilibili.com
|
||||
3g.music.qq.com
|
||||
mqqplayer.3g.qq.com
|
||||
proxy.music.qq.com
|
||||
proxymc.qq.com
|
||||
ip2.kugou.com
|
||||
ip.kugou.com
|
||||
client.api.ttpod.com
|
||||
mobi.kuwo.cn
|
||||
mobilefeedback.kugou.com
|
||||
tingapi.ting.baidu.com
|
||||
music.baidu.com
|
||||
serviceinfo.sdk.duomi.com
|
||||
music.163.com
|
||||
www.xiami.com
|
||||
spark.api.xiami.com
|
||||
iplocation.geo.qiyi.com
|
||||
sns.video.qq.com
|
||||
v5.pc.duomi.com
|
||||
tms.is.ysten.com
|
||||
internal.check.duokanbox.com
|
||||
openapi.youku.com
|
||||
@ -1,29 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2014 Justin Liu <rssnsj@gmail.com>
|
||||
|
||||
START=21
|
||||
|
||||
start()
|
||||
{
|
||||
local file
|
||||
for file in /etc/ipset/*; do
|
||||
[ -f $file ] || continue
|
||||
ipset restore < $file
|
||||
done
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
local file
|
||||
for file in /etc/ipset/*; do
|
||||
[ -f $file ] || continue
|
||||
ipset destroy `basename $file`
|
||||
done
|
||||
}
|
||||
|
||||
restart()
|
||||
{
|
||||
stop >/dev/null 2>&1
|
||||
start
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
||||
create local hash:net family inet hashsize 1024 maxelem 65536
|
||||
add local 10.0.0.0/8
|
||||
add local 127.0.0.0/8
|
||||
add local 172.16.0.0/12
|
||||
add local 192.168.0.0/16
|
||||
add local 224.0.0.0/3
|
||||
@ -1,9 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
msgid "Domain Lists Settings"
|
||||
msgstr "域名列表设置"
|
||||
|
||||
msgid "Domain Lists"
|
||||
msgstr "域名列表"
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
update:
|
||||
./gen-china-routes.sh > ../files/etc/ipset/china
|
||||
./gen-gfwlist.sh > ../files/etc/gfwlist/china-banned
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,85 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
#
|
||||
# Script for generating China IPv4 route table by merging APNIC.net data and IPIP.net data
|
||||
#
|
||||
|
||||
china_routes_ipip()
|
||||
{
|
||||
[ -f ipip.txt ] || wget -4 https://cdn.jsdelivr.net/gh/17mon/china_ip_list/china_ip_list.txt -O ipip.txt >&2 || exit 1
|
||||
cat ipip.txt | xargs netmask | awk '{print $1}'
|
||||
}
|
||||
|
||||
china_routes_apnic()
|
||||
{
|
||||
[ -f apnic.txt ] || wget -4 http://ftp.apnic.net/stats/apnic/delegated-apnic-latest -O apnic.txt >&2 || exit 1
|
||||
|
||||
cat apnic.txt | awk -F'|' -vc=CN '
|
||||
function tobits(c) { for(n=0; c>=2; c/=2) n++; return 32-n; }
|
||||
$2==c&&$3=="ipv4" { printf("%s/%d\n", $4, tobits($5)) }' |
|
||||
xargs netmask | awk '{print $1}'
|
||||
}
|
||||
|
||||
china_routes_merged()
|
||||
{
|
||||
[ -x ./ipv4-merger ] || gcc ipv4_merger.c -o ipv4-merger >&2
|
||||
|
||||
china_routes_apnic > china.apnic
|
||||
china_routes_ipip > china.ipip
|
||||
|
||||
# Merge them together
|
||||
cat china.apnic china.ipip | ./ipv4-merger | sed 's/\-/:/g' |
|
||||
xargs netmask | awk '{print $1}' | awk -F/ '$2<=24' > china.merged
|
||||
|
||||
cat china.merged
|
||||
}
|
||||
|
||||
# $1: ipset name
|
||||
convert_routes_to_ipset()
|
||||
{
|
||||
local ipset_name="$1"
|
||||
echo "create $ipset_name hash:net family inet hashsize 1024 maxelem 65536"
|
||||
awk -vt="$ipset_name" '{ printf("add %s %s\n", t, $0) }'
|
||||
}
|
||||
|
||||
|
||||
generate_china_ipset()
|
||||
{
|
||||
china_routes_merged | convert_routes_to_ipset china
|
||||
}
|
||||
|
||||
generate_inverted_china_routes()
|
||||
{
|
||||
(
|
||||
china_routes_merged
|
||||
echo 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 172.16.0.0/12 192.168.0.0/16 224.0.0.0/3
|
||||
) |
|
||||
xargs netmask -r | awk '{print $1}' |
|
||||
awk -F- '
|
||||
function iptoint(ip) { split(ip,arr,"."); n=0; for(i=1;i<=4;i++) n=n*256+arr[i]; return n; }
|
||||
function inttoip(n) { a=int(n/16777216); b=int(n%16777216/65536); c=int(n%65536/256); d=n%256; return a "." b "." c "." d; }
|
||||
BEGIN { st=0 }
|
||||
{ x=st; y=iptoint($1); st=iptoint($2)+1; if(y>x) { print inttoip(x) ":" inttoip(y-1); } }' |
|
||||
xargs netmask | awk '{print $1}'
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
case "$1" in
|
||||
"")
|
||||
generate_china_ipset
|
||||
;;
|
||||
-c)
|
||||
china_routes_merged
|
||||
;;
|
||||
-r)
|
||||
generate_inverted_china_routes
|
||||
;;
|
||||
*)
|
||||
echo "Usage:"
|
||||
echo " $0 generate China routes in ipset format"
|
||||
echo " $0 -c generate China routes in IP/prefix format"
|
||||
echo " $0 -r generate invert China routes"
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
@ -1,29 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
generate_china_banned()
|
||||
{
|
||||
if [ ! -f gfwlist.txt ]; then
|
||||
wget https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O gfwlist.b64 >&2
|
||||
cat gfwlist.b64 | base64 -d > gfwlist.txt
|
||||
rm -f gfwlist.b64
|
||||
fi
|
||||
|
||||
cat gfwlist.txt base-gfwlist.txt | sort -u |
|
||||
sed 's#!.\+##; s#|##g; s#@##g; s#http:\/\/##; s#https:\/\/##;' |
|
||||
sed '/\*/d; /apple\.com/d; /sina\.cn/d; /sina\.com\.cn/d; /baidu\.com/d; /qq\.com/d' |
|
||||
sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' |
|
||||
grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | rev | sort -u |
|
||||
awk '
|
||||
BEGIN { prev = "________"; } {
|
||||
cur = $0;
|
||||
if (index(cur, prev) == 1 && substr(cur, 1 + length(prev) ,1) == ".") {
|
||||
} else {
|
||||
print cur;
|
||||
prev = cur;
|
||||
}
|
||||
}' | rev | sort -u
|
||||
|
||||
}
|
||||
|
||||
generate_china_banned
|
||||
|
||||
@ -1,339 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef u_int32_t u32;
|
||||
typedef int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
typedef unsigned gfp_t;
|
||||
|
||||
static inline char *ipv4_hltos(u32 u, char *s)
|
||||
{
|
||||
static char ss[20];
|
||||
if (!s)
|
||||
s = ss;
|
||||
sprintf(s, "%d.%d.%d.%d",
|
||||
(int)(u >> 24) & 0xff, (int)(u >> 16) & 0xff,
|
||||
(int)(u >> 8) & 0xff, (int)u & 0xff );
|
||||
return s;
|
||||
}
|
||||
|
||||
static inline u32 ipv4_stohl(const char *s)
|
||||
{
|
||||
int u[4];
|
||||
if (sscanf(s, "%d.%d.%d.%d", &u[0], &u[1], &u[2], &u[3]) == 4) {
|
||||
return (((u32)u[0] & 0xff) << 24) |
|
||||
(((u32)u[1] & 0xff) << 16) |
|
||||
(((u32)u[2] & 0xff) << 8) |
|
||||
(((u32)u[3] & 0xff));
|
||||
} else
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
static inline bool is_ipv4_addr(const char *s)
|
||||
{
|
||||
int u[4];
|
||||
if (sscanf(s, "%d.%d.%d.%d", &u[0], &u[1], &u[2], &u[3]) == 4)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
struct ipv4_range {
|
||||
u32 start;
|
||||
u32 end;
|
||||
};
|
||||
|
||||
struct sa_open_data {
|
||||
struct ipv4_range *tmp_base;
|
||||
size_t tmp_size;
|
||||
size_t tmp_length;
|
||||
int errors;
|
||||
};
|
||||
|
||||
static int __touch_tmp_base(struct sa_open_data *od, gfp_t gfp)
|
||||
{
|
||||
if (!od->tmp_base) {
|
||||
/**
|
||||
* Allocate a temporary table with twice the size of the previous
|
||||
* table or at least 100, on which new entries can be inserted.
|
||||
*/
|
||||
if (od->tmp_size < 100)
|
||||
od->tmp_size = 100;
|
||||
od->tmp_base = (struct ipv4_range *)malloc(
|
||||
sizeof(struct ipv4_range) * od->tmp_size /*, gfp*/ );
|
||||
if (!od->tmp_base) {
|
||||
fprintf(stderr,
|
||||
"salist: cannot allocate the temporary list for enlarging it.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
od->tmp_length = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipv4_list_add_range(struct sa_open_data *od, u32 start,
|
||||
u32 end, gfp_t gfp)
|
||||
{
|
||||
struct ipv4_range *cur;
|
||||
int ret;
|
||||
|
||||
/* Ignore a new range if it or a larger range already exists */
|
||||
//if (salist_check_ipv4(od->table, start, end))
|
||||
// return 0;
|
||||
|
||||
if ((ret = __touch_tmp_base(od, gfp)) < 0)
|
||||
return ret;
|
||||
|
||||
/* Check if the size is efficient. Enlarge it if needed. */
|
||||
if (od->tmp_length + 1 >= od->tmp_size) {
|
||||
size_t old_size = od->tmp_size;
|
||||
struct ipv4_range *old_base = od->tmp_base;
|
||||
|
||||
od->tmp_size *= 2;
|
||||
od->tmp_base = (struct ipv4_range *)realloc(od->tmp_base,
|
||||
sizeof(struct ipv4_range) * od->tmp_size);
|
||||
if (!od->tmp_base) {
|
||||
od->tmp_size = old_size;
|
||||
od->tmp_base = old_base;
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
cur = &od->tmp_base[od->tmp_length++];
|
||||
cur->start = start;
|
||||
cur->end = end;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ipv4_list_add_netmask(struct sa_open_data *od,
|
||||
u32 net, u32 net_mask, gfp_t gfp)
|
||||
{
|
||||
u32 start = net & net_mask;
|
||||
u32 end = net | ~net_mask;
|
||||
|
||||
return ipv4_list_add_range(od, start, end, gfp);
|
||||
}
|
||||
|
||||
static int ipv4_list_add_net(struct sa_open_data *od, u32 net,
|
||||
int net_bits, gfp_t gfp)
|
||||
{
|
||||
u32 net_mask;
|
||||
|
||||
if(net_bits == 0)
|
||||
net_mask = 0x00000000;
|
||||
else
|
||||
net_mask = ~(((u32)1 << (32 - net_bits)) - 1);
|
||||
//printf("%d: %08x, %08x\n", net_bits, net_mask, net_size);
|
||||
|
||||
return ipv4_list_add_netmask(od, net, net_mask, gfp);
|
||||
}
|
||||
|
||||
static int salist_cmd_parse(struct sa_open_data *od, char *cmd, gfp_t gfp)
|
||||
{
|
||||
char *a1 = NULL, *a2 = NULL;
|
||||
char *sep;
|
||||
char sc;
|
||||
int n = 32;
|
||||
|
||||
/* Case 3: Append an item */
|
||||
|
||||
/* Check IP description part: network segment or range? */
|
||||
if ((sep = strchr(cmd, '/'))) { }
|
||||
else if ((sep = strchr(cmd, '-'))) { }
|
||||
else if ((sep = strchr(cmd, ':'))) { }
|
||||
|
||||
if (sep) {
|
||||
/* Describes a subnet or range. */
|
||||
sc = *sep;
|
||||
*sep = '\0';
|
||||
|
||||
a1 = cmd;
|
||||
a2 = sep + 1;
|
||||
|
||||
if (*a2 == '\0') {
|
||||
fprintf(stderr, "Nothing after '%c'.\n", sc);
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
/* Describes a single IP. */
|
||||
sc = '\0';
|
||||
a1 = cmd;
|
||||
}
|
||||
|
||||
switch (sc) {
|
||||
case '/':
|
||||
/* 10.10.20.0/24 */
|
||||
/* ------------------------------------ */
|
||||
if (is_ipv4_addr(a2)) {
|
||||
ipv4_list_add_netmask(od, ipv4_stohl(a1), ipv4_stohl(a2), gfp);
|
||||
} else {
|
||||
sscanf(a2, "%d", &n);
|
||||
ipv4_list_add_net(od, ipv4_stohl(a1), n, gfp);
|
||||
}
|
||||
/* ------------------------------------ */
|
||||
break;
|
||||
case ':':
|
||||
case '-':
|
||||
/* 10.10.20.0-10.20.0.255 */
|
||||
/* ------------------------------------ */
|
||||
ipv4_list_add_range(od, ipv4_stohl(a1), ipv4_stohl(a2), gfp);
|
||||
/* ------------------------------------ */
|
||||
break;
|
||||
default:
|
||||
if (is_ipv4_addr(a1)) {
|
||||
/* Single IP address. */
|
||||
u32 ip = ipv4_stohl(a1);
|
||||
/* ------------------------------------ */
|
||||
ipv4_list_add_range(od, ip, ip, gfp);
|
||||
/* ------------------------------------ */
|
||||
} else {
|
||||
fprintf(stderr, "Invalid IP address '%s'.\n", a1);
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipv4_range_sort_cmp(const void *a, const void *b)
|
||||
{
|
||||
struct ipv4_range *ra = (struct ipv4_range *)a;
|
||||
struct ipv4_range *rb = (struct ipv4_range *)b;
|
||||
|
||||
if (ra->start > rb->start) {
|
||||
return 1;
|
||||
} else if (ra->start < rb->start) {
|
||||
return -1;
|
||||
} else if (ra->end > rb->end) {
|
||||
return 1;
|
||||
} else if (ra->end < rb->end) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void ipv4_range_swap(void *a, void *b, int size)
|
||||
{
|
||||
struct ipv4_range *ra = (struct ipv4_range *)a;
|
||||
struct ipv4_range *rb = (struct ipv4_range *)b;
|
||||
struct ipv4_range tmp;
|
||||
tmp = *ra;
|
||||
*ra = *rb;
|
||||
*rb = tmp;
|
||||
}
|
||||
|
||||
static struct sa_open_data *salist_open(void)
|
||||
{
|
||||
struct sa_open_data *od = NULL;
|
||||
|
||||
od = (struct sa_open_data *)malloc(sizeof(*od));
|
||||
if (!od) {
|
||||
fprintf(stderr, "salist: cannot allocate sa_open_data.\n");
|
||||
return NULL;
|
||||
}
|
||||
memset(od, 0, sizeof(*od));
|
||||
od->errors = 0;
|
||||
|
||||
return od;
|
||||
}
|
||||
|
||||
static int salist_close(struct sa_open_data *od)
|
||||
{
|
||||
size_t ri, wi;
|
||||
struct ipv4_range *old_base;
|
||||
|
||||
/* Flush the table if any modification has been done */
|
||||
if (od->tmp_base) {
|
||||
/* Sort the table and merge entries as many as possible. */
|
||||
if (od->tmp_length >= 2) {
|
||||
qsort(od->tmp_base, od->tmp_length, sizeof(struct ipv4_range),
|
||||
ipv4_range_sort_cmp);
|
||||
|
||||
for (wi = 0, ri = 1; ri < od->tmp_length; ri++) {
|
||||
/* NOTICE: 0xffffffff + 1 ? */
|
||||
if (od->tmp_base[wi].end == (u32)(-1)) {
|
||||
/* Nothing */
|
||||
} else if (od->tmp_base[ri].start <= od->tmp_base[wi].end + 1) {
|
||||
/* The two ranges overlap, so merge the 2nd to the 1st one */
|
||||
if (od->tmp_base[ri].end > od->tmp_base[wi].end)
|
||||
od->tmp_base[wi].end = od->tmp_base[ri].end;
|
||||
} else {
|
||||
wi++;
|
||||
if (wi < ri)
|
||||
od->tmp_base[wi] = od->tmp_base[ri];
|
||||
}
|
||||
}
|
||||
|
||||
od->tmp_length = wi + 1;
|
||||
}
|
||||
|
||||
/* Reduce the size */
|
||||
if (od->tmp_length < od->tmp_size) {
|
||||
struct ipv4_range *__tmp = od->tmp_base;
|
||||
od->tmp_base = (struct ipv4_range *)malloc(
|
||||
sizeof(struct ipv4_range) * (od->tmp_length ? od->tmp_length : 1));
|
||||
if (od->tmp_base) {
|
||||
memcpy(od->tmp_base, __tmp,
|
||||
sizeof(struct ipv4_range) * od->tmp_length);
|
||||
free(__tmp);
|
||||
} else {
|
||||
fprintf(stderr, "[%s:%d] Failed to allocate temporary table.\n",
|
||||
__FUNCTION__, __LINE__);
|
||||
/* If failed to allocate new memory, do not reduce it. */
|
||||
od->tmp_base = __tmp;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dump the table instead */
|
||||
}
|
||||
|
||||
if (od->errors) {
|
||||
fprintf(stderr, "[%s] %d errors detected during table operation.\n",
|
||||
__FUNCTION__, od->errors);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sa_open_data_dump(struct sa_open_data *od)
|
||||
{
|
||||
size_t i;
|
||||
char s1[20], s2[20];
|
||||
|
||||
for (i = 0; i < od->tmp_length; i++) {
|
||||
printf("%s-%s\n", ipv4_hltos(od->tmp_base[i].start, s1),
|
||||
ipv4_hltos(od->tmp_base[i].end, s2));
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct sa_open_data *od;
|
||||
char lbuf[128];
|
||||
|
||||
od = salist_open();
|
||||
|
||||
while (fgets(lbuf, sizeof(lbuf), stdin)) {
|
||||
size_t llen = strlen(lbuf);
|
||||
if (llen > 0 && lbuf[llen - 1] == '\n')
|
||||
lbuf[--llen] = '\0';
|
||||
if (llen > 0 && lbuf[llen - 1] == '\r')
|
||||
lbuf[--llen] = '\0';
|
||||
if (llen == 0)
|
||||
continue;
|
||||
salist_cmd_parse(od, lbuf, 0);
|
||||
}
|
||||
|
||||
salist_close(od);
|
||||
|
||||
sa_open_data_dump(od);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcryptopp
|
||||
PKG_VERSION:=8.3.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=cryptopp$(subst .,,$(PKG_VERSION)).zip
|
||||
PKG_SOURCE_URL:=https://www.cryptopp.com/
|
||||
PKG_HASH:=db38a15a6b1c337c665e2ebeb731dd0754b05e45504897d0f2fe4ae9f5ee589a
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
UNZIP_CMD:=unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
|
||||
|
||||
define Package/libcryptopp
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Crypto++ is library for creating C++ programs which use cryptographic algorithms
|
||||
URL:=https://packages.debian.org/sid/libcrypto++-dev
|
||||
DEPENDS:=+libpthread +libstdcpp
|
||||
endef
|
||||
|
||||
define Package/package/libcryptopp
|
||||
Crypto++ is library for creating C++ programs which use cryptographic algorithms.
|
||||
The library uses a Pipes & Filters architecture with heavy use of templates and
|
||||
abstract base classes.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
cd $(PKG_BUILD_DIR); rm -f GNUmakefile GNUmakefile-cross
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/cryptopp
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/cryptopp/* $(1)/usr/include/cryptopp/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcryptopp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libcryptopp))
|
||||
@ -1,592 +0,0 @@
|
||||
## Makefile.am - Autotools configuration file for Crypto++.
|
||||
## written and placed in public domain by Jeffrey Walton.
|
||||
## based on Debian Makefile.am by László Böszörményi.
|
||||
##
|
||||
## The GNUmakefile can generate the list of lib headers, lib sources,
|
||||
## test headers and test sources. Generate the list of files with
|
||||
## 'make sources'. Remove the SIMD files for libothers_la_SOURCES.
|
||||
## Thanks to steeldriver on U&L.SE for help with the sed.
|
||||
##
|
||||
## make sources | sed 's|cryptlib.cpp cpu.cpp integer.cpp ||g' | \
|
||||
## sed -e 's|[[:alnum:]]*_simd.cpp ||g' | \
|
||||
## sed -e 's|[[:alnum:]]*_sse.cpp ||g' | \
|
||||
## sed -e 's|[[:alnum:]]*_avx.cpp ||g' | \
|
||||
## sed -e 's|[[:alnum:]]*_armv4.cpp ||g' | \
|
||||
## sed -e 's|ppc_power[[:alnum:]]*.cpp ||g' | \
|
||||
## fold -s -w 72
|
||||
##
|
||||
## The command `make sources | sed ... | fold` will create the source file
|
||||
## list that can be used with `libothers_la_SOURCES` below.
|
||||
##
|
||||
## The list of header files can be built with 'make sources', too.
|
||||
##
|
||||
## make sources | sed -e 's|[[:alnum:]]*_armv4.h ||g' \
|
||||
## fold -s -w 72
|
||||
##
|
||||
## Note: configure.ac deletes GNUmakefile. You can get it back with:
|
||||
##
|
||||
## git checkout GNUmakefile
|
||||
##
|
||||
|
||||
## Automake does not support "specific flags for certain source files"
|
||||
## natively, so we hack it. The hack include building 20 or so
|
||||
## libraries and then combining them into an archive or shared object.
|
||||
## Also see https://lists.gnu.org/archive/html/automake/2017-11/msg00000.html
|
||||
## https://www.gnu.org/software/automake/manual/html_node/Per_002dObject-Flags.html.
|
||||
##
|
||||
## Visit the link below for the original Debian Autotools files
|
||||
## https://sources.debian.net/src/libcrypto++/5.6.4-8/debian/autotools/
|
||||
##
|
||||
|
||||
## TODO:
|
||||
##
|
||||
## - Figure out how to include TestPrograms/ in the dist tarball
|
||||
## TestPrograms/ is unique because it is included in dist tarball but not installed
|
||||
##
|
||||
## - Figure out what's going on with DragonFly and dependencies
|
||||
##
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
AM_DEFAULT_SOURCE_EXT = .cpp
|
||||
|
||||
## libcryptopp.la is created from disjoint libraries due to object file
|
||||
## ordering and per-object file flags requirements. libcryptopp.la is
|
||||
## named as the primary library, and the object files with special needs
|
||||
## are listed as EXTRA_LTLIBRARIES. Also see
|
||||
## https://lists.gnu.org/archive/html/automake/2017-11/msg00000.html.
|
||||
|
||||
lib_LTLIBRARIES = \
|
||||
libcryptopp.la
|
||||
|
||||
EXTRA_LTLIBRARIES = \
|
||||
libcryptlib.la \
|
||||
libcpu.la \
|
||||
libinteger.la \
|
||||
libaria_simd.la \
|
||||
libblake2s_simd.la \
|
||||
libblake2b_simd.la \
|
||||
libchacha_simd.la \
|
||||
libchacha_avx.la \
|
||||
libcham_simd.la \
|
||||
libcrc_simd.la \
|
||||
libdonna_sse.la \
|
||||
libgcm_simd.la \
|
||||
libgf2n_simd.la \
|
||||
libkeccak_simd.la \
|
||||
liblea_simd.la \
|
||||
libneon_simd.la \
|
||||
libppc_simd.la \
|
||||
libppc_power7.la \
|
||||
libppc_power8.la \
|
||||
libppc_power9.la \
|
||||
librijndael_simd.la \
|
||||
libsha_simd.la \
|
||||
libshacal2_simd.la \
|
||||
libsimon128_simd.la \
|
||||
libspeck128_simd.la \
|
||||
libsm4_simd.la \
|
||||
libsse_simd.la
|
||||
|
||||
## ARMv7-a AES and SHA by Andy Polyakov
|
||||
if CRYPTOGAMS_ARM_SOURCES
|
||||
EXTRA_LTLIBRARIES += libaes_armv4.la
|
||||
EXTRA_LTLIBRARIES += libsha1_armv4.la
|
||||
EXTRA_LTLIBRARIES += libsha256_armv4.la
|
||||
EXTRA_LTLIBRARIES += libsha512_armv4.la
|
||||
endif
|
||||
|
||||
## The remainder of the source files
|
||||
EXTRA_LTLIBRARIES += libothers.la
|
||||
|
||||
## libcryptopp_la_SOURCES is empty because we need to create the library
|
||||
## artifact from disjoint libraries due to object file ordering and
|
||||
## per-object file flags requriements. Actually, the adhoc.cpp file is
|
||||
## due to an automake issue of assuming C sources when the list is empty.
|
||||
## https://lists.gnu.org/archive/html/automake/2017-11/msg00000.html.
|
||||
|
||||
libcryptopp_la_SOURCES = \
|
||||
adhoc.cpp
|
||||
|
||||
## Don't use EXTRA_ prefix for libcryptopp_la_LIBADD. It breaks Solaris.
|
||||
|
||||
libcryptopp_la_LIBADD = \
|
||||
$(libcryptlib_la_OBJECTS) \
|
||||
$(libcpu_la_OBJECTS) \
|
||||
$(libinteger_la_OBJECTS) \
|
||||
$(libaria_simd_la_OBJECTS) \
|
||||
$(libblake2s_simd_la_OBJECTS) \
|
||||
$(libblake2b_simd_la_OBJECTS) \
|
||||
$(libchacha_simd_la_OBJECTS) \
|
||||
$(libchacha_avx_la_OBJECTS) \
|
||||
$(libcham_simd_la_OBJECTS) \
|
||||
$(libcrc_simd_la_OBJECTS) \
|
||||
$(libdonna_sse_la_OBJECTS) \
|
||||
$(libgcm_simd_la_OBJECTS) \
|
||||
$(libgf2n_simd_la_OBJECTS) \
|
||||
$(libkeccak_simd_la_OBJECTS) \
|
||||
$(liblea_simd_la_OBJECTS) \
|
||||
$(libneon_simd_la_OBJECTS) \
|
||||
$(libppc_simd_la_OBJECTS) \
|
||||
$(libppc_power7_la_OBJECTS) \
|
||||
$(libppc_power8_la_OBJECTS) \
|
||||
$(libppc_power9_la_OBJECTS) \
|
||||
$(librijndael_simd_la_OBJECTS) \
|
||||
$(libsha_simd_la_OBJECTS) \
|
||||
$(libshacal2_simd_la_OBJECTS) \
|
||||
$(libsimon128_simd_la_OBJECTS) \
|
||||
$(libspeck128_simd_la_OBJECTS) \
|
||||
$(libsm4_simd_la_OBJECTS) \
|
||||
$(libsse_simd_la_OBJECTS)
|
||||
|
||||
## ARMv7-a AES and SHA by Andy Polyakov
|
||||
if CRYPTOGAMS_ARM_SOURCES
|
||||
libcryptopp_la_LIBADD += $(libaes_armv4_la_OBJECTS)
|
||||
libcryptopp_la_LIBADD += $(libsha1_armv4_la_OBJECTS)
|
||||
libcryptopp_la_LIBADD += $(libsha256_armv4_la_OBJECTS)
|
||||
libcryptopp_la_LIBADD += $(libsha512_armv4_la_OBJECTS)
|
||||
endif
|
||||
|
||||
## cpufeatures library on Android
|
||||
if ANDROID_CPU_FEATURES
|
||||
libcryptopp_la_LIBADD += $(libcpu_features_la_OBJECTS)
|
||||
endif
|
||||
|
||||
## The remainder of the object files
|
||||
libcryptopp_la_LIBADD += $(libothers_la_OBJECTS)
|
||||
|
||||
## Don't use EXTRA_ prefix for libcryptopp_la_DEPENDENCIES. It breaks Solaris.
|
||||
|
||||
libcryptopp_la_DEPENDENCIES = \
|
||||
$(libcryptlib_la_OBJECTS) \
|
||||
$(libcpu_la_OBJECTS) \
|
||||
$(libinteger_la_OBJECTS) \
|
||||
$(libaria_simd_la_OBJECTS) \
|
||||
$(libblake2s_simd_la_OBJECTS) \
|
||||
$(libblake2b_simd_la_OBJECTS) \
|
||||
$(libchacha_simd_la_OBJECTS) \
|
||||
$(libchacha_avx_la_OBJECTS) \
|
||||
$(libcham_simd_la_OBJECTS) \
|
||||
$(libcrc_simd_la_OBJECTS) \
|
||||
$(libdonna_sse_la_OBJECTS) \
|
||||
$(libkeccak_simd_la_OBJECTS) \
|
||||
$(liblea_simd_la_OBJECTS) \
|
||||
$(libgcm_simd_la_OBJECTS) \
|
||||
$(libgf2n_simd_la_OBJECTS) \
|
||||
$(libneon_simd_la_OBJECTS) \
|
||||
$(libppc_simd_la_OBJECTS) \
|
||||
$(libppc_power7_la_OBJECTS) \
|
||||
$(libppc_power8_la_OBJECTS) \
|
||||
$(libppc_power9_la_OBJECTS) \
|
||||
$(librijndael_simd_la_OBJECTS) \
|
||||
$(libsha_simd_la_OBJECTS) \
|
||||
$(libshacal2_simd_la_OBJECTS) \
|
||||
$(libsimon128_simd_la_OBJECTS) \
|
||||
$(libspeck128_simd_la_OBJECTS) \
|
||||
$(libsm4_simd_la_OBJECTS) \
|
||||
$(libsse_simd_la_OBJECTS)
|
||||
|
||||
## ARMv7-a AES and SHA by Andy Polyakov
|
||||
if CRYPTOGAMS_ARM_SOURCES
|
||||
libcryptopp_la_DEPENDENCIES += $(libaes_armv4_la_OBJECTS)
|
||||
libcryptopp_la_DEPENDENCIES += $(libsha1_armv4_la_OBJECTS)
|
||||
libcryptopp_la_DEPENDENCIES += $(libsha256_armv4_la_OBJECTS)
|
||||
libcryptopp_la_DEPENDENCIES += $(libsha512_armv4_la_OBJECTS)
|
||||
endif
|
||||
|
||||
## cpufeatures library on Android
|
||||
if ANDROID_CPU_FEATURES
|
||||
libcryptopp_la_DEPENDENCIES += $(libcpu_features_la_OBJECTS)
|
||||
endif
|
||||
|
||||
## The remainder of the object files
|
||||
libcryptopp_la_DEPENDENCIES += $(libothers_la_OBJECTS)
|
||||
|
||||
## Man, did Autotools fuck this up royally...
|
||||
## https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||
libcryptopp_la_LDFLAGS = $(AM_LDFLAGS) -release 8.3.0 -version-info 8:3
|
||||
|
||||
## Source files with special needs
|
||||
libcryptlib_la_SOURCES = cryptlib.cpp
|
||||
libcryptlib_la_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
libcpu_la_SOURCES = cpu.cpp
|
||||
libcpu_la_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
libinteger_la_SOURCES = integer.cpp
|
||||
libinteger_la_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
libaria_simd_la_SOURCES = aria_simd.cpp
|
||||
libaria_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_ARIA_FLAG)
|
||||
|
||||
libblake2s_simd_la_SOURCES = blake2s_simd.cpp
|
||||
libblake2s_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_BLAKE2S_FLAG)
|
||||
|
||||
libblake2b_simd_la_SOURCES = blake2b_simd.cpp
|
||||
libblake2b_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_BLAKE2B_FLAG)
|
||||
|
||||
libchacha_simd_la_SOURCES = chacha_simd.cpp
|
||||
libchacha_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_CHACHA_FLAG)
|
||||
|
||||
libchacha_avx_la_SOURCES = chacha_avx.cpp
|
||||
libchacha_avx_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_CHACHA_AVX2_FLAG)
|
||||
|
||||
libcham_simd_la_SOURCES = cham_simd.cpp
|
||||
libcham_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_CHAM_FLAG)
|
||||
|
||||
libcrc_simd_la_SOURCES = crc_simd.cpp
|
||||
libcrc_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_CRC_FLAG)
|
||||
|
||||
libdonna_sse_la_SOURCES = donna_sse.cpp
|
||||
libdonna_sse_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_DONNA_FLAG)
|
||||
|
||||
libgcm_simd_la_SOURCES = gcm_simd.cpp
|
||||
libgcm_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_GCM_FLAG)
|
||||
|
||||
libgf2n_simd_la_SOURCES = gf2n_simd.cpp
|
||||
libgf2n_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_GF2N_FLAG)
|
||||
|
||||
libkeccak_simd_la_SOURCES = keccak_simd.cpp
|
||||
libkeccak_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_KECCAK_FLAG)
|
||||
|
||||
liblea_simd_la_SOURCES = lea_simd.cpp
|
||||
liblea_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_LEA_FLAG)
|
||||
|
||||
libneon_simd_la_SOURCES = neon_simd.cpp
|
||||
libneon_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_NEON_FLAG)
|
||||
|
||||
libppc_simd_la_SOURCES = ppc_simd.cpp
|
||||
libppc_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_ALTIVEC_FLAG)
|
||||
|
||||
libppc_power7_la_SOURCES = ppc_power7.cpp
|
||||
libppc_power7_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_POWER7_FLAG)
|
||||
|
||||
libppc_power8_la_SOURCES = ppc_power8.cpp
|
||||
libppc_power8_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_POWER8_FLAG)
|
||||
|
||||
# Do not use CRYPTOPP_POWER9_FLAG. See https://github.com/weidai11/cryptopp/issues/986
|
||||
libppc_power9_la_SOURCES = ppc_power9.cpp
|
||||
# libppc_power9_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_POWER9_FLAG)
|
||||
libppc_power9_la_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
librijndael_simd_la_SOURCES = rijndael_simd.cpp
|
||||
librijndael_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_AES_FLAG)
|
||||
|
||||
libsha_simd_la_SOURCES = sha_simd.cpp
|
||||
libsha_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SHA_FLAG)
|
||||
|
||||
libshacal2_simd_la_SOURCES = shacal2_simd.cpp
|
||||
libshacal2_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SHA_FLAG)
|
||||
|
||||
libsimon128_simd_la_SOURCES = simon128_simd.cpp
|
||||
libsimon128_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SIMON128_FLAG)
|
||||
|
||||
libspeck128_simd_la_SOURCES = speck128_simd.cpp
|
||||
libspeck128_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SPECK128_FLAG)
|
||||
|
||||
libsm4_simd_la_SOURCES = sm4_simd.cpp
|
||||
libsm4_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SM4_FLAG)
|
||||
|
||||
libsse_simd_la_SOURCES = sse_simd.cpp
|
||||
libsse_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SSE2_FLAG)
|
||||
|
||||
## ARMv7-a AES and SHA by Andy Polyakov
|
||||
## Also see https://stackoverflow.com/q/51575580/608639
|
||||
if CRYPTOGAMS_ARM_SOURCES
|
||||
libaes_armv4_la_SOURCES = aes_armv4.S
|
||||
libsha1_armv4_la_SOURCES = sha1_armv4.S
|
||||
libsha256_armv4_la_SOURCES = sha256_armv4.S
|
||||
libsha512_armv4_la_SOURCES = sha512_armv4.S
|
||||
libaes_armv4_la_CCASFLAGS = $(AM_CXXFLAGS) $(CRYPTOPGAMS_ARMV4_THUMB_FLAG)
|
||||
libsha1_armv4_la_CCASFLAGS = $(AM_CXXFLAGS) $(CRYPTOPGAMS_ARMV4_FLAG)
|
||||
libsha256_armv4_la_CCASFLAGS = $(AM_CXXFLAGS) $(CRYPTOPGAMS_ARMV4_FLAG)
|
||||
libsha512_armv4_la_CCASFLAGS = $(AM_CXXFLAGS) $(CRYPTOPGAMS_ARMV4_FLAG)
|
||||
endif
|
||||
|
||||
## cpufeatures library on Android
|
||||
if ANDROID_CPU_FEATURES
|
||||
libcpu_features_la_SOURCES = cpu-features.c
|
||||
endif
|
||||
|
||||
# This is the list of remaining sources files that don't need special order
|
||||
# and don't need special flags. It is formed by removing cryptlib.cpp,
|
||||
# cpu.cpp, integer.cpp, *_avx.cpp and *_simd.cpp files. It is sorted in
|
||||
# alphabetical order for deterministic builds.
|
||||
|
||||
# To build this list, see the head notes.
|
||||
libothers_la_SOURCES = \
|
||||
3way.cpp adler32.cpp algebra.cpp algparam.cpp allocate.cpp arc4.cpp \
|
||||
aria.cpp ariatab.cpp asn.cpp authenc.cpp base32.cpp base64.cpp \
|
||||
basecode.cpp bfinit.cpp blake2.cpp blowfish.cpp blumshub.cpp \
|
||||
camellia.cpp cast.cpp casts.cpp cbcmac.cpp ccm.cpp chacha.cpp \
|
||||
chachapoly.cpp cham.cpp channels.cpp cmac.cpp crc.cpp darn.cpp \
|
||||
default.cpp des.cpp dessp.cpp dh.cpp dh2.cpp dll.cpp donna_32.cpp \
|
||||
donna_64.cpp dsa.cpp eax.cpp ec2n.cpp eccrypto.cpp ecp.cpp elgamal.cpp \
|
||||
emsa2.cpp eprecomp.cpp esign.cpp files.cpp filters.cpp fips140.cpp \
|
||||
fipstest.cpp gcm.cpp gf256.cpp gf2_32.cpp gf2n.cpp gfpcrypt.cpp \
|
||||
gost.cpp gzip.cpp hc128.cpp hc256.cpp hex.cpp hight.cpp hmac.cpp \
|
||||
hrtimer.cpp ida.cpp idea.cpp iterhash.cpp kalyna.cpp kalynatab.cpp \
|
||||
keccak.cpp keccak_core.cpp lea.cpp luc.cpp mars.cpp marss.cpp md2.cpp \
|
||||
md4.cpp md5.cpp misc.cpp modes.cpp mqueue.cpp mqv.cpp nbtheory.cpp \
|
||||
oaep.cpp osrng.cpp padlkrng.cpp panama.cpp pkcspad.cpp poly1305.cpp \
|
||||
polynomi.cpp pssr.cpp pubkey.cpp queue.cpp rabbit.cpp rabin.cpp \
|
||||
randpool.cpp rc2.cpp rc5.cpp rc6.cpp rdrand.cpp rdtables.cpp \
|
||||
rijndael.cpp ripemd.cpp rng.cpp rsa.cpp rw.cpp safer.cpp salsa.cpp \
|
||||
scrypt.cpp seal.cpp seed.cpp serpent.cpp sha.cpp sha3.cpp shacal2.cpp \
|
||||
shake.cpp shark.cpp sharkbox.cpp simeck.cpp simon.cpp skipjack.cpp \
|
||||
sm3.cpp sm4.cpp sosemanuk.cpp speck.cpp square.cpp squaretb.cpp \
|
||||
strciphr.cpp tea.cpp tftables.cpp threefish.cpp tiger.cpp tigertab.cpp \
|
||||
ttmac.cpp tweetnacl.cpp twofish.cpp vmac.cpp wake.cpp whrlpool.cpp \
|
||||
xed25519.cpp xtr.cpp xtrcrypt.cpp xts.cpp zdeflate.cpp zinflate.cpp \
|
||||
zlib.cpp
|
||||
|
||||
# To build this list, see the head notes.
|
||||
pkginclude_HEADERS = \
|
||||
3way.h adler32.h adv_simd.h aes.h algebra.h algparam.h allocate.h \
|
||||
arc4.h argnames.h aria.h arm_simd.h asn.h authenc.h base32.h base64.h \
|
||||
basecode.h blake2.h blowfish.h blumshub.h camellia.h cast.h cbcmac.h \
|
||||
ccm.h chacha.h chachapoly.h cham.h channels.h cmac.h config.h \
|
||||
config_align.h config_asm.h config_cpu.h config_cxx.h config_dll.h \
|
||||
config_int.h config_misc.h config_ns.h config_os.h config_ver.h cpu.h \
|
||||
crc.h cryptlib.h darn.h default.h des.h dh.h dh2.h dll.h dmac.h donna.h \
|
||||
donna_32.h donna_64.h donna_sse.h drbg.h dsa.h eax.h ec2n.h eccrypto.h \
|
||||
ecp.h ecpoint.h elgamal.h emsa2.h eprecomp.h esign.h fhmqv.h files.h \
|
||||
filters.h fips140.h fltrimpl.h gcm.h gf256.h gf2_32.h gf2n.h gfpcrypt.h \
|
||||
gost.h gzip.h hashfwd.h hc128.h hc256.h hex.h hight.h hkdf.h hmac.h \
|
||||
hmqv.h hrtimer.h ida.h idea.h integer.h iterhash.h kalyna.h keccak.h \
|
||||
lea.h local.h lubyrack.h luc.h mars.h md2.h md4.h md5.h mdc.h \
|
||||
mersenne.h misc.h modarith.h modes.h modexppc.h mqueue.h mqv.h \
|
||||
naclite.h nbtheory.h nr.h oaep.h oids.h osrng.h ossig.h padlkrng.h \
|
||||
panama.h pch.h pkcspad.h poly1305.h polynomi.h ppc_simd.h pssr.h \
|
||||
pubkey.h pwdbased.h queue.h rabbit.h rabin.h randpool.h rc2.h rc5.h \
|
||||
rc6.h rdrand.h rijndael.h ripemd.h rng.h rsa.h rw.h safer.h salsa.h \
|
||||
scrypt.h seal.h secblock.h secblockfwd.h seckey.h seed.h serpent.h \
|
||||
serpentp.h sha.h sha3.h shacal2.h shake.h shark.h simeck.h simon.h \
|
||||
simple.h siphash.h skipjack.h sm3.h sm4.h smartptr.h sosemanuk.h \
|
||||
speck.h square.h stdcpp.h strciphr.h tea.h threefish.h tiger.h trap.h \
|
||||
trunhash.h ttmac.h tweetnacl.h twofish.h vmac.h wake.h whrlpool.h \
|
||||
words.h xed25519.h xtr.h xtrcrypt.h xts.h zdeflate.h zinflate.h zlib.h
|
||||
|
||||
noinst_HEADERS = \
|
||||
local.h \
|
||||
bench.h \
|
||||
factory.h \
|
||||
resource.h \
|
||||
validate.h \
|
||||
aes_armv4.h \
|
||||
sha1_armv4.h \
|
||||
sha256_armv4.h \
|
||||
sha512_armv4.h
|
||||
|
||||
bin_PROGRAMS = cryptest$(EXEEXT)
|
||||
|
||||
cryptest_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTEST_CXXFLAGS) -DCRYPTOPP_DATA_DIR='"${pkgdatadir}/"'
|
||||
cryptest_SOURCES = \
|
||||
test.cpp bench1.cpp bench2.cpp bench3.cpp datatest.cpp \
|
||||
dlltest.cpp fipsalgt.cpp validat0.cpp validat1.cpp validat2.cpp \
|
||||
validat3.cpp validat4.cpp validat5.cpp validat6.cpp validat7.cpp \
|
||||
validat8.cpp validat9.cpp validat10.cpp regtest1.cpp regtest2.cpp \
|
||||
regtest3.cpp regtest4.cpp
|
||||
|
||||
nodist_cryptest_SOURCES = adhoc.cpp
|
||||
cryptest_LDADD = $(lib_LTLIBRARIES)
|
||||
|
||||
CLEANFILES = adhoc.cpp
|
||||
|
||||
## Copy the TestVectors/ and TestData/ to ${pkgdatadir}.
|
||||
## TestPrograms/ is included in the tarball but not installed.
|
||||
## https://www.gnu.org/software/automake/manual/html_node/Data.html
|
||||
|
||||
# Create with 'ls TestVectors/*.dat'. These files get installed.
|
||||
testdata_FILES = \
|
||||
TestData/3desval.dat TestData/fhmqv160.dat TestData/rc2val.dat \
|
||||
TestData/3wayval.dat TestData/fhmqv256.dat TestData/rc5val.dat \
|
||||
TestData/aria.dat TestData/fhmqv384.dat TestData/rc6val.dat \
|
||||
TestData/camellia.dat TestData/fhmqv512.dat TestData/rijndael.dat \
|
||||
TestData/cast128v.dat TestData/gostval.dat TestData/rsa1024.dat \
|
||||
TestData/cast256v.dat TestData/hmqv160.dat TestData/rsa2048a.dat \
|
||||
TestData/defdmac1.bin TestData/hmqv256.dat TestData/rsa2048.dat \
|
||||
TestData/defdmac2.bin TestData/hmqv384.dat TestData/rsa400pb.dat \
|
||||
TestData/descert.dat TestData/hmqv512.dat TestData/rsa400pv.dat \
|
||||
TestData/dh1024.dat TestData/ideaval.dat TestData/rsa512a.dat \
|
||||
TestData/dh2048.dat TestData/luc1024.dat TestData/rw1024.dat \
|
||||
TestData/dlie1024.dat TestData/luc2048.dat TestData/rw2048.dat \
|
||||
TestData/dlie2048.dat TestData/lucc1024.dat TestData/saferval.dat \
|
||||
TestData/dsa1024b.dat TestData/lucc512.dat TestData/serpentv.dat \
|
||||
TestData/dsa1024.dat TestData/lucd1024.dat TestData/shacal2v.dat \
|
||||
TestData/dsa512.dat TestData/lucd512.dat TestData/sharkval.dat \
|
||||
TestData/ecies_p160.dat TestData/lucs1024.dat TestData/skipjack.dat \
|
||||
TestData/ecies_t163.dat TestData/lucs512.dat TestData/squareva.dat \
|
||||
TestData/ed25519.dat TestData/marsval.dat TestData/twofishv.dat \
|
||||
TestData/ed25519v0.dat TestData/mqv1024.dat TestData/usage.dat \
|
||||
TestData/ed25519v1.dat TestData/mqv2048.dat TestData/x25519.dat \
|
||||
TestData/elgc1024.dat TestData/nr1024.dat TestData/x25519v0.dat \
|
||||
TestData/esig1023.dat TestData/nr2048.dat TestData/x25519v1.dat \
|
||||
TestData/esig1536.dat TestData/rabi1024.dat TestData/xtrdh171.dat \
|
||||
TestData/esig2046.dat TestData/rabi2048.dat TestData/xtrdh342.dat
|
||||
|
||||
# Create with 'ls TestVectors/*.txt'. These files get installed.
|
||||
testvector_FILES = \
|
||||
TestVectors/aead.txt TestVectors/rsa_pss.txt \
|
||||
TestVectors/aes.txt TestVectors/rw.txt \
|
||||
TestVectors/all.txt TestVectors/salsa.txt \
|
||||
TestVectors/aria.txt TestVectors/seal.txt \
|
||||
TestVectors/blake2b.txt TestVectors/seed.txt \
|
||||
TestVectors/blake2s.txt TestVectors/sha1_160_fips_180.txt \
|
||||
TestVectors/blake2.txt TestVectors/sha1_fips_180.txt \
|
||||
TestVectors/camellia.txt TestVectors/sha2_224_fips_180.txt \
|
||||
TestVectors/ccm.txt TestVectors/sha2_256_fips_180.txt \
|
||||
TestVectors/chacha20poly1305.txt TestVectors/sha2_384_fips_180.txt \
|
||||
TestVectors/chacha_tls.txt TestVectors/sha2_512_fips_180.txt \
|
||||
TestVectors/chacha.txt TestVectors/sha2_fips_180.txt \
|
||||
TestVectors/cham.txt TestVectors/sha2.txt \
|
||||
TestVectors/cmac.txt TestVectors/sha3_224_fips_202.txt \
|
||||
TestVectors/dlies.txt TestVectors/sha3_256_fips_202.txt \
|
||||
TestVectors/dsa_1363.txt TestVectors/sha3_384_fips_202.txt \
|
||||
TestVectors/dsa_rfc6979.txt TestVectors/sha3_512_fips_202.txt \
|
||||
TestVectors/dsa.txt TestVectors/sha3_fips_202.txt \
|
||||
TestVectors/eax.txt TestVectors/sha3.txt \
|
||||
TestVectors/esign.txt TestVectors/shacal2.txt \
|
||||
TestVectors/gcm.txt TestVectors/shake.txt \
|
||||
TestVectors/hc128.txt TestVectors/sha.txt \
|
||||
TestVectors/hc256.txt TestVectors/simeck.txt \
|
||||
TestVectors/hight.txt TestVectors/simon.txt \
|
||||
TestVectors/hkdf.txt TestVectors/siphash.txt \
|
||||
TestVectors/hmac.txt TestVectors/skipjack.txt \
|
||||
TestVectors/kalyna.txt TestVectors/sm3.txt \
|
||||
TestVectors/keccak.txt TestVectors/sm4.txt \
|
||||
TestVectors/lea.txt TestVectors/sosemanuk.txt \
|
||||
TestVectors/mars.txt TestVectors/speck.txt \
|
||||
TestVectors/nr.txt TestVectors/tea.txt \
|
||||
TestVectors/panama.txt TestVectors/threefish.txt \
|
||||
TestVectors/poly1305aes.txt TestVectors/ttmac.txt \
|
||||
TestVectors/poly1305_tls.txt TestVectors/vmac.txt \
|
||||
TestVectors/rabbit.txt TestVectors/wake.txt \
|
||||
TestVectors/Readme.txt TestVectors/whrlpool.txt \
|
||||
TestVectors/rsa_oaep.txt TestVectors/xchacha.txt \
|
||||
TestVectors/rsa_pkcs1_1_5.txt TestVectors/xts.txt
|
||||
|
||||
# Create with 'ls TestPrograms/test_*.cxx'. These files do not get installed.
|
||||
# They exist so the feature tests can be run from the configure directory.
|
||||
testprogs_FILES= \
|
||||
TestPrograms/test_32bit.cxx
|
||||
TestPrograms/test_64bit.cxx
|
||||
TestPrograms/test_arm_acle_header.cxx
|
||||
TestPrograms/test_arm_aes.cxx
|
||||
TestPrograms/test_arm_asimd.cxx
|
||||
TestPrograms/test_arm_crc.cxx
|
||||
TestPrograms/test_arm_neon.cxx
|
||||
TestPrograms/test_arm_neon_header.cxx
|
||||
TestPrograms/test_arm_pmull.cxx
|
||||
TestPrograms/test_arm_sha1.cxx
|
||||
TestPrograms/test_arm_sha256.cxx
|
||||
TestPrograms/test_arm_sha3.cxx
|
||||
TestPrograms/test_arm_sha512.cxx
|
||||
TestPrograms/test_arm_sm3.cxx
|
||||
TestPrograms/test_arm_sm4.cxx
|
||||
TestPrograms/test_asm_mixed.cxx
|
||||
TestPrograms/test_cxx11_alignas.cxx
|
||||
TestPrograms/test_cxx11_alignof.cxx
|
||||
TestPrograms/test_cxx11_assert.cxx
|
||||
TestPrograms/test_cxx11_atomic.cxx
|
||||
TestPrograms/test_cxx11_auto.cxx
|
||||
TestPrograms/test_cxx11_constexpr.cxx
|
||||
TestPrograms/test_cxx11.cxx
|
||||
TestPrograms/test_cxx11_deletefn.cxx
|
||||
TestPrograms/test_cxx11_enumtype.cxx
|
||||
TestPrograms/test_cxx11_initializer.cxx
|
||||
TestPrograms/test_cxx11_lambda.cxx
|
||||
TestPrograms/test_cxx11_noexcept.cxx
|
||||
TestPrograms/test_cxx11_nullptr.cxx
|
||||
TestPrograms/test_cxx11_staticinit.cxx
|
||||
TestPrograms/test_cxx11_sync.cxx
|
||||
TestPrograms/test_cxx11_vartemplates.cxx
|
||||
TestPrograms/test_cxx14.cxx
|
||||
TestPrograms/test_cxx17_assert.cxx
|
||||
TestPrograms/test_cxx17.cxx
|
||||
TestPrograms/test_cxx17_exceptions.cxx
|
||||
TestPrograms/test_cxx98_exception.cxx
|
||||
TestPrograms/test_cxx.cxx
|
||||
TestPrograms/test_glibc.cxx
|
||||
TestPrograms/test_newlib.cxx
|
||||
TestPrograms/test_ppc_aes.cxx
|
||||
TestPrograms/test_ppc_altivec.cxx
|
||||
TestPrograms/test_ppc_power7.cxx
|
||||
TestPrograms/test_ppc_power8.cxx
|
||||
TestPrograms/test_ppc_power9.cxx
|
||||
TestPrograms/test_ppc_sha.cxx
|
||||
TestPrograms/test_ppc_vmull.cxx
|
||||
TestPrograms/test_pthreads.cxx
|
||||
TestPrograms/test_x86_aes.cxx
|
||||
TestPrograms/test_x86_avx2.cxx
|
||||
TestPrograms/test_x86_avx512.cxx
|
||||
TestPrograms/test_x86_avx.cxx
|
||||
TestPrograms/test_x86_clmul.cxx
|
||||
TestPrograms/test_x86_cpuid.cxx
|
||||
TestPrograms/test_x86_rdrand.cxx
|
||||
TestPrograms/test_x86_rdseed.cxx
|
||||
TestPrograms/test_x86_sha.cxx
|
||||
TestPrograms/test_x86_sse2.cxx
|
||||
TestPrograms/test_x86_sse3.cxx
|
||||
TestPrograms/test_x86_sse41.cxx
|
||||
TestPrograms/test_x86_sse42.cxx
|
||||
TestPrograms/test_x86_ssse3.cxx
|
||||
TestPrograms/test_x86_via_aes.cxx
|
||||
TestPrograms/test_x86_via_rng.cxx
|
||||
TestPrograms/test_x86_via_sha.cxx
|
||||
|
||||
nobase_dist_pkgdata_DATA = \
|
||||
$(testdata_FILES) \
|
||||
$(testvector_FILES)
|
||||
|
||||
# Can't seem to get this to work, despite the fiddling attempts.
|
||||
# https://www.gnu.org/software/automake/manual/html_node/Uniform.html and
|
||||
# https://www.gnu.org/software/automake/manual/html_node/Program-and-Library-Variables.html
|
||||
#nobase_noinst_data_DATA = \
|
||||
# $(testprogs_FILES)
|
||||
|
||||
# Workaround Automake bug. We can't seem to include the TestProgram/ data
|
||||
# in the tarball without installation using their Uniform Naming Scheme
|
||||
# https://www.gnu.org/software/automake/manual/html_node/Uniform.html and
|
||||
# https://www.gnu.org/software/automake/manual/html_node/Program-and-Library-Variables.html
|
||||
dist-hook:
|
||||
chmod -R u+w $(distdir)
|
||||
cp -r TestPrograms/ $(distdir)
|
||||
rm -f $(distdir)/TestPrograms/dump2def.cxx
|
||||
|
||||
## Automake bug workaround. If libcryptopp_la_SOURCES is an empty list, Automake assumes
|
||||
## C source files and drives link through the C compiler. We provide the empty adhoc.cpp
|
||||
## to get things back on course, so adhoc.cpp must always be copied.
|
||||
|
||||
adhoc.cpp:
|
||||
cp adhoc.cpp.proto adhoc.cpp
|
||||
touch adhoc.cpp
|
||||
|
||||
## Remove doc directory if present
|
||||
distclean-local:
|
||||
-rm -rf html-docs doxyfile.stamp
|
||||
|
||||
## Automake does not properly uninstall the library test data and vectors
|
||||
uninstall-hook:
|
||||
-rm -rf ${pkgdatadir}
|
||||
-rm -rf ${pkghtmldir}
|
||||
|
||||
## Doxygen is available but not built by default
|
||||
## TODO: copy docs to ${pkghtmldir} if built
|
||||
if CRYPTOPP_DOXYGEN_AVAILABLE
|
||||
|
||||
## PHONY targets. Automake can only handle one of them...
|
||||
.PHONY: doc docs html htmldoc checkout reset
|
||||
|
||||
doc docs html htmldoc:
|
||||
$(DOXYGEN) Doxyfile -d CRYPTOPP_DOXYGEN_PROCESSING
|
||||
|
||||
endif
|
||||
|
||||
# Restore GNUmakefile
|
||||
checkout:
|
||||
git checkout master -f
|
||||
|
||||
# Restore GNUmakefile
|
||||
reset:
|
||||
git reset --hard HEAD
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,31 +0,0 @@
|
||||
## libcryptopp.pc.in - Autotools package configuration file for Crypto++.
|
||||
## written and placed in public domain by Jeffrey Walton.
|
||||
## based on Debian package configuration by László Böszörményi.
|
||||
##
|
||||
|
||||
## libdir=@libdir@ is not working as expected for Fedora, Solaris,
|
||||
## and other 64-bit OSes that use library directories like /lib64,
|
||||
## /usr/lib64, /lib/amd64 and friends. Also see:
|
||||
## * https://stackoverflow.com/q/47124066/608639
|
||||
## * https://stackoverflow.com/q/46847939/608639 and
|
||||
## * https://bugzilla.redhat.com/show_bug.cgi?id=1510073.
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: @PACKAGE_NAME@
|
||||
Description: free C++ class library of cryptographic schemes
|
||||
Authors: originally written by Wei Dai
|
||||
Maintainers: the Crypto++ community
|
||||
URL: @PACKAGE_URL@
|
||||
Version: @PACKAGE_VERSION@
|
||||
Bug-Report: @PACKAGE_BUGREPORT@
|
||||
Requires:
|
||||
|
||||
## These flags are mostly broken. We cannot record user choices,
|
||||
## and then have user programs use the same flags later.
|
||||
## https://lists.freedesktop.org/archives/pkg-config/2017-November/001087.html
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lcryptopp
|
||||
@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=microsocks
|
||||
PKG_VERSION=1.0.2
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/rofl0r/microsocks/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=5ece77c283e71f73b9530da46302fdb4f72a0ae139aa734c07fe532407a6211a
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_MAINTAINER:=lean
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/microsocks
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=tiny, portable SOCKS5 server with very moderate resource usage
|
||||
URL:=https://github.com/rofl0r/microsocks
|
||||
DEPENDS:=+libpthread
|
||||
endef
|
||||
|
||||
define Package/microsocks/description
|
||||
A SOCKS5 service that you can run on your remote boxes to tunnel connections
|
||||
through them, if for some reason SSH doesn't cut it for you.
|
||||
endef
|
||||
|
||||
define Package/microsocks/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/microsocks $(1)/usr/bin/microsocks
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,microsocks))
|
||||
@ -1,88 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 - ntop.org and contributors
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=n2n
|
||||
PKG_VERSION:=2.8
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ntop/n2n/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=ad9ab95a79dcf6b412c36489f50de54bb54417b5cea854eb54722b6cb8f0fd04
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Emanuele Faranda <faranda@ntop.org>
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/n2n/template
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=VPN
|
||||
TITLE:=N2N Peer-to-peer VPN
|
||||
URL:=http://www.ntop.org/n2n
|
||||
endef
|
||||
|
||||
define Package/n2n-edge
|
||||
$(call Package/n2n/template)
|
||||
TITLE+= client (edge node)
|
||||
DEPENDS+=+kmod-tun +resolveip +libopenssl +libcap +libzstd
|
||||
endef
|
||||
|
||||
define Package/n2n-supernode
|
||||
$(call Package/n2n/template)
|
||||
TITLE+= server (supernode)
|
||||
DEPENDS+=+libcap
|
||||
endef
|
||||
|
||||
define Package/n2n-edge/description
|
||||
The client node for the N2N infrastructure
|
||||
endef
|
||||
|
||||
define Package/n2n-supernode/description
|
||||
The supernode for the N2N infrastructure
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
( cd $(PKG_BUILD_DIR); ./autogen.sh )
|
||||
$(call Build/Configure/Default)
|
||||
endef
|
||||
|
||||
define Package/n2n-edge/conffiles
|
||||
/etc/config/n2n-edge.conf
|
||||
endef
|
||||
|
||||
define Package/n2n-supernode/conffiles
|
||||
/etc/config/n2n-supernode.conf
|
||||
endef
|
||||
|
||||
define Package/n2n-edge/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/edge $(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/n2n_v2.config $(1)/etc/config/n2n_v2
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/n2n_v2.init $(1)/etc/init.d/n2n_v2
|
||||
endef
|
||||
|
||||
define Package/n2n-supernode/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/supernode $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,n2n-edge))
|
||||
$(eval $(call BuildPackage,n2n-supernode))
|
||||
@ -1,22 +0,0 @@
|
||||
config edge
|
||||
option enabled '0'
|
||||
option tunname 'n2n0'
|
||||
option mode 'static'
|
||||
option ipaddr '10.0.0.100'
|
||||
option prefix '24'
|
||||
option mtu '1290'
|
||||
option supernode '1.2.3.4'
|
||||
option port '1234'
|
||||
option community 'example'
|
||||
option key 'password'
|
||||
option route '1'
|
||||
|
||||
config supernode
|
||||
option enabled '0'
|
||||
option port '1235'
|
||||
|
||||
config route
|
||||
option enabled '0'
|
||||
option ip '192.168.2.0'
|
||||
option mask '24'
|
||||
option gw '10.0.0.200'
|
||||
@ -1,91 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2008-2020 OpenWrt.org
|
||||
|
||||
START=99
|
||||
|
||||
start_instance() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get type "$cfg" TYPE
|
||||
|
||||
case "$type" in
|
||||
edge)
|
||||
config_get_bool enabled "$cfg" 'enabled' '0'
|
||||
[ "$enabled" = "0" ] && return 1
|
||||
config_get tunname "$cfg" 'tunname'
|
||||
config_get mode "$cfg" 'mode'
|
||||
config_get ipaddr "$cfg" 'ipaddr'
|
||||
config_get prefix "$cfg" 'prefix'
|
||||
config_get mtu "$cfg" 'mtu'
|
||||
config_get supernode "$cfg" 'supernode'
|
||||
config_get port "$cfg" 'port'
|
||||
config_get second_supernode "$cfg" 'second_supernode'
|
||||
config_get second_port "$cfg" 'second_port'
|
||||
config_get community "$cfg" 'community'
|
||||
config_get key "$cfg" 'key'
|
||||
config_get_bool route "$cfg" 'route' '0'
|
||||
address="$ipaddr"
|
||||
supernode_bak=""
|
||||
[ "$second_supernode" -a "$second_port" ] && supernode_bak=" -l ${second_supernode}:${second_port}"
|
||||
[ "$route" = "1" ] && args='-r'
|
||||
[ "$mode" = 'dhcp' ] && address='0.0.0.0'
|
||||
[ "-$mtu" != "-" ] && mtu="-M $mtu"
|
||||
eval "$(ipcalc.sh "$ipaddr/$prefix")"
|
||||
netmask="$NETMASK"
|
||||
/usr/bin/edge -u 0 -g 0 -d $tunname -a ${mode}:${address} -s $netmask -c $community $([ -n "$key" ] && echo -k $key) -l ${supernode}:${port}$supernode_bak $args $mtu
|
||||
iptables -I FORWARD -i "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth'
|
||||
iptables -I FORWARD -o "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth'
|
||||
iptables -t nat -I POSTROUTING -o "$tunname" -j MASQUERADE -m comment --comment 'n2n edge net'
|
||||
;;
|
||||
supernode)
|
||||
config_get_bool enabled "$cfg" 'enabled' '0'
|
||||
[ "$enabled" = "0" ] && return 1
|
||||
config_get port "$cfg" 'port'
|
||||
/usr/bin/supernode -l $port &
|
||||
iptables -I INPUT -p udp --dport $port -j ACCEPT -m comment --comment 'n2n supernode port'
|
||||
;;
|
||||
route)
|
||||
config_get_bool enabled "$cfg" 'enabled' '0'
|
||||
[ "$enabled" = "0" ] && return 1
|
||||
config_get ip "$cfg" 'ip'
|
||||
config_get mask "$cfg" 'mask'
|
||||
config_get gw "$cfg" 'gw'
|
||||
route add -net $ip/$mask gw $gw
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
stop_instance() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get type "$cfg" TYPE
|
||||
|
||||
case "$type" in
|
||||
edge)
|
||||
config_get tunname "$cfg" 'tunname'
|
||||
iptables -D FORWARD -i "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth' 2>/dev/null
|
||||
iptables -D FORWARD -o "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth' 2>/dev/null
|
||||
iptables -t nat -D POSTROUTING -o "$tunname" -j MASQUERADE -m comment --comment 'n2n edge net' 2>/dev/null
|
||||
killall -9 edge
|
||||
;;
|
||||
supernode)
|
||||
config_get port "$cfg" 'port'
|
||||
iptables -D INPUT -p udp --dport $port -j ACCEPT -m comment --comment 'n2n supernode port' 2>/dev/null
|
||||
ps | grep supernode | grep -v grep 2>&1 >/dev/null && killall -9 supernode
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
start() {
|
||||
config_load 'n2n_v2'
|
||||
config_foreach start_instance 'edge'
|
||||
config_foreach start_instance 'supernode'
|
||||
sleep 2
|
||||
config_foreach start_instance 'route'
|
||||
}
|
||||
|
||||
stop() {
|
||||
config_load 'n2n_v2'
|
||||
config_foreach stop_instance 'edge'
|
||||
config_foreach stop_instance 'supernode'
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=pandownload-fake-server
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/pandownload-fake-server
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Download Manager
|
||||
TITLE:=pandownload-fake-server
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/pandownload-fake-server/description
|
||||
Fake server for Pandownload.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/pandownload-fake-server/install
|
||||
$(INSTALL_DIR) $(1)/www
|
||||
$(CP) ./files/* $(1)/www/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,pandownload-fake-server))
|
||||
@ -1 +0,0 @@
|
||||
{"srecord":{"autoQuery":true},"loginurl":{"url":"http:\/\/pandownload.com\/bdlogin.html"},"wke":"http:\/\/dl.pandownload.club\/dl\/node-190312.dll","pcscfg":{"appid":250528,"ua":"","ct":0},"flag":1,"ad":{"url":"https:\/\/pandownload.com\/donate.html","image":"http:\/\/pandownload.com\/images\/donate.png","attribute":"width=\"88\" height=\"100\" padding=\"0,0,5,0\"","rand":100},"bdc":["aF5yaHQQfQt3E3lxdHdjVmF4f3hae3JsfFxIbGxbW152FHF0anpdW3R5UHR1H1hxdwdoTGRMcXR1THsRbF92XXJbdmpveF93Yl9TE3dod3tYaXYIc1oRXGZKbVR1aGkGcV57dmleen1wEAYEdnV9BXF3BQFxd3sCaGh2BHB0BgdpW3F2c3pbAXF3ewJoaAYEcHQGBHZ1fQVxdwUBcXd7AmhoBgRwdAYEdnV9BXF3BQFxd3sCaGgGBHB0BgR2dX0FcXcFAXF3ewJoaAYEcHQGBHZ1fQVxdwUBcXd7AmhoBgRwdAYEdnV9BXF3BQFxd3sCaGgGBHB0BgRpB21SYXYFFH0UDmpben5afkgCdmsFAH9ydxMIflxqEnUHWxVpdgUTcwdsTH0UcBBpdndddV1+XWh2altzWlpLaVxbWH1cXEh1XWMXfAZ5FnR0fV99aXlcagZrWHUHaRZ9EXVJcnRTXH1MYhB9BlFddVoNDw=="],"timestamp":1586998638,"code":0,"message":"success"}
|
||||
@ -1 +0,0 @@
|
||||
{"version":"2.2.2","url":"https:\/\/dl1.cnponer.com\/files\/PanDownload_v2.2.2.zip","web":"https:\/\/www.lanzous.com\/i8ua9na","detail":"\u66f4\u65b0\u65f6\u95f4: 2020-01-24\n\u66f4\u65b0\u5185\u5bb9:\n1. \u754c\u9762\u4f18\u5316\n2. bug\u4fee\u590d","md5":"13d3da755509afe3be8f7fc191a50cbd","code":0,"message":"success"}
|
||||
@ -1 +0,0 @@
|
||||
{"scripts":[{"name":"search_pandown.lua","remove":true},{"name":"search_ncckl.lua","remove":true},{"name":"search_quzhuanpan.lua","remove":true},{"name":"anime_01.lua","remove":true},{"name":"anime_02.lua","remove":true},{"name":"anime_dilidili.lua","remove":true},{"name":"anime","remove":true},{"name":"s","id":2,"url":"http:\/\/pandownload.com\/static\/scripts\/s008","md5":"8dfd9a6c08d06bec27ae358f315cca8f"},{"name":"download_pcs.lua","id":1000,"url":"http:\/\/pandownload.com\/static\/scripts\/download_pcs.lua","md5":"38770cd3e9bcd62f7212941b51ca1378"},{"name":"default","id":0,"url":"http:\/\/pandownload.com\/static\/scripts\/default_0.6.7_3fee3733","md5":"a1124f076924209d0322078000cdc882","key":"568729a30cee34aec0e6fc7a6e303272"}],"code":0,"message":"success"}
|
||||
@ -1,60 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=pdnsd
|
||||
PKG_VERSION:=1.2.9b-par
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/shadowsocks/pdnsd.git
|
||||
PKG_SOURCE_DATE:=2012-04-26
|
||||
PKG_SOURCE_VERSION:=a8e46ccba7b0fa2230d6c42ab6dcd92926f6c21d
|
||||
PKG_MIRROR_HASH:=e3e9c56cf91b12d8db73def2c247be2f726a052bed012f7a1e48946375f8e478
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/pdnsd-alt
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
DEPENDS:=+libpthread
|
||||
TITLE:=Proxy DNS Server
|
||||
endef
|
||||
|
||||
define Package/pdnsd-alt/description
|
||||
pdnsd, is an IPv6 capable proxy DNS server with permanent caching (the cache
|
||||
contents are written to hard disk on exit) that is designed to cope with
|
||||
unreachable or down DNS servers (for example in dial-in networking).
|
||||
|
||||
pdnsd can be used with applications that do dns lookups, eg on startup, and
|
||||
can't be configured to change that behaviour, to prevent the often
|
||||
minute-long hangs (or even crashes) that result from stalled dns queries.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--with-cachedir=/var/pdnsd \
|
||||
--with-target=Linux
|
||||
|
||||
define Package/pdnsd-alt/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pdnsd $(1)/usr/sbin/pdnsd
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pdnsd-ctl $(1)/usr/sbin/pdnsd-ctl
|
||||
|
||||
#$(INSTALL_DIR) $(1)/etc
|
||||
#$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/pdnsd.conf.sample $(1)/etc/pdnsd.conf
|
||||
#$(INSTALL_DIR) $(1)/etc/init.d
|
||||
#$(INSTALL_BIN) ./files/pdnsd.init $(1)/etc/init.d/pdnsd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,pdnsd-alt))
|
||||
@ -1,46 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=65
|
||||
NAME=pdnsd
|
||||
DESC="proxy DNS server"
|
||||
|
||||
DAEMON=/usr/sbin/pdnsd
|
||||
PID_FILE=/var/run/$NAME.pid
|
||||
CACHEDIR=/var/pdnsd
|
||||
CACHE=$CACHEDIR/pdnsd.cache
|
||||
|
||||
USER=nobody
|
||||
GROUP=nogroup
|
||||
|
||||
start() {
|
||||
echo -n "Starting $DESC: $NAME"
|
||||
|
||||
gen_cache
|
||||
|
||||
$DAEMON --daemon -p $PID_FILE
|
||||
echo " ."
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n "Stopping $DESC: $NAME"
|
||||
kill `cat $PID_FILE` > /dev/null 2>&1
|
||||
rm -rf $PID_FILE
|
||||
echo " ."
|
||||
}
|
||||
|
||||
restart() {
|
||||
echo "Restarting $DESC: $NAME... "
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
}
|
||||
|
||||
gen_cache()
|
||||
{
|
||||
if ! test -f "$CACHE"; then
|
||||
mkdir -p `dirname $CACHE`
|
||||
dd if=/dev/zero of="$CACHE" bs=1 count=4 2> /dev/null
|
||||
chown -R $USER.$GROUP $CACHEDIR
|
||||
fi
|
||||
}
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2011-2015 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:=polarssl
|
||||
PKG_VERSION:=1.3.22
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_NAME:=mbedtls
|
||||
PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION)-gpl.tgz
|
||||
PKG_SOURCE_URL:=https://tls.mbed.org/download/
|
||||
PKG_HASH:=ded041aa4acf9a3e4d0c85bf334b0860135da996e75afdcc3abf22f403d14457
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/libpolarssl
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=SSL
|
||||
TITLE:=Embedded SSL
|
||||
URL:=http://polarssl.org/
|
||||
ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
endef
|
||||
|
||||
define Package/libpolarssl/description
|
||||
The aim of the PolarSSL project is to provide a quality, open-source
|
||||
cryptographic library written in C and targeted at embedded systems.
|
||||
|
||||
This package contains the PolarSSL library.
|
||||
endef
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DCMAKE_BUILD_TYPE:String="Release" \
|
||||
-DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \
|
||||
-DENABLE_TESTING:Bool=OFF \
|
||||
-DENABLE_PROGRAMS:Bool=OFF \
|
||||
|
||||
define Build/InstallDev
|
||||
$(Build/InstallDev/cmake)
|
||||
$(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so
|
||||
endef
|
||||
|
||||
define Package/libpolarssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbedtls.so.* $(1)/usr/lib/
|
||||
$(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libpolarssl))
|
||||
@ -1,252 +0,0 @@
|
||||
--- a/include/polarssl/config.h
|
||||
+++ b/include/polarssl/config.h
|
||||
@@ -441,8 +441,8 @@
|
||||
* Requires: POLARSSL_HMAC_DRBG_C
|
||||
*
|
||||
* Comment this macro to disable deterministic ECDSA.
|
||||
- */
|
||||
#define POLARSSL_ECDSA_DETERMINISTIC
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
|
||||
@@ -463,8 +463,8 @@
|
||||
* TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_PSK_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
|
||||
@@ -487,8 +487,8 @@
|
||||
* TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_DHE_PSK_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
||||
@@ -507,8 +507,8 @@
|
||||
* TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_ECDHE_PSK_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
|
||||
@@ -532,8 +532,8 @@
|
||||
* TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_RSA_PSK_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
|
||||
@@ -611,8 +611,8 @@
|
||||
* TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_ECDHE_RSA_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
||||
@@ -635,8 +635,8 @@
|
||||
* TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
||||
@@ -659,8 +659,8 @@
|
||||
* TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
|
||||
* TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED
|
||||
@@ -683,8 +683,8 @@
|
||||
* TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
|
||||
* TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_PK_PARSE_EC_EXTENDED
|
||||
@@ -844,8 +844,8 @@
|
||||
* \def POLARSSL_SELF_TEST
|
||||
*
|
||||
* Enable the checkup functions (*_self_test).
|
||||
- */
|
||||
#define POLARSSL_SELF_TEST
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_SSL_ALL_ALERT_MESSAGES
|
||||
@@ -1148,8 +1148,8 @@
|
||||
* Requires: POLARSSL_VERSION_C
|
||||
*
|
||||
* Comment this to disable run-time checking and save ROM space
|
||||
- */
|
||||
#define POLARSSL_VERSION_FEATURES
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3
|
||||
@@ -1483,8 +1483,8 @@
|
||||
* TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
|
||||
* TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
- */
|
||||
#define POLARSSL_CAMELLIA_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_CCM_C
|
||||
@@ -1511,8 +1511,8 @@
|
||||
* Requires: POLARSSL_PEM_PARSE_C
|
||||
*
|
||||
* This module is used for testing (ssl_client/server).
|
||||
- */
|
||||
#define POLARSSL_CERTS_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_CIPHER_C
|
||||
@@ -1551,8 +1551,8 @@
|
||||
* library/ssl_tls.c
|
||||
*
|
||||
* This module provides debugging functions.
|
||||
- */
|
||||
#define POLARSSL_DEBUG_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_DES_C
|
||||
@@ -1610,8 +1610,8 @@
|
||||
* ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
|
||||
*
|
||||
* Requires: POLARSSL_ECP_C
|
||||
- */
|
||||
#define POLARSSL_ECDH_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_ECDSA_C
|
||||
@@ -1625,8 +1625,8 @@
|
||||
* ECDHE-ECDSA
|
||||
*
|
||||
* Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
|
||||
- */
|
||||
#define POLARSSL_ECDSA_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_ECP_C
|
||||
@@ -1638,8 +1638,8 @@
|
||||
* library/ecdsa.c
|
||||
*
|
||||
* Requires: POLARSSL_BIGNUM_C and at least one POLARSSL_ECP_DP_XXX_ENABLED
|
||||
- */
|
||||
#define POLARSSL_ECP_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_ENTROPY_C
|
||||
@@ -1678,8 +1678,8 @@
|
||||
*
|
||||
* This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
|
||||
* requisites are enabled as well.
|
||||
- */
|
||||
#define POLARSSL_GCM_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_HAVEGE_C
|
||||
@@ -1715,8 +1715,8 @@
|
||||
* Requires: POLARSSL_MD_C
|
||||
*
|
||||
* Uncomment to enable the HMAC_DRBG random number geerator.
|
||||
- */
|
||||
#define POLARSSL_HMAC_DRBG_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_MD_C
|
||||
@@ -1859,8 +1859,8 @@
|
||||
* Requires: POLARSSL_HAVE_ASM
|
||||
*
|
||||
* This modules adds support for the VIA PadLock on x86.
|
||||
- */
|
||||
#define POLARSSL_PADLOCK_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_PBKDF2_C
|
||||
@@ -2025,8 +2025,8 @@
|
||||
* Module: library/ripemd160.c
|
||||
* Caller: library/md.c
|
||||
*
|
||||
- */
|
||||
#define POLARSSL_RIPEMD160_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_RSA_C
|
||||
@@ -2110,8 +2110,8 @@
|
||||
* Caller:
|
||||
*
|
||||
* Requires: POLARSSL_SSL_CACHE_C
|
||||
- */
|
||||
#define POLARSSL_SSL_CACHE_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_SSL_CLI_C
|
||||
@@ -2187,8 +2187,8 @@
|
||||
* Caller: library/havege.c
|
||||
*
|
||||
* This module is used by the HAVEGE random number generator.
|
||||
- */
|
||||
#define POLARSSL_TIMING_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_VERSION_C
|
||||
@@ -2198,8 +2198,8 @@
|
||||
* Module: library/version.c
|
||||
*
|
||||
* This module provides run-time version information.
|
||||
- */
|
||||
#define POLARSSL_VERSION_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_X509_USE_C
|
||||
@@ -2308,8 +2308,8 @@
|
||||
*
|
||||
* Module: library/xtea.c
|
||||
* Caller:
|
||||
- */
|
||||
#define POLARSSL_XTEA_C
|
||||
+ */
|
||||
|
||||
/* \} name SECTION: mbed TLS modules */
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ps3netsrv
|
||||
PKG_VERSION:=20200610
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/jhonathanc/ps3netsrv/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=e456a8edbca7cac95b5396cab71c9bba26e5c838fe4751fffe12b483b5bb4030
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_MAINTAINER:=JCorrea
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ps3netsrv
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=File Transfer
|
||||
TITLE:=PS3 Game Server
|
||||
URL:=https://github.com/jhonathanc/ps3netsrv-openwrt
|
||||
DEPENDS:=+libpthread +libstdcpp
|
||||
endef
|
||||
|
||||
define Package/ps3netsrv/description
|
||||
ps3netsrv allows you to stream games and ISOs over the network to your CFW PlayStation(R) 3 system.
|
||||
This may be useful if you have a modified PS3, and your router has storage options.
|
||||
endef
|
||||
|
||||
define Package/ps3netsrv/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ps3netsrv $(1)/usr/bin
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/ps3netsrv.config $(1)/etc/config/ps3netsrv
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/ps3netsrv.init $(1)/etc/init.d/ps3netsrv
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ps3netsrv))
|
||||
@ -1,5 +0,0 @@
|
||||
config ps3netsrv 'main'
|
||||
option enabled '0'
|
||||
option user 'root'
|
||||
option dir '/root'
|
||||
option port '38008'
|
||||
@ -1,83 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
NAME=ps3netsrv
|
||||
PROG=/usr/bin/ps3netsrv
|
||||
|
||||
_info() {
|
||||
logger -p daemon.info -t "$NAME" "$*"
|
||||
}
|
||||
|
||||
_err() {
|
||||
logger -p daemon.err -t "$NAME" "$*"
|
||||
}
|
||||
|
||||
_change_owner() {
|
||||
local u="$1"; shift
|
||||
|
||||
local d
|
||||
for d in "$@"; do
|
||||
if [ -f "$d" ]; then
|
||||
chown "$u" "$d" 2>/dev/null || return 1
|
||||
elif [ -d "$d" ]; then
|
||||
chown -R "$u" "$d" 2>/dev/null || return 1
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
ps3netsrv_validate() {
|
||||
uci_validate_section "$NAME" ps3netsrv "$1" \
|
||||
'enabled:bool:0' \
|
||||
'dir:string:/root' \
|
||||
'user:string' \
|
||||
'port:range(1024,65535)'
|
||||
}
|
||||
|
||||
ps3netsrv_start() {
|
||||
local section="$1"
|
||||
ps3netsrv_validate "$section" || { _err "Validation failed."; return 1; }
|
||||
|
||||
[ "$enabled" = "1" ] || { _info "Instance \"${section}\" disabled."; return 1; }
|
||||
[ -n "$dir" ] || { _err "Please set PS3 Game dir."; return 1; }
|
||||
[ -n "$port" ] || { _err "Please set bind port."; return 1; }
|
||||
[ -d "$dir" ] || { _err "Please create PS3 Game dir first."; return 1; }
|
||||
|
||||
if [ -n "$user" ]; then
|
||||
if ( user_exists "$user" && _change_owner "$user" "$log" ); then
|
||||
_info "ps3netsrv will run as user '${user}'."
|
||||
if [ "$user" != "root" ]; then
|
||||
_info "Please make sure user '${user}' has read access to directory: ${dir}"
|
||||
fi
|
||||
else
|
||||
_info "Set run user to '${user}' failed, default user will be used."
|
||||
user=
|
||||
fi
|
||||
fi
|
||||
|
||||
procd_open_instance "${NAME}.${section}"
|
||||
procd_set_param command "$PROG" "$dir" "$port"
|
||||
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
[ -n "$user" ] && \
|
||||
procd_set_param user "$user"
|
||||
|
||||
procd_add_jail "${NAME}.${section}" log
|
||||
procd_add_jail_mount "$dir"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$NAME"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "$NAME"
|
||||
config_foreach ps3netsrv_start "ps3netsrv"
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
--- a/include/compat.h
|
||||
+++ b/include/compat.h
|
||||
@@ -57,7 +57,7 @@ typedef int socklen_t;
|
||||
|
||||
#else
|
||||
|
||||
-#include <sys/errno.h>
|
||||
+#include <errno.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
@ -1,26 +0,0 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,11 +1,11 @@
|
||||
-OS = windows
|
||||
+OS = linux
|
||||
BUILD_TYPE = release_static
|
||||
|
||||
OUTPUT := ps3netsrv
|
||||
OBJS = src/main.o src/padlock.o src/aes.o src/compat.o src/File.o src/VIsoFile.o
|
||||
|
||||
-CFLAGS = -Wall -Wno-format -I./include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
|
||||
-CPPFLAGS += -Wall -Wno-format -I./include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
|
||||
+CFLAGS = -Wall -I./include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
|
||||
+CPPFLAGS += -Wall -I./include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
|
||||
|
||||
#CFLAGS += -Doff64_t=off_t
|
||||
#CPPFLAGS += -Doff64_t=off_t
|
||||
@@ -18,7 +18,7 @@ LDFLAGS = -L.
|
||||
LIBS = -lstdc++
|
||||
|
||||
ifeq ($(OS), linux)
|
||||
-LIBS += -lpthread
|
||||
+LIBS += -lpthread -lgcc_eh
|
||||
endif
|
||||
|
||||
ifeq ($(OS), windows)
|
||||
@ -1,60 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qBittorrent-Enhanced-Edition
|
||||
PKG_VERSION:=4.3.4.10
|
||||
PKG_RELEASE=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/c0re100/qBittorrent-Enhanced-Edition/tar.gz/release-$(PKG_VERSION)?
|
||||
PKG_HASH:=4be469d014eede3562bbd2065c3a65dfd2e65744a69259e347ac0c05ff113de6
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0+
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SUBMENU:=BitTorrent
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=bittorrent client programmed in C++ / Qt
|
||||
URL:=https://github.com/c0re100/qBittorrent-Enhanced-Edition
|
||||
DEPENDS:=+boost +libtorrent-rasterbar +python3 +qt5-core +qt5-network +qt5-sql +qt5-xml
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
qBittorrent is a bittorrent client programmed in C++ / Qt that uses
|
||||
libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
|
||||
It aims to be a good alternative to all other bittorrent clients out
|
||||
there. qBittorrent is fast, stable and provides unicode support as
|
||||
well as many features.
|
||||
endef
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
QT_QMAKE="$(TOOLCHAIN_DIR)/bin" \
|
||||
PKG_CONFIG_PATH="$(TOOLCHAIN_DIR)/lib/pkgconfig"
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-gui \
|
||||
--enable-stacktrace=no \
|
||||
--with-boost=$(STAGING_DIR)/usr
|
||||
|
||||
MAKE_VARS += \
|
||||
INSTALL_ROOT="$(PKG_INSTALL_DIR)"
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(SED) '/<context>/{:a;N;/<\/context>/!ba;/\/gui\//d}' `ls $(PKG_BUILD_DIR)/src/lang/qbittorrent_*.ts`
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qbittorrent-nox $(1)/usr/bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@ -1,202 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017-2019 Entware
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# ported to Entware from
|
||||
# https://github.com/KryptonLee/qBittorrent-openwrt-package and
|
||||
# https://github.com/pawelkn/qt5-openwrt-package
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
QT5_VERSION_MAJOR_MINOR:=5.15
|
||||
QT5_VERSION_PATCH:=2
|
||||
|
||||
PKG_NAME:=qt5
|
||||
PKG_VERSION:=$(QT5_VERSION_MAJOR_MINOR)$(if $(QT5_VERSION_PATCH),.$(QT5_VERSION_PATCH))
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=qt-everywhere-src-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://mirrors.tencent.com/qt/archive/qt/$(QT5_VERSION_MAJOR_MINOR)/$(PKG_VERSION)/single/ \
|
||||
https://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/$(QT5_VERSION_MAJOR_MINOR)/$(PKG_VERSION)/single/ \
|
||||
https://mirrors.ustc.edu.cn/qtproject/archive/qt/$(QT5_VERSION_MAJOR_MINOR)/$(PKG_VERSION)/single/ \
|
||||
http://download.qt-project.org/archive/qt/$(QT5_VERSION_MAJOR_MINOR)/$(PKG_VERSION)/single/
|
||||
PKG_HASH:=3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded07228202240
|
||||
|
||||
PKG_BUILD_DIR=$(BUILD_DIR)/qt-everywhere-src-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DEPENDS:=libdouble-conversion pcre2 zlib
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifndef CONFIG_USE_GLIBC
|
||||
# not using sstrip here as this fucks up the .so's somehow
|
||||
STRIP:=/bin/true
|
||||
RSTRIP:= \
|
||||
NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \
|
||||
STRIP="$(STRIP)" \
|
||||
STRIP_KMOD="$(STRIP)" \
|
||||
$(SCRIPT_DIR)/rstrip.sh
|
||||
endif
|
||||
|
||||
define Package/qt5/Default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=Qt5
|
||||
TITLE:=qt5
|
||||
URL:=http://qt-project.org
|
||||
DEPENDS:=+librt +libstdcpp +libpthread
|
||||
endef
|
||||
|
||||
define Package/qt5-core
|
||||
$(call Package/qt5/Default)
|
||||
TITLE+=core
|
||||
DEPENDS+=+libatomic +libzstd +zlib +libpcre2-16 +libdouble-conversion +icu
|
||||
endef
|
||||
|
||||
define Package/qt5-network
|
||||
$(call Package/qt5/Default)
|
||||
TITLE+=network
|
||||
DEPENDS+=+qt5-core +krb5-libs +libopenssl
|
||||
endef
|
||||
|
||||
define Package/qt5-sql
|
||||
$(call Package/qt5/Default)
|
||||
TITLE+=sql
|
||||
DEPENDS+=+qt5-core +libsqlite3
|
||||
endef
|
||||
|
||||
define Package/qt5-xml
|
||||
$(call Package/qt5/Default)
|
||||
TITLE+=xml
|
||||
DEPENDS+=+qt5-core
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS = \
|
||||
-prefix /usr \
|
||||
-extprefix $(TOOLCHAIN_DIR) \
|
||||
-sysroot $(STAGING_DIR) \
|
||||
-plugindir /usr/lib/Qt/plugins \
|
||||
-R /usr/lib \
|
||||
-I $(STAGING_DIR)/usr/include \
|
||||
-L $(STAGING_DIR)/usr/lib \
|
||||
-xplatform linux-openwrt-g++ \
|
||||
-opensource \
|
||||
-confirm-license \
|
||||
-system-doubleconversion \
|
||||
-system-pcre \
|
||||
-system-zlib \
|
||||
-openssl-runtime \
|
||||
-sql-sqlite \
|
||||
-sqlite \
|
||||
-no-cups \
|
||||
-no-freetype \
|
||||
-no-harfbuzz \
|
||||
-no-gtk \
|
||||
-no-opengl \
|
||||
-no-opengles3 \
|
||||
-no-angle \
|
||||
-no-openvg \
|
||||
-no-dbus \
|
||||
-no-directfb \
|
||||
-no-eglfs \
|
||||
-no-feature-getentropy \
|
||||
-no-iconv \
|
||||
-no-kms \
|
||||
-no-pch \
|
||||
-no-libudev \
|
||||
-no-mtdev \
|
||||
-no-tslib \
|
||||
-no-libpng \
|
||||
-no-libjpeg \
|
||||
-no-sql-db2 \
|
||||
-no-sql-ibase \
|
||||
-no-sql-mysql \
|
||||
-no-sql-oci \
|
||||
-no-sql-odbc \
|
||||
-no-sql-psql \
|
||||
-no-sql-sqlite2 \
|
||||
-no-sql-tds \
|
||||
-no-strip \
|
||||
-no-xcb \
|
||||
-no-gui \
|
||||
-no-widgets \
|
||||
-no-glib \
|
||||
-make libs \
|
||||
-nomake examples \
|
||||
-nomake tests \
|
||||
-nomake tools \
|
||||
-skip 3d \
|
||||
-skip activeqt \
|
||||
-skip charts \
|
||||
-skip connectivity \
|
||||
-skip datavis3d \
|
||||
-skip declarative \
|
||||
-skip doc \
|
||||
-skip gamepad \
|
||||
-skip imageformats \
|
||||
-skip location \
|
||||
-skip networkauth \
|
||||
-skip multimedia \
|
||||
-skip purchasing \
|
||||
-skip remoteobjects \
|
||||
-skip script \
|
||||
-skip sensors \
|
||||
-skip serialbus \
|
||||
-skip serialport \
|
||||
-skip speech \
|
||||
-skip svg \
|
||||
-skip wayland \
|
||||
-skip webengine \
|
||||
-skip websockets \
|
||||
-skip webchannel \
|
||||
-skip xmlpatterns \
|
||||
-v \
|
||||
|
||||
define Build/Configure
|
||||
$(SED) 's@$$$$(TARGET_CROSS)@$(TARGET_CROSS)@g' $(PKG_BUILD_DIR)/qtbase/mkspecs/linux-openwrt-g++/qmake.conf
|
||||
$(SED) 's@$$$$(TARGET_CFLAGS)@$(TARGET_CFLAGS)@g' $(PKG_BUILD_DIR)/qtbase/mkspecs/linux-openwrt-g++/qmake.conf
|
||||
$(SED) 's@$$$$(TARGET_CXXFLAGS)@$(TARGET_CXXFLAGS)@g' $(PKG_BUILD_DIR)/qtbase/mkspecs/linux-openwrt-g++/qmake.conf
|
||||
$(SED) 's@$$$$(TARGET_LDFLAGS)@$(TARGET_LDFLAGS)@g' $(PKG_BUILD_DIR)/qtbase/mkspecs/linux-openwrt-g++/qmake.conf
|
||||
|
||||
$(call Build/Configure/Default)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) install
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/qtbase/bin/qt.conf $(STAGING_DIR)/usr/bin
|
||||
$(RM) $(STAGING_DIR)/usr/bin/qt{attributionsscanner,paths,plugininfo}
|
||||
endef
|
||||
|
||||
define Package/qt5-core/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Core.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/qt5-network/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Network.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/qt5-sql/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/Qt/plugins/sqldrivers
|
||||
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Sql.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/qtbase/plugins/sqldrivers/*.so $(1)/usr/lib/Qt/plugins/sqldrivers/
|
||||
endef
|
||||
|
||||
define Package/qt5-xml/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Xml.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,qt5-core))
|
||||
$(eval $(call BuildPackage,qt5-network))
|
||||
$(eval $(call BuildPackage,qt5-sql))
|
||||
$(eval $(call BuildPackage,qt5-xml))
|
||||
@ -1,31 +0,0 @@
|
||||
#
|
||||
# qmake configuration for building with linux-openwrt-g++
|
||||
#
|
||||
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
CONFIG += incremental
|
||||
QMAKE_INCREMENTAL_STYLE = sublib
|
||||
|
||||
include(../common/linux.conf)
|
||||
include(../common/gcc-base-unix.conf)
|
||||
include(../common/g++-unix.conf)
|
||||
|
||||
# modifications to g++.conf
|
||||
QMAKE_CC = $(TARGET_CROSS)gcc
|
||||
QMAKE_CXX = $(TARGET_CROSS)g++
|
||||
|
||||
QMAKE_CFLAGS += $(TARGET_CFLAGS)
|
||||
QMAKE_CXXFLAGS += $(TARGET_CXXFLAGS)
|
||||
QMAKE_LFLAGS += $(TARGET_LDFLAGS)
|
||||
|
||||
QMAKE_LINK_C = $(TARGET_CROSS)gcc
|
||||
QMAKE_LINK_C_SHLIB = $(TARGET_CROSS)gcc
|
||||
QMAKE_LINK = $(TARGET_CROSS)g++
|
||||
QMAKE_LINK_SHLIB = $(TARGET_CROSS)g++
|
||||
|
||||
# modifications to linux.conf
|
||||
QMAKE_AR = $(TARGET_CROSS)ar cqs
|
||||
QMAKE_OBJCOPY = $(TARGET_CROSS)objcopy
|
||||
QMAKE_NM = $(TARGET_CROSS)nm -P
|
||||
QMAKE_STRIP = $(TARGET_CROSS)strip
|
||||
load(qt_config)
|
||||
@ -1,9 +0,0 @@
|
||||
#include "../linux-g++/qplatformdefs.h"
|
||||
|
||||
#undef QT_SOCKLEN_T
|
||||
|
||||
#if defined(__GLIBC__) && (__GLIBC__ < 2)
|
||||
#define QT_SOCKLEN_T int
|
||||
#else
|
||||
#define QT_SOCKLEN_T socklen_t
|
||||
#endif
|
||||
@ -1,64 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2017-2020 Yousong Zhou <yszhou4tech@gmail.com>
|
||||
# Copyright (C) 2018 Lean <coolsnowwolf@gmail.com>
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=shadowsocksr-libev
|
||||
PKG_VERSION:=2.5.6
|
||||
PKG_RELEASE:=8
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/shadowsocksrr/shadowsocksr-libev
|
||||
PKG_SOURCE_DATE:=2018-03-07
|
||||
PKG_SOURCE_VERSION:=d63ff863800a5645aca4309d5dd5962bd1e95543
|
||||
PKG_MIRROR_HASH:=34308ed827a5dd4f4e35619914102d55b00604faa44fda051d1d25fb4a319325
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/shadowsocksr-libev/Default
|
||||
define Package/shadowsocksr-libev-ssr-$(1)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=shadowsocksr-libev ssr-$(1)
|
||||
URL:=https://github.com/shadowsocksrr/shadowsocksr-libev
|
||||
DEPENDS:=+libev +libsodium +libopenssl +libpthread +libpcre +libudns +zlib
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-ssr-$(1)/install
|
||||
$$(INSTALL_DIR) $$(1)/usr/bin
|
||||
$$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/ss-$(1) $$(1)/usr/bin/ssr-$(1)
|
||||
endef
|
||||
endef
|
||||
|
||||
SHADOWSOCKSR_COMPONENTS:=check local nat redir server
|
||||
define shadowsocksr-libev/templates
|
||||
$(foreach component,$(SHADOWSOCKSR_COMPONENTS),
|
||||
$(call Package/shadowsocksr-libev/Default,$(component))
|
||||
)
|
||||
endef
|
||||
$(eval $(call shadowsocksr-libev/templates))
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-documentation \
|
||||
--disable-ssp \
|
||||
--disable-assert \
|
||||
--enable-system-shared-lib
|
||||
|
||||
TARGET_CFLAGS += -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
|
||||
|
||||
$(foreach component,$(SHADOWSOCKSR_COMPONENTS), \
|
||||
$(eval $(call BuildPackage,shadowsocksr-libev-ssr-$(component))) \
|
||||
)
|
||||
@ -1,397 +0,0 @@
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -2,6 +2,7 @@ build/
|
||||
.deps/
|
||||
/Makefile
|
||||
src/Makefile
|
||||
+server/Makefile
|
||||
libev/Makefile
|
||||
libudns/Makefile
|
||||
libcork/Makefile
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -1,7 +1,7 @@
|
||||
if USE_SYSTEM_SHARED_LIB
|
||||
-SUBDIRS = libcork libipset src
|
||||
+SUBDIRS = libcork libipset src server
|
||||
else
|
||||
-SUBDIRS = libsodium libcork libipset libudns libev src
|
||||
+SUBDIRS = libsodium libcork libipset libudns libev src server
|
||||
endif
|
||||
|
||||
if ENABLE_DOCUMENTATION
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -195,7 +195,7 @@ am__define_uniq_tagged_files = \
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
-DIST_SUBDIRS = libsodium libcork libipset libudns libev src doc
|
||||
+DIST_SUBDIRS = libsodium libcork libipset libudns libev src server doc
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(srcdir)/shadowsocks-libev.pc.in $(top_srcdir)/auto/ar-lib \
|
||||
$(top_srcdir)/auto/compile $(top_srcdir)/auto/config.guess \
|
||||
@@ -377,8 +377,9 @@ top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
@USE_SYSTEM_SHARED_LIB_FALSE@SUBDIRS = libsodium libcork libipset \
|
||||
-@USE_SYSTEM_SHARED_LIB_FALSE@ libudns libev src $(am__append_1)
|
||||
-@USE_SYSTEM_SHARED_LIB_TRUE@SUBDIRS = libcork libipset src \
|
||||
+@USE_SYSTEM_SHARED_LIB_FALSE@ libudns libev src server \
|
||||
+@USE_SYSTEM_SHARED_LIB_FALSE@ $(am__append_1)
|
||||
+@USE_SYSTEM_SHARED_LIB_TRUE@SUBDIRS = libcork libipset src server \
|
||||
@USE_SYSTEM_SHARED_LIB_TRUE@ $(am__append_1)
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
pkgconfiglibdir = $(libdir)/pkgconfig
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -649,7 +649,6 @@ PTHREAD_CC
|
||||
ax_pthread_config
|
||||
INET_NTOP_LIB
|
||||
MV
|
||||
-RM
|
||||
GZIP
|
||||
XMLTO
|
||||
ASCIIDOC
|
||||
@@ -757,6 +756,7 @@ infodir
|
||||
docdir
|
||||
oldincludedir
|
||||
includedir
|
||||
+runstatedir
|
||||
localstatedir
|
||||
sharedstatedir
|
||||
sysconfdir
|
||||
@@ -857,6 +857,7 @@ datadir='${datarootdir}'
|
||||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
+runstatedir='${localstatedir}/run'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
@@ -1109,6 +1110,15 @@ do
|
||||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||
+ | --runstate | --runstat | --runsta | --runst | --runs \
|
||||
+ | --run | --ru | --r)
|
||||
+ ac_prev=runstatedir ;;
|
||||
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||
+ | --run=* | --ru=* | --r=*)
|
||||
+ runstatedir=$ac_optarg ;;
|
||||
+
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
@@ -1246,7 +1256,7 @@ fi
|
||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||
- libdir localedir mandir
|
||||
+ libdir localedir mandir runstatedir
|
||||
do
|
||||
eval ac_val=\$$ac_var
|
||||
# Remove trailing slashes.
|
||||
@@ -1399,6 +1409,7 @@ Fine tuning of the installation director
|
||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||
--includedir=DIR C header files [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||
@@ -2472,8 +2483,8 @@ ac_configure="$SHELL $ac_aux_dir/configu
|
||||
|
||||
|
||||
|
||||
-# expand $ac_aux_dir to an absolute path
|
||||
-am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
+# Expand $ac_aux_dir to an absolute path.
|
||||
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
|
||||
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
@@ -3783,7 +3794,7 @@ $as_echo "$ac_cv_safe_to_define___extens
|
||||
|
||||
|
||||
|
||||
-am__api_version='1.14'
|
||||
+am__api_version='1.15'
|
||||
|
||||
# Find a good install program. We prefer a C program (faster),
|
||||
# so one script is as good as another. But avoid the broken or
|
||||
@@ -3972,7 +3983,7 @@ else
|
||||
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
|
||||
fi
|
||||
|
||||
-if test x"${install_sh}" != xset; then
|
||||
+if test x"${install_sh+set}" != xset; then
|
||||
case $am_aux_dir in
|
||||
*\ * | *\ *)
|
||||
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
||||
@@ -4363,8 +4374,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}ma
|
||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
||||
mkdir_p='$(MKDIR_P)'
|
||||
|
||||
-# We need awk for the "check" target. The system "awk" is bad on
|
||||
-# some platforms.
|
||||
+# We need awk for the "check" target (and possibly the TAP driver). The
|
||||
+# system "awk" is bad on some platforms.
|
||||
# Always define AMTAR for backward compatibility. Yes, it's still used
|
||||
# in the wild :-( We should find a proper way to deprecate it ...
|
||||
AMTAR='$${TAR-tar}'
|
||||
@@ -4549,6 +4560,7 @@ END
|
||||
as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
|
||||
fi
|
||||
fi
|
||||
+
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
for ac_prog in ar lib "link -lib"
|
||||
do
|
||||
@@ -12494,47 +12506,6 @@ $as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
- # Extract the first word of "rm", so it can be a program name with args.
|
||||
-set dummy rm; ac_word=$2
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
-$as_echo_n "checking for $ac_word... " >&6; }
|
||||
-if ${ac_cv_path_RM+:} false; then :
|
||||
- $as_echo_n "(cached) " >&6
|
||||
-else
|
||||
- case $RM in
|
||||
- [\\/]* | ?:[\\/]*)
|
||||
- ac_cv_path_RM="$RM" # Let the user override the test with a path.
|
||||
- ;;
|
||||
- *)
|
||||
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
-for as_dir in $PATH
|
||||
-do
|
||||
- IFS=$as_save_IFS
|
||||
- test -z "$as_dir" && as_dir=.
|
||||
- for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
- ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
|
||||
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
- break 2
|
||||
- fi
|
||||
-done
|
||||
- done
|
||||
-IFS=$as_save_IFS
|
||||
-
|
||||
- test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm"
|
||||
- ;;
|
||||
-esac
|
||||
-fi
|
||||
-RM=$ac_cv_path_RM
|
||||
-if test -n "$RM"; then
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5
|
||||
-$as_echo "$RM" >&6; }
|
||||
-else
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
-$as_echo "no" >&6; }
|
||||
-fi
|
||||
-
|
||||
-
|
||||
# Extract the first word of "mv", so it can be a program name with args.
|
||||
set dummy mv; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -16204,15 +16175,162 @@ $as_echo "#define HAVE_IPv6 1" >>confdef
|
||||
|
||||
|
||||
if test -z "$USE_SYSTEM_SHARED_LIB_TRUE"; then :
|
||||
- else
|
||||
+
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sodium_init in -lsodium" >&5
|
||||
+$as_echo_n "checking for sodium_init in -lsodium... " >&6; }
|
||||
+if ${ac_cv_lib_sodium_sodium_init+:} false; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lsodium $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char sodium_init ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return sodium_init ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_sodium_sodium_init=yes
|
||||
+else
|
||||
+ ac_cv_lib_sodium_sodium_init=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sodium_sodium_init" >&5
|
||||
+$as_echo "$ac_cv_lib_sodium_sodium_init" >&6; }
|
||||
+if test "x$ac_cv_lib_sodium_sodium_init" = xyes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBSODIUM 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-lsodium $LIBS"
|
||||
+
|
||||
+else
|
||||
+
|
||||
+ as_fn_error $? "Couldn't find libsodium. Try installing libsodium-dev[el]." "$LINENO" 5
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
+else
|
||||
subdirs="$subdirs libsodium"
|
||||
|
||||
fi
|
||||
|
||||
-ac_config_files="$ac_config_files shadowsocks-libev.pc Makefile libcork/Makefile libipset/Makefile src/Makefile"
|
||||
+ac_config_files="$ac_config_files shadowsocks-libev.pc Makefile libcork/Makefile libipset/Makefile src/Makefile server/Makefile"
|
||||
|
||||
if test -z "$USE_SYSTEM_SHARED_LIB_TRUE"; then :
|
||||
- else
|
||||
+
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dns_dnlen in -ludns" >&5
|
||||
+$as_echo_n "checking for dns_dnlen in -ludns... " >&6; }
|
||||
+if ${ac_cv_lib_udns_dns_dnlen+:} false; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-ludns $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char dns_dnlen ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return dns_dnlen ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_udns_dns_dnlen=yes
|
||||
+else
|
||||
+ ac_cv_lib_udns_dns_dnlen=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udns_dns_dnlen" >&5
|
||||
+$as_echo "$ac_cv_lib_udns_dns_dnlen" >&6; }
|
||||
+if test "x$ac_cv_lib_udns_dns_dnlen" = xyes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBUDNS 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-ludns $LIBS"
|
||||
+
|
||||
+else
|
||||
+ as_fn_error $? "Couldn't find libudns. Try installing libudns-dev or udns-devel." "$LINENO" 5
|
||||
+fi
|
||||
+
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ev_loop_destroy in -lev" >&5
|
||||
+$as_echo_n "checking for ev_loop_destroy in -lev... " >&6; }
|
||||
+if ${ac_cv_lib_ev_ev_loop_destroy+:} false; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lev $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char ev_loop_destroy ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return ev_loop_destroy ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_ev_ev_loop_destroy=yes
|
||||
+else
|
||||
+ ac_cv_lib_ev_ev_loop_destroy=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ev_ev_loop_destroy" >&5
|
||||
+$as_echo "$ac_cv_lib_ev_ev_loop_destroy" >&6; }
|
||||
+if test "x$ac_cv_lib_ev_ev_loop_destroy" = xyes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBEV 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-lev $LIBS"
|
||||
+
|
||||
+else
|
||||
+ as_fn_error $? "Couldn't find libev. Try installing libev-dev[el]." "$LINENO" 5
|
||||
+fi
|
||||
+
|
||||
+
|
||||
+else
|
||||
ac_config_files="$ac_config_files libudns/Makefile libev/Makefile"
|
||||
|
||||
fi
|
||||
@@ -17258,6 +17376,7 @@ do
|
||||
"libcork/Makefile") CONFIG_FILES="$CONFIG_FILES libcork/Makefile" ;;
|
||||
"libipset/Makefile") CONFIG_FILES="$CONFIG_FILES libipset/Makefile" ;;
|
||||
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
|
||||
+ "server/Makefile") CONFIG_FILES="$CONFIG_FILES server/Makefile" ;;
|
||||
"libudns/Makefile") CONFIG_FILES="$CONFIG_FILES libudns/Makefile" ;;
|
||||
"libev/Makefile") CONFIG_FILES="$CONFIG_FILES libev/Makefile" ;;
|
||||
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
|
||||
@@ -17958,8 +18077,8 @@ $as_echo X"$file" |
|
||||
fi
|
||||
|
||||
cfgfile="${ofile}T"
|
||||
- trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15
|
||||
- $RM -f "$cfgfile"
|
||||
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
|
||||
+ $RM "$cfgfile"
|
||||
|
||||
cat <<_LT_EOF >> "$cfgfile"
|
||||
#! $SHELL
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -315,7 +315,8 @@ AC_CONFIG_FILES([ shadowsocks-libev.pc
|
||||
Makefile
|
||||
libcork/Makefile
|
||||
libipset/Makefile
|
||||
- src/Makefile])
|
||||
+ src/Makefile
|
||||
+ server/Makefile])
|
||||
AM_COND_IF([USE_SYSTEM_SHARED_LIB],[
|
||||
AC_CHECK_LIB([udns], [dns_dnlen], ,[AC_MSG_ERROR([Couldn't find libudns. Try installing libudns-dev or udns-devel.])])
|
||||
AC_CHECK_LIB([ev], [ev_loop_destroy], ,[AC_MSG_ERROR([Couldn't find libev. Try installing libev-dev@<:@el@:>@.])])
|
||||
@ -1,20 +0,0 @@
|
||||
--- a/src/obfs/obfs.c
|
||||
+++ b/src/obfs/obfs.c
|
||||
@@ -88,7 +88,7 @@ obfs_class *new_obfs_class(const char *p
|
||||
plugin->client_decode = tls12_ticket_auth_client_decode;
|
||||
|
||||
return plugin;
|
||||
- /*} else if (strcmp(plugin_name, "verify_simple") == 0) {
|
||||
+ } else if (strcmp(plugin_name, "verify_simple") == 0) {
|
||||
obfs_class * plugin = (obfs_class*)malloc(sizeof(obfs_class));
|
||||
plugin->init_data = init_data;
|
||||
plugin->new_obfs = verify_simple_new_obfs;
|
||||
@@ -115,7 +115,7 @@ obfs_class *new_obfs_class(const char *p
|
||||
plugin->client_udp_pre_encrypt = NULL;
|
||||
plugin->client_udp_post_decrypt = NULL;
|
||||
|
||||
- return plugin;*/
|
||||
+ return plugin;
|
||||
} else if (strcmp(plugin_name, "auth_sha1") == 0) {
|
||||
obfs_class *plugin = (obfs_class *) malloc(sizeof(obfs_class));
|
||||
plugin->init_data = auth_simple_init_data;
|
||||
@ -1,37 +0,0 @@
|
||||
--- a/src/utils.c
|
||||
+++ b/src/utils.c
|
||||
@@ -258,8 +258,6 @@ usage()
|
||||
{
|
||||
printf("\n");
|
||||
printf("shadowsocks-libev %s with %s\n\n", VERSION, USING_CRYPTO);
|
||||
- printf(
|
||||
- " maintained by Max Lv <max.c.lv@gmail.com> and Linus Yang <laokongzi@gmail.com>\n\n");
|
||||
printf(" usage:\n\n");
|
||||
#ifdef MODULE_LOCAL
|
||||
printf(" ss-local\n");
|
||||
@@ -299,6 +297,25 @@ usage()
|
||||
" The default cipher is rc4-md5.\n");
|
||||
printf("\n");
|
||||
printf(
|
||||
+ " -o <obfs> Obfs of your remote server: plain,\n");
|
||||
+ printf(
|
||||
+ " http_simple, http_post and tls1.2_ticket_auth.\n");
|
||||
+ printf(
|
||||
+ " -g <obfs-param> Obfs-Param of your remote server.\n");
|
||||
+ printf(
|
||||
+ " -O <protocol> Protocol of your remote server: orgin,\n");
|
||||
+ printf(
|
||||
+ " auth_sha1, auth_sha1_v2, auth_sha1_v4,\n");
|
||||
+ printf(
|
||||
+ " auth_aes128_md5, auth_aes128_sha1,\n");
|
||||
+ printf(
|
||||
+ " auth_chain_a, auth_chain_b, auth_chain_c,\n");
|
||||
+ printf(
|
||||
+ " auth_chain_d, auth_chain_e and auth_chain_f.\n");
|
||||
+ printf(
|
||||
+ " -G <protocol-param> Protocol-Param of your remote server.\n");
|
||||
+ printf("\n");
|
||||
+ printf(
|
||||
" [-a <user>] Run as another user.\n");
|
||||
printf(
|
||||
" [-f <pid_file>] The file path to store pid.\n");
|
||||
@ -1,20 +0,0 @@
|
||||
--- a/src/http.h
|
||||
+++ b/src/http.h
|
||||
@@ -29,6 +29,6 @@
|
||||
#include <stdio.h>
|
||||
#include "protocol.h"
|
||||
|
||||
-const protocol_t *const http_protocol;
|
||||
+extern const protocol_t *const http_protocol;
|
||||
|
||||
#endif
|
||||
--- a/src/tls.h
|
||||
+++ b/src/tls.h
|
||||
@@ -28,6 +28,6 @@
|
||||
|
||||
#include "protocol.h"
|
||||
|
||||
-const protocol_t *const tls_protocol;
|
||||
+extern const protocol_t *const tls_protocol;
|
||||
|
||||
#endif
|
||||
@ -1,11 +0,0 @@
|
||||
--- a/src/local.c
|
||||
+++ b/src/local.c
|
||||
@@ -718,7 +718,7 @@ server_recv_cb(EV_P_ ev_io *w, int reven
|
||||
|
||||
ss_free(hostname);
|
||||
} else {
|
||||
- strncpy(host, ip, sizeof(ip));
|
||||
+ strncpy(host, ip, INET6_ADDRSTRLEN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
--- a/src/jconf.c
|
||||
+++ b/src/jconf.c
|
||||
@@ -259,6 +259,19 @@ read_jconf(const char *file)
|
||||
conf.server_legacy.obfs = to_string(value);
|
||||
} else if (strcmp(name, "obfs_param") == 0) { // SSR
|
||||
conf.server_legacy.obfs_param = to_string(value);
|
||||
+ } else if (strcmp(name, "mode") == 0) {
|
||||
+ char *mode_str = to_string(value);
|
||||
+
|
||||
+ if (strcmp(mode_str, "tcp_only") == 0)
|
||||
+ conf.mode = TCP_ONLY;
|
||||
+ else if (strcmp(mode_str, "tcp_and_udp") == 0)
|
||||
+ conf.mode = TCP_AND_UDP;
|
||||
+ else if (strcmp(mode_str, "udp_only") == 0)
|
||||
+ conf.mode = UDP_ONLY;
|
||||
+ else
|
||||
+ LOGI("ignore unknown mode: %s, use tcp_only as fallback",
|
||||
+ mode_str);
|
||||
+ ss_free(mode_str);
|
||||
} else {
|
||||
match = 0;
|
||||
}
|
||||
--- a/src/redir.c
|
||||
+++ b/src/redir.c
|
||||
@@ -1252,6 +1252,9 @@ main(int argc, char **argv)
|
||||
if (user == NULL) {
|
||||
user = conf->user;
|
||||
}
|
||||
+ if (mode == TCP_ONLY) {
|
||||
+ mode = conf->mode;
|
||||
+ }
|
||||
if (mtu == 0) {
|
||||
mtu = conf->mtu;
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
VERSION_INFO = 2:0:0
|
||||
|
||||
AM_CFLAGS = -g -O2 -Wall -Werror -Wno-deprecated-declarations -fno-strict-aliasing -std=gnu99 -D_GNU_SOURCE
|
||||
AM_CFLAGS += $(PTHREAD_CFLAGS)
|
||||
if !USE_SYSTEM_SHARED_LIB
|
||||
AM_CFLAGS += -I$(top_srcdir)/libev
|
||||
AM_CFLAGS += -I$(top_srcdir)/libudns
|
||||
AM_CFLAGS += -I$(top_srcdir)/libsodium/src/libsodium/include
|
||||
endif
|
||||
AM_CFLAGS += -I$(top_srcdir)/libipset/include
|
||||
AM_CFLAGS += -I$(top_srcdir)/libcork/include
|
||||
AM_CFLAGS += $(LIBPCRE_CFLAGS)
|
||||
|
||||
SS_COMMON_LIBS = $(top_builddir)/libipset/libipset.la \
|
||||
$(top_builddir)/libcork/libcork.la \
|
||||
$(INET_NTOP_LIB) $(LIBPCRE_LIBS)
|
||||
if USE_SYSTEM_SHARED_LIB
|
||||
SS_COMMON_LIBS += -lev -lsodium -lm
|
||||
else
|
||||
SS_COMMON_LIBS += $(top_builddir)/libev/libev.la \
|
||||
$(top_builddir)/libsodium/src/libsodium/libsodium.la
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = ss-server ss-check
|
||||
|
||||
sni_src = http.c \
|
||||
tls.c \
|
||||
rule.c
|
||||
|
||||
ss_check_SOURCES = check.c
|
||||
|
||||
ss_server_SOURCES = utils.c \
|
||||
netutils.c \
|
||||
jconf.c \
|
||||
json.c \
|
||||
encrypt.c \
|
||||
udprelay.c \
|
||||
cache.c \
|
||||
acl.c \
|
||||
resolv.c \
|
||||
server.c \
|
||||
$(sni_src)
|
||||
|
||||
|
||||
ss_check_LDADD = $(SS_COMMON_LIBS)
|
||||
ss_server_LDADD = $(SS_COMMON_LIBS)
|
||||
|
||||
if USE_SYSTEM_SHARED_LIB
|
||||
ss_server_LDADD += -ludns
|
||||
else
|
||||
ss_server_LDADD += $(top_builddir)/libudns/libudns.la
|
||||
endif
|
||||
|
||||
ss_check_CFLAGS = $(AM_CFLAGS)
|
||||
ss_server_CFLAGS = $(AM_CFLAGS) -DMODULE_REMOTE
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user