Skip to content

Commit

Permalink
update lean's package
Browse files Browse the repository at this point in the history
  • Loading branch information
iyuangang committed Mar 4, 2020
1 parent 45d0a7a commit ce05a84
Show file tree
Hide file tree
Showing 31 changed files with 8,855 additions and 14,519 deletions.
64 changes: 64 additions & 0 deletions package/lean/dns2socks/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=dns2socks
PKG_VERSION:=2.1
PKG_RELEASE:=20200218

PKG_SOURCE:=SourceCode.zip
PKG_SOURCE_SUBDIR:=DNS2SOCKS
PKG_SOURCE_URL:=@SF/dns2socks
PKG_MD5SUM:=ec82de936ad004cc940502cd2a1bff5b

PKG_MAINTAINER:=ghostmaker
PKG_LICENSE:=BSD-3-Clause

PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

PKG_INSTALL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

define Package/dns2socks/Default
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
TITLE:=The utility to resolve DNS requests via a SOCKS5 tunnel.
URL:=http://dns2socks.sourceforge.net/
MAINTAINER:=ghostmaker
DEPENDS:=+libpthread
endef

define Package/dns2socks
$(call Package/dns2socks/Default)
endef

define Package/dns2socks/description
This is a utility to resolve DNS requests via a SOCKS5 tunnel and caches the answers.
endef

define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR)
endef

define Build/Compile
$(TARGET_CC) \
$(TARGET_CFLAGS) \
$(TARGET_CPPFLAGS) \
$(FPIC) \
-o $(PKG_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)/$(PKG_NAME) \
$(PKG_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)/DNS2SOCKS.c \
$(TARGET_LDFLAGS) -pthread
endef

define Build/Install
endef

define Package/dns2socks/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)/$(PKG_NAME) $(1)/usr/bin/dns2socks
endef

$(eval $(call BuildPackage,dns2socks))
4 changes: 1 addition & 3 deletions package/lean/luci-app-nps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ LUCI_TITLE:=LuCI for Nps
LUCI_DEPENDS:=+wget +npc
LUCI_PKGARCH:=all
PKG_VERSION:=1.1
PKG_RELEASE:=3
PKG_RELEASE:=4

include $(TOPDIR)/feeds/luci/luci.mk

# call BuildPackage - OpenWrt buildroot signature


Binary file removed package/lean/luci-app-nps/luasrc/i18n/nps.zh-cn.lmo
Binary file not shown.
28 changes: 0 additions & 28 deletions package/lean/luci-app-nps/luasrc/i18n/nps.zh_CN.po

This file was deleted.

2 changes: 0 additions & 2 deletions package/lean/luci-app-nps/luasrc/model/cbi/nps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ log_level:value(7,"Debug")
log_level.default="3"

return m


4 changes: 2 additions & 2 deletions package/lean/luci-app-nps/luasrc/view/nps/nps_status.htm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
var tb = document.getElementById('nps_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>nps <%:RUNNING%></font></b></em>';
var links = "<em><b style='color:green;'>Nps <%:RUNNING%></b></em>";
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>nps <%:NOT RUNNING%></font></b></em>';
tb.innerHTML = "<em><b style='color:red;'>Nps <%:NOT RUNNING%></b></em>";
}
}
}
Expand Down
29 changes: 29 additions & 0 deletions package/lean/luci-app-nps/po/zh-cn/nps.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
msgid "Nps Setting"
msgstr "Nps 内网穿透"

msgid "Nps is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
msgstr "Nps 是一种快速反向代理,可帮助您将 NAT 或防火墙后面的本地服务器公开到 Internet。"

msgid "Must an IPv4 address"
msgstr "必须是 IPv4 地址"

msgid "vkey"
msgstr "密钥(vkey)"

msgid "Enable Compression"
msgstr "使用压缩传输"

msgid "Enable Encryption"
msgstr "使用加密传输"

msgid "The contents will be compressed to speed up the traffic forwarding speed, but this will consume some additional cpu resources."
msgstr "压缩传输内容,加快流量转发速度,会额外消耗 CPU 资源。"

msgid "Encrypted the communication between Npc and Nps, will effectively prevent the traffic intercepted."
msgstr "加密传输 npc 与 nps 之间的通信内容,会有效防止流量被拦截。"

msgid "<b style='color:green;'>Nps is running.</b>"
msgstr "<b style='color:green;'>Nps 运行中</b>"

msgid "<b style='color:red;'>Nps is not running.</b>"
msgstr "<b style='color:red;'>Nps 未运行</b>"
2 changes: 1 addition & 1 deletion package/lean/luci-app-nps/root/etc/init.d/nps
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
START=50
USE_PROCD=1

LOGFILE="/var/etc/nps.log"
LOGFILE="/tmp/nps.log"
tmpconf="/tmp/etc/nps.conf"

nps_header() {
Expand Down
13 changes: 4 additions & 9 deletions package/lean/luci-app-ssr-plus/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=157
PKG_RELEASE:=1
PKG_VERSION:=160
PKG_RELEASE:=7

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

Expand Down Expand Up @@ -36,10 +36,6 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
bool "Include ShadowsocksR Server"
default y if x86_64

config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks
bool "Include Socks Sever"
default y if x86_64
endef

define Package/$(PKG_NAME)
Expand All @@ -48,15 +44,14 @@ define Package/$(PKG_NAME)
SUBMENU:=3. Applications
TITLE:=SS/SSR/V2Ray/Trojan LuCI interface
PKGARCH:=all
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +pdnsd-alt +wget +lua +ipt2socks \
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +pdnsd-alt +wget +lua +ipt2socks +microsocks +dns2socks \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
+PACKAGE_$(PKG_NAME)_INCLUDE_Simple_obfs:simple-obfs \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin:v2ray-plugin \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks:srelay
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server
endef

define Build/Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ local set =luci.http.formvalue("set")
local icount =0

if set == "gfw_data" then
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O /tmp/gfw.b64"
else
refresh_cmd="wget -O /tmp/gfw.b64 http://iytc.net/tools/list.b64"
end
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/bin/ssr-gfw")
Expand All @@ -87,6 +83,8 @@ if nixio.fs.access("/usr/bin/wget-ssl") then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf")
luci.sys.exec("cp -f /etc/dnsmasq.ssr/gfw_list.conf /tmp/dnsmasq.ssr/gfw_list.conf")
luci.sys.call("/etc/init.d/dnsmasq restart")
retstring=tostring(math.ceil(tonumber(icount)/2))
else
retstring ="0"
Expand Down Expand Up @@ -136,6 +134,7 @@ if sret== 0 then
luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf")
retstring=tostring(math.ceil(tonumber(icount)))
if oldcount==0 then
luci.sys.exec("cp -f /etc/dnsmasq.ssr/ad.conf /tmp/dnsmasq.ssr/ad.conf")
luci.sys.call("/etc/init.d/dnsmasq restart")
end
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
local shadowsocksr = "shadowsocksr"
local uci = luci.model.uci.cursor()
local server_table = {}

uci:foreach(shadowsocksr, "servers", function(s)
if s.alias then
server_table[s[".name"]] = "[%s]:%s" %{string.upper(s.type), s.alias}
elseif s.server and s.server_port then
server_table[s[".name"]] = "[%s]:%s:%s" %{string.upper(s.type), s.server, s.server_port}
end
end)

local key_table = {}
for key,_ in pairs(server_table) do
table.insert(key_table,key)
end

table.sort(key_table)
m = Map(shadowsocksr)
m = Map("shadowsocksr")
-- [[ global ]]--
s = m:section(TypedSection, "global", translate("Server failsafe auto swith settings"))
s = m:section(TypedSection, "global", translate("Server failsafe auto swith and custom update settings"))
s.anonymous = true

o = s:option(Flag, "monitor_enable", translate("Enable Process Deamon"))
Expand All @@ -44,38 +27,48 @@ o.datatype = "uinteger"
o:depends("enable_switch", "1")
o.default = 3

-- [[ adblock ]]--
s = m:section(TypedSection, "global", translate("adblock settings"))
s.anonymous = true

o = s:option(Flag, "adblock", translate("Enable adblock"))
o = s:option(Flag, "chnroute", translate("Enable Custom Chnroute"))
o.rmempty = false

o = s:option(Value, "adblock_url", translate("adblock_url"))
o.default = "https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt"

-- [[ chnroute ]]
s = m:section(TypedSection, "global", translate("Chnroute Setting"))
s.anonymous = true
o = s:option(Value, "chnroute_url", translate("Chnroute Update url"))
o.default = "https://ispip.clang.cn/all_cn.txt"
o:depends("chnroute", "1")

o = s:option(Flag, "chnroute", translate("Enable custom chnroute"))
o = s:option(Flag, "adblock", translate("Enable adblock"))
o.rmempty = false

o = s:option(Value, "chnroute_url", translate("Update url"))
o.default = "https://cdn.jsdelivr.net/gh/17mon/china_ip_list/china_ip_list.txt"
o = s:option(Value, "adblock_url", translate("adblock_url"))
o.default = "https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf"
o:depends("adblock", "1")
o.description = translate("Support AdGuardHome and DNSMAQ format list")

-- [[ SOCKS Proxy ]]--
if nixio.fs.access("/usr/bin/srelay") then
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS Proxy"))
if nixio.fs.access("/usr/bin/microsocks") then
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS5 Proxy Server Settings"))
s.anonymous = true

o = s:option(Flag, "socks", translate("Enable SOCKS Proxy"))
o = s:option(Flag, "socks", translate("Enable SOCKS5 Proxy Server"))
o.rmempty = false

o = s:option(Value, "local_port", translate("Local Port"))
o.datatype = "port"
o.default = 1080
o.rmempty = true
o:depends("socks", "1")

o = s:option(Flag, "auth_enable", translate("Enable Authentication"))
o.rmempty = false
o.default = "0"
o:depends("socks", "1")

o = s:option(Value, "username", translate("Username"))
o.rmempty = true
o:depends("auth_enable", "1")

o = s:option(Value, "password", translate("Password"))
o.password = true
o.rmempty = true
o:depends("auth_enable", "1")

end
return m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ o.default = 1

o = s:option(ListValue, "pdnsd_enable", translate("Resolve Dns Mode"))
o:value("1", translate("Use Pdnsd tcp query and cache"))
o:value("2", translate("Use DNS2SOCKS query and cache"))
o:value("0", translate("Use Local DNS Service listen port 5335"))
o.default = 1

Expand All @@ -88,6 +89,7 @@ o:value("1.1.1.1:53", translate("Cloudflare DNS (1.1.1.1)"))
o:value("114.114.114.114:53", translate("Oversea Mode DNS-1 (114.114.114.114)"))
o:value("114.114.115.115:53", translate("Oversea Mode DNS-2 (114.114.115.115)"))
o:depends("pdnsd_enable", "1")
o:depends("pdnsd_enable", "2")
o.description = translate("Custom DNS Server format as IP:PORT (default: 8.8.4.4:53)")

return m
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end

o = s:option(DummyValue, "server", translate("Server Address"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end

o = s:option(DummyValue, "server_port", translate("Server Port"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
Expand Down
Loading

0 comments on commit ce05a84

Please sign in to comment.