Merge Mainline

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2021-03-19 18:01:27 +08:00
commit e541e2a0ca
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
13 changed files with 141 additions and 50 deletions

View File

@ -65,7 +65,7 @@
local currentBg = {}
local bgs = {}
local theme_dir = media .. "/background/"
local bing_background = fs.access('/etc/config/argon') and uci:get_first('argon', 'global', 'bing_background') or 0
local bing_background = fs.access('/etc/config/argon') and uci:get_first('argon', 'global', 'bing_background') or "0"
bgs,bgcount=fetchMedia("/www" .. theme_dir .. "*")
%>
<div class="login-page">

View File

@ -9,12 +9,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic-Go
PKG_VERSION:=0.2.7
PKG_RELEASE:=2
PKG_VERSION:=0.2.9
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GHCODELOAD/cnsilvan/UnblockNeteaseMusic/tar.gz/$(PKG_VERSION)?
PKG_HASH:=779a45272ee1d88674caaf792883c6f47619f37ec202082d38d15e090a7a2db9
PKG_HASH:=9d352a0080c33e75e39586c531f9b3b88eea1d8a9d49c9e95c19d6a7d29f1419
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILE:=LICENSE

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=n2n_v2 VPN Configuration module
LUCI_DEPENDS:=+n2n-edge +n2n-supernode
LUCI_PKGARCH:=all
PKG_VERSION:=2.8.0
PKG_VERSION:=2.8.1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -5,21 +5,6 @@
local fs = require "nixio.fs"
function get_mask(v)
v:value("1 ", "128.0.0.0(1)")
v:value("2 ", "192.0.0.0(2)")
v:value("3 ", "224.0.0.0(3)")
v:value("4 ", "240.0.0.0(4)")
v:value("5 ", "248.0.0.0(5)")
v:value("6 ", "252.0.0.0(6)")
v:value("7 ", "254.0.0.0(7)")
v:value("8 ", "255.0.0.0(8)")
v:value("9 ", "255.128.0.0(9)")
v:value("10", "255.192.0.0(10)")
v:value("11", "255.224.0.0(11)")
v:value("12", "255.240.0.0(12)")
v:value("13", "255.248.0.0(13)")
v:value("14", "255.252.0.0(14)")
v:value("15", "255.254.0.0(15)")
v:value("16", "255.255.0.0(16)")
v:value("17", "255.255.128.0(17)")
v:value("18", "255.255.192.0(18)")
@ -35,8 +20,6 @@ function get_mask(v)
v:value("28", "255.255.255.240(28)")
v:value("29", "255.255.255.248(29)")
v:value("30", "255.255.255.252(30)")
v:value("31", "255.255.255.254(31)")
v:value("32", "255.255.255.255(32)")
end
m = Map("n2n_v2", translate("N2N v2 VPN"), translatef(
@ -131,4 +114,8 @@ o.optional = false
o.datatype = "ip4addr"
o.rmempty = false
---- Description
o = s:option(Value, "desc", translate("Description"))
o.optional = false
return m

View File

@ -72,4 +72,7 @@ msgid "Mask"
msgstr "掩码"
msgid "Gateway"
msgstr "网关"
msgstr "网关"
msgid "Description"
msgstr "描述"

View File

@ -340,8 +340,8 @@ start_udp() {
ss | ssr)
gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_port
ss_program="$(first_type ${type}local ${type}-redir)"
[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && \
ss_extra_arg="--protocol redir -u" || ss_extra_arg="-U"
[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] &&
local ss_extra_arg="--protocol redir -u" || local ss_extra_arg="-U"
ln_start_bin $ss_program ${type}-redir -c $udp_config_file $ss_extra_arg
echolog "UDP TPROXY Relay:$(get_name $type) Started!"
;;
@ -384,7 +384,7 @@ start_shunt() {
ss | ssr)
gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port
ss_program="$(first_type ${type}local ${type}-redir)"
[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && ss_extra_arg="--protocol redir"
[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && local ss_extra_arg="--protocol redir"
ln_start_bin $ss_program ${type}-redir -c $shunt_config_file $ss_extra_arg
if [ -n "$tmp_local_port" ]; then
local tmp_port=$tmp_local_port
@ -471,8 +471,8 @@ start_local() {
ss | ssr)
gen_config_file $LOCAL_SERVER $type 4 $local_port
ss_program="$(first_type ${type}local ${type}-local)"
[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && \
ss_extra_arg="-U" || ss_extra_arg="-u"
[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] &&
local ss_extra_arg="-U" || local ss_extra_arg="-u"
ln_start_bin $ss_program ${type}-local -c $local_config_file $ss_extra_arg
echolog "Global_Socks5:$(get_name $type) Started!"
;;
@ -534,8 +534,11 @@ Start_Run() {
ss | ssr)
gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
ss_program="$(first_type ${type}local ${type}-redir)"
[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && \
{ ss_extra_arg="--protocol redir"; case ${ARG_OTA} in '-u') ARG_OTA='-U';; '-U') ARG_OTA='-u';; esac; }
[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] &&
{
local ss_extra_arg="--protocol redir"
case ${ARG_OTA} in '-u') ARG_OTA='-U' ;; esac
}
for i in $(seq 1 $threads); do
ln_start_bin "$ss_program" ${type}-redir -c $tcp_config_file $ARG_OTA $ss_extra_arg
done

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-unblockmusic
PKG_VERSION:=2.3.5
PKG_RELEASE:=10
PKG_RELEASE:=11
PKG_CONFIG_DEPENDS := \
CONFIG_UnblockNeteaseMusic_Go \

View File

@ -1,7 +1,7 @@
local fs = require "nixio.fs"
mp = Map("unblockmusic", translate("解锁网易云灰色歌曲"))
mp.description = translate("采用 [QQ/虾米/百度/酷狗/酷我/咪咕/JOOX]等音源,替换网易云变灰歌曲链接")
mp.description = translate("采用 [QQ/百度/酷狗/酷我/咪咕/JOOX]等音源,替换网易云变灰歌曲链接")
mp:section(SimpleSection).template = "unblockmusic/unblockmusic_status"
@ -27,7 +27,6 @@ speedtype = s:option(Value, "musicapptype", translate("音源选择"))
speedtype:value("default", translate("默认"))
speedtype:value("netease", translate("网易云音乐"))
speedtype:value("qq", translate("QQ音乐"))
speedtype:value("xiami", translate("虾米音乐"))
speedtype:value("baidu", translate("百度音乐"))
speedtype:value("kugou", translate("酷狗音乐"))
speedtype:value("kuwo", translate("酷我音乐"))

View File

@ -29,6 +29,10 @@ start_instance() {
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} $args $mtu
sleep 1
iptables -I FORWARD -i "$tunname" -j ACCEPT
iptables -I FORWARD -o "$tunname" -j ACCEPT
iptables -t nat -I POSTROUTING -o "$tunname" -j MASQUERADE
;;
supernode)
config_get_bool enabled "$cfg" 'enabled' '0'
@ -54,6 +58,10 @@ stop_instance() {
case "$type" in
edge)
config_get tunname "$cfg" 'tunname'
iptables -D FORWARD -i "$tunname" -j ACCEPT 2>/dev/null
iptables -D FORWARD -o "$tunname" -j ACCEPT 2>/dev/null
iptables -t nat -D POSTROUTING -o "$tunname" -j MASQUERADE 2>/dev/null
killall -9 edge
;;
supernode)
@ -72,6 +80,6 @@ start() {
stop() {
config_load 'n2n_v2'
killall -9 edge
config_foreach stop_instance 'edge'
ps | grep supernode | grep -v grep 2>&1 >/dev/null && killall -9 supernode
}

View File

@ -5,16 +5,16 @@ local api = require "luci.model.cbi.passwall.api.api"
<style>
#add_link_div{
display: none;
width: 30rem;
width: auto;
position: absolute;
left:50%;
top:50%;
transform: translate(-50%, -50%);
padding-top: 30px;
z-index: 99;
text-align: center;
background: white;
box-shadow: darkgrey 10px 10px 30px 5px;
padding: 30px 15px;
}
</style>
@ -83,11 +83,11 @@ local api = require "luci.model.cbi.passwall.api.api"
function add_node() {
var nodes_link = document.getElementById("nodes_link").value;
if (nodes_link.trim() != "") {
if (nodes_link.indexOf("ss://") == 0 || nodes_link.indexOf("ssr://") == 0 || nodes_link.indexOf("vmess://") == 0 || nodes_link.indexOf("trojan://") == 0 || nodes_link.indexOf("trojan-go://") == 0) {
if (nodes_link.indexOf("ss://") == 0 || nodes_link.indexOf("ssr://") == 0 || nodes_link.indexOf("vmess://") == 0 || nodes_link.indexOf("vless://") == 0 || nodes_link.indexOf("trojan://") == 0 || nodes_link.indexOf("trojan-go://") == 0) {
ajax_add_node(nodes_link);
}
else {
alert("<%:Please enter the correct link, ss:// ssr:// vmess:// trojan://%>");
alert("<%:Please enter the correct link, ss:// ssr:// vmess:// vless:// trojan://%>");
}
}
else {
@ -114,16 +114,16 @@ local api = require "luci.model.cbi.passwall.api.api"
<div id="add_link_div">
<div class="cbi-value">
<label class="cbi-value-title"><%:SS/SSR/Vmess/Trojan Link%></label>
<label class="cbi-value-title"><%:SS/SSR/Vmess/VLESS/Trojan Link%></label>
<div class="cbi-value-field">
<textarea id="nodes_link" rows="5" cols="50"></textarea>
</div>
</div>
<div class="cbi-value">
<div class="cbi-value-field">
<div class="cbi-value-field" style="display: unset">
<input class="cbi-button cbi-button-add" type="button" onclick="add_node()" value="<%:Add%>" />
<input class="cbi-button cbi-button-apply" type="button" onclick="link_load_temp()" value="<%:Load %><%:Cached%>" />
<input class="cbi-button cbi-button-refresh" type="button" onclick="link_clear_temp()" value="<%:Clear %><%:Cached%>" />
<!-- <input class="cbi-button cbi-button-apply" type="button" onclick="link_load_temp()" value="<%:Load Cached%>" /> -->
<!-- <input class="cbi-button cbi-button-refresh" type="button" onclick="link_clear_temp()" value="<%:Clear Cached%>" /> -->
<input class="cbi-button cbi-button-remove" type="button" onclick="close_add_link_div()" value="<%:Close%>" />
</div>
</div>

View File

@ -331,11 +331,17 @@ msgstr "添加节点"
msgid "Add the node via the link"
msgstr "通过链接添加节点"
msgid "SS/SSR/Vmess/Trojan Link"
msgstr "SS/SSR/Vmess/Trojan链接"
msgid "SS/SSR/Vmess/VLESS/Trojan Link"
msgstr "SS/SSR/Vmess/VLESS/Trojan链接"
msgid "Please enter the correct link, ss:// ssr:// vmess:// trojan://"
msgstr "请输入正确的链接ss:// ssr:// vmess:// trojan://"
msgid "Please enter the correct link, ss:// ssr:// vmess:// vless:// trojan://"
msgstr "请输入正确的链接ss:// ssr:// vmess:// vless:// trojan://"
msgid "Load Cached"
msgstr "加载缓存"
msgid "Clear Cached"
msgstr "清除缓存"
msgid "Clear all nodes"
msgstr "清空所有节点"

View File

@ -1113,7 +1113,8 @@ gen_pdnsd_config() {
purge_cache = off;
proxy_only = on;
caching = $_cache;
reject=::/0;
reject = ::/0;
reject_policy = negate;
}
EOF
echolog " | - [$?]上游DNS${2}:${3}"

View File

@ -379,6 +379,7 @@ local function processData(szType, content, add_mode)
idx_sp = content:find("#")
alias = content:sub(idx_sp + 1, -1)
end
result.remarks = UrlDecode(alias)
local info = content:sub(1, idx_sp - 1)
local hostInfo = split(base64Decode(info), "@")
local hostInfoLen = #hostInfo
@ -397,7 +398,6 @@ local function processData(szType, content, add_mode)
end
local method = userinfo:sub(1, userinfo:find(":") - 1)
local password = userinfo:sub(userinfo:find(":") + 1, #userinfo)
result.remarks = UrlDecode(alias)
result.type = "SS"
result.address = host[1]
if host[2] and host[2]:find("/%?") then
@ -434,12 +434,12 @@ local function processData(szType, content, add_mode)
alias = content:sub(idx_sp + 1, -1)
content = content:sub(0, idx_sp - 1)
end
result.remarks = UrlDecode(alias)
result.type = "Trojan-Plus"
if has_xray then
result.type = 'Xray'
result.protocol = 'trojan'
end
result.remarks = UrlDecode(alias)
if content:find("@") then
local Info = split(content, "@")
result.password = UrlDecode(Info[1])
@ -502,8 +502,8 @@ local function processData(szType, content, add_mode)
alias = content:sub(idx_sp + 1, -1)
content = content:sub(0, idx_sp - 1)
end
result.type = "Trojan-Go"
result.remarks = UrlDecode(alias)
result.type = "Trojan-Go"
if content:find("@") then
local Info = split(content, "@")
result.password = UrlDecode(Info[1])
@ -562,6 +562,90 @@ local function processData(szType, content, add_mode)
result.plugin_opts = content.plugin_options
result.group = content.airport
result.remarks = content.remarks
elseif szType == "vless" then
result.type = "Xray"
result.protocol = "vless"
local alias = ""
if content:find("#") then
local idx_sp = content:find("#")
alias = content:sub(idx_sp + 1, -1)
content = content:sub(0, idx_sp - 1)
end
result.remarks = UrlDecode(alias)
if content:find("@") then
local Info = split(content, "@")
result.uuid = UrlDecode(Info[1])
local port = "443"
Info[2] = (Info[2] or ""):gsub("/%?", "?")
local hostInfo = nil
if Info[2]:find(":") then
hostInfo = split(Info[2], ":")
result.address = hostInfo[1]
local idx_port = 2
if hostInfo[2]:find("?") then
hostInfo = split(hostInfo[2], "?")
idx_port = 1
end
if hostInfo[idx_port] ~= "" then port = hostInfo[idx_port] end
else
if Info[2]:find("?") then
hostInfo = split(Info[2], "?")
end
result.address = hostInfo and hostInfo[1] or Info[2]
end
local query = split(Info[2], "?")
local params = {}
for _, v in pairs(split(query[2], '&')) do
local t = split(v, '=')
params[string.lower(t[1])] = UrlDecode(t[2])
end
if params.type == 'ws' then
result.ws_host = params.host
result.ws_path = params.path
end
if params.type == 'h2' then
result.h2_host = params.host
result.h2_path = params.path
end
if params.type == 'tcp' then
result.tcp_guise = params.headerType or "none"
result.tcp_guise_http_host = params.host
result.tcp_guise_http_path = params.path
end
if params.type == 'kcp' then
result.mkcp_guise = params.headerType or "none"
result.mkcp_mtu = 1350
result.mkcp_tti = 50
result.mkcp_uplinkCapacity = 5
result.mkcp_downlinkCapacity = 20
result.mkcp_readBufferSize = 2
result.mkcp_writeBufferSize = 2
end
if params.type == 'quic' then
result.quic_guise = params.headerType or "none"
result.quic_key = params.key
result.quic_security = params.quicSecurity or "none"
end
result.encryption = params.encryption or "none"
result.tls = "0"
if params.security == "tls" or params.security == "xtls" then
result.tls = "1"
if params.security == "xtls" then
result.xtls = "1"
result.flow = params.flow or "xtls-rprx-direct"
end
if params.sni then
result.tls_serverName = params.sni
end
end
result.port = port
result.tls_allowInsecure = allowInsecure_default and "1" or "0"
end
else
log('暂时不支持' .. szType .. "类型的节点订阅,跳过此节点。")
return nil