update 2022-11-26 20:17:46

This commit is contained in:
github-actions[bot] 2022-11-26 20:17:46 +08:00
parent 9697990c73
commit 3bfa1d5630
10 changed files with 120 additions and 46 deletions

View File

@ -11,7 +11,7 @@ PKG_ARCH_LINKEASE:=$(ARCH)
PKG_NAME:=linkease
PKG_VERSION:=1.0.9
PKG_RELEASE:=$(PKG_ARCH_LINKEASE)-2
PKG_RELEASE:=$(PKG_ARCH_LINKEASE)-3
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://fw.koolcenter.com/binary/LinkEase/LinuxStorage/
PKG_HASH:=404d0966e29372df0cb9e1723c55aa07006383a72b026a91ea5347c6d1e12084

View File

@ -5,7 +5,7 @@ source /lib/functions.sh
case "$1" in
save)
if [ ! -z "$2" ]; then
uci set linkease.@linkease[0].preconfig=$ROOT_DIR
uci set linkease.@linkease[0].preconfig=$2
uci commit
fi
;;

View File

@ -124,6 +124,12 @@ local flows = {
"xtls-rprx-splice-udp443"
}
local tls_flows = {
-- tls
"xtls-rprx-vision",
"xtls-rprx-vision-udp443"
}
m = Map("bypass", translate("Edit Bypass Server"))
m.redirect = luci.dispatcher.build_url("admin/services/bypass/servers")
if m.uci:get("bypass", sid) ~= "servers" then
@ -431,16 +437,20 @@ o:depends("transport", "ws")
o.rmempty = true
if is_finded("v2ray") then
-- 启用WS前置数据
o = s:option(Flag, "ws_ed_enable", translate("Enable early data"))
o:depends("transport", "ws")
-- WS前置数据
o = s:option(Value, "ws_ed", translate("Max Early Data"))
o:depends("transport", "ws")
o:depends("ws_ed_enable", true)
o.datatype = "uinteger"
o.default = 2048
o.rmempty = true
-- WS前置数据标头
o = s:option(Value, "ws_ed_header", translate("Early Data Header Name"))
o:depends("transport", "ws")
o:depends("ws_ed_enable", true)
o.default = "Sec-WebSocket-Protocol"
o.rmempty = true
end
@ -632,16 +642,23 @@ if is_finded("xray") then
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "kcp", tls = false})
o:depends({type = "v2ray", v2ray_protocol = "trojan", transport = "tcp", tls = false})
o:depends({type = "v2ray", v2ray_protocol = "trojan", transport = "kcp", tls = false})
end
-- Flow
o = s:option(Value, "vless_flow", translate("Flow"))
for _, v in ipairs(flows) do
o:value(v, translate(v))
-- Flow
o = s:option(Value, "vless_flow", translate("Flow"))
for _, v in ipairs(flows) do
o:value(v, translate(v))
end
o.rmempty = true
o.default = "xtls-rprx-splice"
o:depends("xtls", true)
o = s:option(Value, "tls_flow", translate("Flow"))
for _, v in ipairs(tls_flows) do
o:value(v, translate(v))
end
o.rmempty = true
o:depends({type = "v2ray", v2ray_protocol = "vless", tls = true})
end
o.rmempty = true
o.default = "xtls-rprx-splice"
o:depends("xtls", true)
-- [[ TLS部分 ]] --
o = s:option(Flag, "tls_sessionTicket", translate("Session Ticket"))
@ -657,6 +674,7 @@ if is_finded("xray") then
o:value("safari", translate("safari"))
o:value("randomized", translate("randomized"))
o:depends({type = "v2ray", tls = true})
o:depends({type = "v2ray", xtls = true})
o.default = "disable"
end

View File

@ -215,42 +215,25 @@ function import_ssr_url(btn, urlname, sid) {
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
return false;
case "trojan":
var url0, param = "";
var ploc = ssu[1].indexOf("#");
if (ploc > 0) {
url0 = ssu[1].substr(0, ploc);
param = ssu[1].substr(ploc + 1);
} else {
url0 = ssu[1]
try {
var url = new URL("http://" + ssu[1]);
} catch(e) {
alert(e)
return false;
}
var sstr = url0;
document.getElementsByName('cbid.bypass.' + sid + '.alias')[0].value = url.hash ? decodeURIComponent(url.hash.slice(1)) : "";
document.getElementsByName('cbid.bypass.' + sid + '.type')[0].value = "v2ray";
document.getElementsByName('cbid.bypass.' + sid + '.type')[0].dispatchEvent(event);
document.getElementsByName('cbid.bypass.' + sid + '.v2ray_protocol')[0].value = "trojan";
document.getElementsByName('cbid.bypass.' + sid + '.v2ray_protocol')[0].dispatchEvent(event);
var team = sstr.split('@');
var password = team[0]
var serverPart = team[1].split(':');
var others = serverPart[1].split('?');
var port = parseInt(others[0]);
var queryParam = {}
if (others.length > 1) {
var queryParams = others[1]
var queryArray = queryParams.split('&');
for (i = 0; i < queryArray.length; i++) {
var params = queryArray[i].split('=');
queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || '');
}
}
document.getElementsByName('cbid.bypass.' + sid + '.server')[0].value = serverPart[0];
document.getElementsByName('cbid.bypass.' + sid + '.server_port')[0].value = port || '443';
document.getElementsByName('cbid.bypass.' + sid + '.password')[0].value = password;
document.getElementsByName('cbid.bypass.' + sid + '.server')[0].value = url.hostname;
document.getElementsByName('cbid.bypass.' + sid + '.server_port')[0].value = url.port || "80";
document.getElementsByName('cbid.bypass.' + sid + '.password')[0].value = decodeURIComponent(url.username);
document.getElementsByName('cbid.bypass.' + sid + '.tls')[0].checked = true;
document.getElementsByName('cbid.bypass.' + sid + '.tls')[0].dispatchEvent(event);
document.getElementsByName('cbid.bypass.' + sid + '.tls_host')[0].value = queryParam.sni || '';
if (param != undefined) {
document.getElementsByName('cbid.bypass.' + sid + '.alias')[0].value = decodeURI(param);
}
document.getElementsByName('cbid.bypass.' + sid + '.tls_host')[0].value = url.searchParams.get("sni");
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
return false;
case "vmess":

View File

@ -25,7 +25,7 @@ function vmess_vless()
id = server.vmess_id,
security = (server.v2ray_protocol == "vmess" or not server.v2ray_protocol) and server.security or nil,
encryption = (server.v2ray_protocol == "vless") and server.vless_encryption or nil,
flow = (server.xtls == '1') and (server.vless_flow and server.vless_flow or "xtls-rprx-splice") or nil
flow = (server.xtls == '1') and (server.vless_flow or "xtls-rprx-splice") or (server.tls == '1') and server.tls_flow or nil
}
}
}
@ -51,7 +51,7 @@ function trojan_shadowsocks()
method = ((server.v2ray_protocol == "shadowsocks") and server.encrypt_method_ss) or ((server.v2ray_protocol == "shadowsocksr") and server.encrypt_method) or nil,
uot = (server.v2ray_protocol == "shadowsocks") and (server.uot == '1') or nil,
ivCheck = (server.v2ray_protocol == "shadowsocks") and (server.ivCheck == '1') or nil,
flow = (server.v2ray_protocol == "trojan") and (server.xtls == '1') and (server.vless_flow and server.vless_flow or "xtls-rprx-splice") or nil
flow = (server.v2ray_protocol == "trojan") and (server.xtls == '1') and (server.vless_flow or "xtls-rprx-splice") or nil
}
}
}
@ -173,8 +173,9 @@ local Xray = {
allowInsecure = (server.insecure == "1") and true or nil,
serverName = tls_host
} or nil,
xtlsSettings = (server.xtls == '1' and (server.insecure == "1" or tls_host)) and {
xtlsSettings = (server.xtls == '1' and (server.insecure == "1" or tls_host or server.fingerprint)) and {
-- xtls
fingerprint = server.fingerprint,
allowInsecure = (server.insecure == "1") and true or nil,
serverName = tls_host,
minVersion = "1.3"

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for linkease
LUCI_DEPENDS:=+linkease
LUCI_PKGARCH:=all
PKG_VERSION:=2.1.10
PKG_VERSION:=2.1.11
PKG_RELEASE:=1
LUCI_MINIFY_CSS:=0
LUCI_MINIFY_JS:=0

View File

@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=1.1.0-20221125
PKG_VERSION:=1.1.0-20221126
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for homeassistant

View File

@ -0,0 +1,55 @@
local util = require "luci.util"
local jsonc = require "luci.jsonc"
local emby = {}
emby.blocks = function()
local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r")
local vals = {}
if f then
local ret = f:read("*all")
f:close()
local obj = jsonc.parse(ret)
for _, val in pairs(obj["blockdevices"]) do
local fsize = val["fssize"]
if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
-- fsize > 1G
vals[#vals+1] = val["mountpoint"]
end
end
end
return vals
end
emby.home = function()
local uci = require "luci.model.uci".cursor()
local home_dirs = {}
home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/Configs")
home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
return home_dirs
end
emby.find_paths = function(blocks, home_dirs, path_name)
local default_path = ''
local configs = {}
default_path = home_dirs[path_name] .. "/HomeAssistant"
if #blocks == 0 then
table.insert(configs, default_path)
else
for _, val in pairs(blocks) do
table.insert(configs, val .. "/" .. path_name .. "/HomeAssistant")
end
local without_conf_dir = "/root/" .. path_name .. "/HomeAssistant"
if default_path == without_conf_dir then
default_path = configs[1]
end
end
return configs, default_path
end
return emby

View File

@ -0,0 +1,6 @@
<div class="cbi-map">
<iframe id="terminal" style="width: 100%; min-height: 600px; border: none; border-radius: 3px;"></iframe>
</div>
<script type="text/javascript">
document.getElementById("terminal").src = "http://" + window.location.hostname + ":7682";
</script>

View File

@ -0,0 +1,11 @@
<%+tasks/embed%>
<script>
window.addEventListener("load", function(){
const taskd = window.taskd;
<% if self.show_log_taskid then -%>
taskd.show_log("<%=self.show_log_taskid%>");
<%- end %>
});
</script>