🎉 Sync 2024-08-02 02:58:54

This commit is contained in:
github-actions[bot] 2024-08-02 02:58:54 +08:00
parent 69c8120bc0
commit ff265f7f06
8 changed files with 103 additions and 210 deletions

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=LingTiGameAcc
PKG_VERSION:=2023
PKG_RELEASE:=4
PKG_RELEASE:=6
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE

View File

@ -1,129 +0,0 @@
<style>
.pure-img {
max-height: 100%;
width: auto;
}
.flag .pure-img {
max-height: none;
margin-top: -0.34rem;
}
.status-bar {
position: fixed;
bottom: 0;
right: 0;
box-shadow: 0 0 2rem 0 rgba(136, 152, 170, .3);
color: #525f7f;
background: #fff;
z-index: 5;
box-sizing: border-box;
}
.status-bar .inner {
margin: 0.5em;
}
.status-bar .inner .flag {
height: 2.6em;
display: block;
float: left;
margin-right: 1em;
}
.status-bar .inner .status-info {
font-weight: bold;
}
.status-bar .icon-con {
height: 2.6em;
text-align: right;
}
#cbi-passwall+.cbi-page-actions.control-group.fixed {
bottom: 3.3rem;
}
footer{
display:block !important;
}
@media screen and (max-width: 700px) {
.status-bar .icon-con {
height: 2.5em;
}
}
</style>
<div class="status-bar">
<div class="inner">
<div class="pure-g">
<div class="pure-u-1-2">
<span class="flag"><img src="/luci-static/passwall/flags/loading.svg" class="pure-img"></span> <span
class="status-info">获取中...</span>
</div>
<div class="pure-u-1-2">
<div class="icon-con">
<img src="/luci-static/passwall/img/site_icon1_01.png" class="pure-img i1">
<img src="/luci-static/passwall/img/site_icon1_02.png" class="pure-img i2">
<img src="/luci-static/passwall/img/site_icon1_03.png" class="pure-img i3">
<img src="/luci-static/passwall/img/site_icon1_04.png" class="pure-img i4">
</div>
</div>
</div>
</div>
</div>
<script>
const _ASSETS = '/luci-static/passwall/';
const CHECK_IP_URL = '<%=url([[admin]], [[services]], [[passwall]], [[ip]])%>';
let wW = window.innerWidth;
function resize() {
wW = window.innerWidth;
let lw = document.querySelector(".main-left").offsetWidth;
let statusBar = document.querySelector(".status-bar");
statusBar.style.width = (wW - lw) + 'px';
let flagElement = statusBar.querySelector(".flag");
flagElement.style.width = (flagElement.offsetHeight / 3 * 4) + 'px';
document.querySelectorAll(".flag-icon").forEach(function(el) {
if (el.offsetHeight < 60) {
el.parentElement.style.height = '60px';
el.style.width = '60px';
} else {
el.style.width = el.offsetHeight + 'px';
}
});
}
function write_status(data) {
document.querySelector(".flag img").src = _ASSETS + "flags/" + data.flag + ".svg";
document.querySelector(".status-info").innerHTML = data.ip + "<br>" + data.country;
document.querySelector(".i1").src = data.baidu ? _ASSETS + "img/site_icon_01.png" : _ASSETS + "img/site_icon1_01.png";
document.querySelector(".i2").src = data.taobao ? _ASSETS + "img/site_icon_02.png" : _ASSETS + "img/site_icon1_02.png";
document.querySelector(".i3").src = data.google ? _ASSETS + "img/site_icon_03.png" : _ASSETS + "img/site_icon1_03.png";
document.querySelector(".i4").src = data.youtube ? _ASSETS + "img/site_icon_04.png" : _ASSETS + "img/site_icon1_04.png";
setTimeout(function() {
let event = new Event('iploaded');
document.body.dispatchEvent(event);
}, 200);
}
XHR.poll(5, CHECK_IP_URL, null,
function (x, data) {
write_status(data);
}
);
document.addEventListener('DOMContentLoaded', function() {
resize();
fetch(CHECK_IP_URL)
.then(response => response.json())
.then(data => {
write_status(data);
})
.catch(error => console.error('Error:', error));
});
window.addEventListener('resize', resize);
</script>

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=Luci for Leigod Game Accelerater
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+libpcap +iptables +kmod-ipt-nat +iptables-mod-tproxy +kmod-ipt-tproxy +kmod-tun +kmod-netem +tc-full +kmod-ipt-ipset +ipset +curl +miniupnpd +leigod-acc
LUCI_DEPENDS:=+libpcap +iptables +kmod-ipt-nat +iptables-mod-tproxy +kmod-ipt-tproxy +kmod-tun +kmod-netem +tc-full +kmod-ipt-ipset +ipset +curl +miniupnpd +conntrack +conntrackd +leigod-acc
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -80,14 +80,17 @@ msgstr "手机设备"
msgid "None_Catalog"
msgstr "未分类设备"
msgid "None"
msgstr "无数据"
msgid "PC_Catalog"
msgstr "PC设备"
msgstr "PC 设备"
msgid "Game_Catalog"
msgstr "游戏机"
msgid "VR_Catalog"
msgstr "VR设备"
msgstr "VR 设备"
msgid "Unknown_Catalog"
msgstr "未识别设备"
@ -111,7 +114,7 @@ msgid "Acc Service Enabled"
msgstr "已启动"
msgid "Acc Catalog Started"
msgstr "已禁用"
msgstr "该设备类别加速已启用"
msgid "Acc Catalog Stopped"
msgstr "该设备类别加速已停止"

View File

@ -34,7 +34,7 @@ LUCI_DEPENDS:=+coreutils +coreutils-base64 +coreutils-nohup +curl \
+chinadns-ng +dns2socks +dns2tcp +dnsmasq-full +ip-full \
+libuci-lua +lua +luci-compat +luci-lib-jsonc \
+microsocks +resolveip +tcping \
+lua-maxminddb +ipt2socks \
+ipt2socks \
+PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy:haproxy \
+PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria:hysteria \
+PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy:naiveproxy \

View File

@ -212,20 +212,6 @@ function clear_log()
luci.sys.call("echo '' > /tmp/log/passwall.log")
end
function get_iso(ip)
local mm = require 'maxminddb'
local db = mm.open('/usr/share/passwall/GeoLite2-Country.mmdb')
local res = db:lookup(ip)
return string.lower(res:get('country', 'iso_code'))
end
function get_cname(ip)
local mm = require 'maxminddb'
local db = mm.open('/usr/share/passwall/GeoLite2-Country.mmdb')
local res = db:lookup(ip)
return string.lower(res:get('country', 'names', 'zh-CN'))
end
function check_site(host, port)
local nixio = require "nixio"
local socket = nixio.socket("inet", "stream")
@ -236,26 +222,43 @@ function check_site(host, port)
return ret
end
function get_ip_geo_info(ip)
local result = luci.sys.exec('curl --retry 3 -m 10 -LfsA "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36" https://ipapi.co/' .. ip .. '/json/')
local json = require "luci.jsonc"
local info = json.parse(result)
return {
flag = string.lower(info.country_code) or "un",
country = get_country_name(info.country_code) or "Unknown"
}
end
function get_country_name(country_code)
local country_names = {
US = "美国", CN = "中国", JP = "日本", GB = "英国", DE = "德国",
FR = "法国", BR = "巴西", IT = "意大利", RU = "俄罗斯", CA = "加拿大",
KR = "韩国", ES = "西班牙", AU = "澳大利亚", MX = "墨西哥", ID = "印度尼西亚",
NL = "荷兰", TR = "土耳其", CH = "瑞士", SA = "沙特阿拉伯", SE = "瑞典",
PL = "波兰", BE = "比利时", AR = "阿根廷", NO = "挪威", AT = "奥地利",
TW = "台湾", ZA = "南非", TH = "泰国", DK = "丹麦", MY = "马来西亚",
PH = "菲律宾", SG = "新加坡", IE = "爱尔兰", HK = "香港", FI = "芬兰",
CL = "智利", PT = "葡萄牙", GR = "希腊", IL = "以色列", NZ = "新西兰",
CZ = "捷克", RO = "罗马尼亚", VN = "越南", UA = "乌克兰", HU = "匈牙利",
AE = "阿联酋", CO = "哥伦比亚", IN = "印度", EG = "埃及", PE = "秘鲁", TW = "台湾"
}
return country_names[country_code]
end
-- 获取当前代理状态 与节点ip
function check_ip()
local e = {}
local d = {}
local port = 80
local ip = luci.sys.exec('curl --retry 3 -m 10 -LfsA "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36" http://api.ipify.org/')
d.flag = 'un'
d.country = 'Unknown'
if (ip ~= '') then
local status, code = pcall(get_iso, ip)
if (status) then
d.flag = code
end
local status1, country = pcall(get_cname, ip)
if (status1) then
d.country = country
end
end
e.outboard = ip
e.outboardip = d
-- 获取IP地理位置信息
local geo_info = get_ip_geo_info(ip)
e.ip = ip
e.flag = geo_info.flag
e.country = geo_info.country
e.baidu = check_site('www.baidu.com', port)
e.taobao = check_site('www.taobao.com', port)
e.google = check_site('www.google.com', port)

View File

@ -52,12 +52,6 @@ display:block !important;
}
}
</style>
<script src="<%=media%>/js/jquery.min.js"></script>
<script>
if(typeof jQuery == 'undefined'){
document.write('<script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"><\/script>');
}
</script>
<div class="status-bar">
<div class="inner">
<div class="pure-g">
@ -77,52 +71,58 @@ document.write('<script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.
</div>
</div>
<script>
const _ASSETS = '/luci-static/passwall/';
const CHECK_IP_URL = '<%=url([[admin]], [[services]], [[passwall]], [[ip]])%>';
var wW = $(window).width();
let wW = window.innerWidth;
function resize() {
wW = $(window).width();
lw = $(".main-left").width()
$(".status-bar").width(wW - lw);
$(".status-bar .flag").width($(".status-bar .flag").height() / 3 * 4);
function resize() {
wW = window.innerWidth;
let lw = document.querySelector(".main-left").offsetWidth;
let statusBar = document.querySelector(".status-bar");
statusBar.style.width = (wW - lw) + 'px';
let flagElement = statusBar.querySelector(".flag");
flagElement.style.width = (flagElement.offsetHeight / 3 * 4) + 'px';
$(".flag-icon").each(function (index, el) {
if ($(el).height < 60) {
$(el).parent.height(60);
$(el).width(60)
} else {
$(el).width($(el).height());
}
});
}
function wirte_status(data) {
if (data.outboard) {
json = data.outboardip;
$(".flag img").attr("src", _ASSETS + "flags/" + json.flag + ".svg");
$(".status-info").html(data.outboard + "<br>" + json.country);
document.querySelectorAll(".flag-icon").forEach(function(el) {
if (el.offsetHeight < 60) {
el.parentElement.style.height = '60px';
el.style.width = '60px';
} else {
el.style.width = el.offsetHeight + 'px';
}
data.baidu ? $(".i1").attr("src", _ASSETS + "img/site_icon_01.png") : $(".i1").attr("src", _ASSETS + "img/site_icon1_01.png");
data.taobao ? $(".i2").attr("src", _ASSETS + "img/site_icon_02.png") : $(".i2").attr("src", _ASSETS + "img/site_icon1_02.png");
data.google ? $(".i3").attr("src", _ASSETS + "img/site_icon_03.png") : $(".i3").attr("src", _ASSETS + "img/site_icon1_03.png");
data.youtube ? $(".i4").attr("src", _ASSETS + "img/site_icon_04.png") : $(".i4").attr("src", _ASSETS + "img/site_icon1_04.png");
setTimeout(function () { $("body").trigger("iploaded", [true]); }, 200);
}
XHR.poll(5, CHECK_IP_URL, null,
});
}
function write_status(data) {
document.querySelector(".flag img").src = _ASSETS + "flags/" + data.flag + ".svg";
document.querySelector(".status-info").innerHTML = data.ip + "<br>" + data.country;
document.querySelector(".i1").src = data.baidu ? _ASSETS + "img/site_icon_01.png" : _ASSETS + "img/site_icon1_01.png";
document.querySelector(".i2").src = data.taobao ? _ASSETS + "img/site_icon_02.png" : _ASSETS + "img/site_icon1_02.png";
document.querySelector(".i3").src = data.google ? _ASSETS + "img/site_icon_03.png" : _ASSETS + "img/site_icon1_03.png";
document.querySelector(".i4").src = data.youtube ? _ASSETS + "img/site_icon_04.png" : _ASSETS + "img/site_icon1_04.png";
setTimeout(function() {
let event = new Event('iploaded');
document.body.dispatchEvent(event);
}, 200);
}
XHR.poll(5, CHECK_IP_URL, null,
function (x, data) {
wirte_status(data);
write_status(data);
}
);
$(document).ready(function () {
resize();
$.getJSON(CHECK_IP_URL, wirte_status);
});
$(window).resize(resize);
document.addEventListener('DOMContentLoaded', function() {
resize();
fetch(CHECK_IP_URL)
.then(response => response.json())
.then(data => {
write_status(data);
})
.catch(error => console.error('Error:', error));
});
window.addEventListener('resize', resize);
</script>

View File

@ -926,6 +926,16 @@ run_redir() {
_args="${_args} udp_redir_port=${UDP_REDIR_PORT}"
config_file=$(echo $config_file | sed "s/TCP/TCP_UDP/g")
}
local protocol=$(config_n_get $node protocol)
local default_node=$(config_n_get $node default_node)
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
[ "${DNS_MODE}" != "sing-box" ] && [ "${DNS_MODE}" != "udp" ] && [ "$protocol" = "_shunt" ] && [ "$default_node" = "_direct" ] && {
DNS_MODE="sing-box"
v2ray_dns_mode="tcp"
echolog "* 当前TCP节点采用Sing-Box分流且默认节点为直连远程DNS过滤模式将默认使用Sing-Box(TCP),防止环回!"
}
[ "${DNS_MODE}" = "sing-box" ] && {
resolve_dns=1
config_file=$(echo $config_file | sed "s/.json/_DNS.json/g")
@ -934,11 +944,8 @@ run_redir() {
[ "${DNS_CACHE}" == "0" ] && _args="${_args} dns_cache=0"
resolve_dns_port=${dns_listen_port}
_args="${_args} dns_listen_port=${resolve_dns_port}"
local local_dns=$(echo "${LOCAL_DNS}" | sed "s/,/\n/g" | head -n1)
_args="${_args} direct_dns_udp_server=${local_dns}"
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
_args="${_args} remote_dns_protocol=${v2ray_dns_mode}"
case "$v2ray_dns_mode" in
tcp)
@ -981,6 +988,16 @@ run_redir() {
_args="${_args} udp_redir_port=${UDP_REDIR_PORT}"
config_file=$(echo $config_file | sed "s/TCP/TCP_UDP/g")
}
local protocol=$(config_n_get $node protocol)
local default_node=$(config_n_get $node default_node)
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
[ "${DNS_MODE}" != "xray" ] && [ "${DNS_MODE}" != "udp" ] && [ "$protocol" = "_shunt" ] && [ "$default_node" = "_direct" ] && {
DNS_MODE="xray"
v2ray_dns_mode="tcp"
echolog "* 当前TCP节点采用Xray分流且默认节点为直连远程DNS过滤模式将默认使用Xray(TCP),防止环回!"
}
[ "${DNS_MODE}" = "xray" ] && {
resolve_dns=1
config_file=$(echo $config_file | sed "s/.json/_DNS.json/g")
@ -992,7 +1009,6 @@ run_redir() {
resolve_dns_port=${dns_listen_port}
_args="${_args} dns_listen_port=${resolve_dns_port}"
_args="${_args} remote_dns_tcp_server=${REMOTE_DNS}"
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
if [ "$v2ray_dns_mode" = "tcp+doh" ]; then
remote_dns_doh=$(config_t_get global remote_dns_doh "https://1.1.1.1/dns-query")
_args="${_args} remote_dns_doh=${remote_dns_doh}"