forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3eb916
commit 610721a
Showing
40 changed files
with
18,068 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=luci-app-ssr-plus | ||
PKG_VERSION:=1 | ||
PKG_RELEASE:=96 | ||
|
||
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \ | ||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \ | ||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun \ | ||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server \ | ||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/$(PKG_NAME)/config | ||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks | ||
bool "Include Shadowsocks New Version" | ||
default n | ||
|
||
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray | ||
bool "Include V2ray" | ||
default n | ||
|
||
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun | ||
bool "Include Kcptun" | ||
default n | ||
|
||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server | ||
bool "Include ShadowsocksR Server" | ||
default n | ||
|
||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks | ||
bool "Include ShadowsocksR Socks and Tunnel" | ||
default n | ||
endef | ||
|
||
define Package/luci-app-ssr-plus | ||
SECTION:=luci | ||
CATEGORY:=LuCI | ||
SUBMENU:=3. Applications | ||
TITLE:=SS/SSR/V2Ray LuCI interface | ||
PKGARCH:=all | ||
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget \ | ||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \ | ||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \ | ||
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \ | ||
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \ | ||
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks:shadowsocksr-libev-ssr-local | ||
endef | ||
|
||
define Build/Prepare | ||
endef | ||
|
||
define Build/Compile | ||
endef | ||
|
||
define Package/luci-app-ssr-plus/install | ||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci | ||
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci | ||
$(INSTALL_DIR) $(1)/ | ||
cp -pR ./root/* $(1)/ | ||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n | ||
po2lmo ./po/zh-cn/ssr-plus.po $(1)/usr/lib/lua/luci/i18n/ssr-plus.zh-cn.lmo | ||
endef | ||
|
||
define Package/luci-app-ssr-plus/postinst | ||
#!/bin/sh | ||
if [ -z "$${IPKG_INSTROOT}" ]; then | ||
( . /etc/uci-defaults/luci-ssr-plus ) && rm -f /etc/uci-defaults/luci-ssr-plus | ||
rm -f /tmp/luci-indexcache | ||
chmod 755 /etc/init.d/shadowsocksr >/dev/null 2>&1 | ||
/etc/init.d/shadowsocksr enable >/dev/null 2>&1 | ||
fi | ||
exit 0 | ||
endef | ||
|
||
define Package/luci-app-ssr-plus/prerm | ||
#!/bin/sh | ||
if [ -z "$${IPKG_INSTROOT}" ]; then | ||
/etc/init.d/shadowsocksr disable | ||
/etc/init.d/shadowsocksr stop | ||
fi | ||
exit 0 | ||
endef | ||
|
||
$(eval $(call BuildPackage,luci-app-ssr-plus)) |
Binary file not shown.
59 changes: 59 additions & 0 deletions
59
package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
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) | ||
|
||
s = m:section(TypedSection, "global", translate("Server failsafe auto swith settings")) | ||
s.anonymous = true | ||
|
||
o = s:option(Flag, "monitor_enable", translate("Enable Process Deamon")) | ||
o.rmempty = false | ||
|
||
o = s:option(Flag, "enable_switch", translate("Enable Auto Switch")) | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "switch_time", translate("Switch check cycly(second)")) | ||
o.datatype = "uinteger" | ||
o:depends("enable_switch", "1") | ||
o.default = 3600 | ||
|
||
o = s:option(Value, "switch_timeout", translate("Check timout(second)")) | ||
o.datatype = "uinteger" | ||
o:depends("enable_switch", "1") | ||
o.default = 5 | ||
|
||
-- [[ SOCKS5 Proxy ]]-- | ||
if nixio.fs.access("/usr/bin/ssr-local") then | ||
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS5 Proxy")) | ||
s.anonymous = true | ||
|
||
o = s:option(ListValue, "server", translate("Server")) | ||
o:value("nil", translate("Disable")) | ||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end | ||
o.default = "nil" | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "local_port", translate("Local Port")) | ||
o.datatype = "port" | ||
o.default = 1080 | ||
o.rmempty = false | ||
|
||
end | ||
|
||
return m |
Oops, something went wrong.