Merge Lean's source

This commit is contained in:
CN_SZTL 2020-03-23 02:36:07 +08:00
commit 96188264e6
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
4 changed files with 28 additions and 11 deletions

View File

@ -17,7 +17,7 @@ DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fs
block-mount kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw wget libustream-openssl ca-certificates \
default-settings luci luci-proto-relay luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
luci-app-filetransfer luci-app-vsftpd luci-app-ssr-plus luci-app-unblockmusic \
luci-app-zerotier luci-app-arpbind luci-app-vlmcsd luci-app-wol luci-app-ramfree \
luci-app-arpbind luci-app-vlmcsd luci-app-wol luci-app-ramfree \
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-accesscontrol luci-app-cpufreq \
ddns-scripts_aliyun ddns-scripts_dnspod
# For nas targets

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=173
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@ -41,7 +41,7 @@ define Package/$(PKG_NAME)
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 +libuci-lua \
+microsocks +dns2socks +shadowsocks-libev-ss-local +shadowsocksr-libev-ssr-local +shadowsocks-libev-ss-redir +simple-obfs +tcpping \
+microsocks +dns2socks +shadowsocks-libev-ss-local +shadowsocksr-libev-ssr-local +shadowsocks-libev-ss-redir +simple-obfs +tcpping +proxychains-ng \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin:v2ray-plugin \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \

View File

@ -578,9 +578,25 @@ start_local() {
[ "$local_server" = "nil" ] && return 1
local local_type=$(uci_get_by_name $local_server type)
mkdir -p /var/run /var/etc
gen_config_file $local_server 3 $(uci_get_by_type socks5_proxy local_port 1080)
/usr/bin/ssr-local -c $CONFIG_SOCK5_FILE -u \
-f /var/run/ssr-local.pid >/dev/null 2>&1
if [ "$local_type" == "ssr" ]; then
gen_config_file $local_server 3 $(uci_get_by_type socks5_proxy local_port 1080)
/usr/bin/ssr-local -c $CONFIG_SOCK5_FILE -u -f /var/run/ssr-local.pid >/dev/null 2>&1
elif [ "$local_type" == "ss" ]; then
gen_config_file $local_server 3 $(uci_get_by_type socks5_proxy local_port 1080)
/usr/bin/ss-local -c $CONFIG_SOCK5_FILE -u -f /var/run/ssr-local.pid >/dev/null 2>&1
elif [ "$local_type" == "v2ray" ]; then
lua /usr/share/shadowsocksr/genv2config.lua $local_server tcp 0 $(uci_get_by_type socks5_proxy local_port 1080) >/var/etc/v2-ssr-local.json
sed -i 's/\\//g' /var/etc/v2-ssr-local.json
/usr/bin/v2ray/v2ray -config /var/etc/v2-ssr-local.json >/dev/null 2>&1 &
elif [ "$local_type" == "trojan" ]; then
lua /usr/share/shadowsocksr/gentrojanconfig.lua $local_server client $(uci_get_by_type socks5_proxy local_port 1080) >/var/etc/trojan-ssr-local.json
sed -i 's/\\//g' /var/etc/trojan-ssr-local.json
/usr/sbin/trojan --config /var/etc/trojan-ssr-local.json >/dev/null 2>&1 &
else
microsocks -i :: -p $(uci_get_by_type socks5_proxy local_port 1080) ssr-local >/dev/null 2>&1 &
fi
local_enable=1
}
@ -700,6 +716,7 @@ stop() {
killall -q -9 trojan
killall -q -9 ipt2socks
kill -9 $(busybox ps -w | grep ssr-server | grep -v grep | awk '{print $1}') >/dev/null 2>&1
kill -9 $(busybox ps -w | grep ssr-local | grep -v grep | awk '{print $1}') >/dev/null 2>&1
killall -q -9 ssr-local
killall -q -9 ss-local
killall -q -9 kcptun-client

View File

@ -2,7 +2,7 @@ local ucursor = require "luci.model.uci".cursor()
local json = require "luci.jsonc"
local server_section = arg[1]
local proto = arg[2]
local local_port = arg[3]
local local_port = arg[3] or "0"
local socks_port = arg[4] or "0"
local server = ucursor:get_all("shadowsocksr", server_section)
@ -13,7 +13,7 @@ log = {
loglevel = "warning"
},
-- 传入连接
inbound = {
inbound = (local_port ~= "0") and {
port = local_port,
protocol = "dokodemo-door",
settings = {
@ -24,12 +24,12 @@ log = {
enabled = true,
destOverride = { "http", "tls" }
}
},
-- 同时开启 socks 代理
} or nil,
-- 开启 socks 代理
inboundDetour = (proto == "tcp" and socks_port ~= "0") and {
{
protocol = "socks",
port = 1088,
port = socks_port,
settings = {
auth = "noauth",
udp = true