update 2025-01-05 20:35:50

This commit is contained in:
kenzok8 2025-01-05 20:35:50 +08:00
parent 91e91d58da
commit b389c2afef
12 changed files with 148 additions and 23 deletions

View File

@ -758,6 +758,25 @@ return view.extend({
so.depends('routing_mode', 'bypass_cn');
so.depends('routing_mode', 'routing_gfw');
so = ss.taboption('routing_control', form.ListValue, 'routing_dscp_mode', _('Routing DSCP'));
so.value('', _('All allowed'));
so.value('bypass_dscp', _('Bypass DSCP'));
so.value('routing_dscp', _('Routing DSCP'));
so = ss.taboption('routing_control', form.Value, 'routing_dscp_list', _('DSCP list'));
so.placeholder = '0,10,12,14,63';
so.validate = function(section_id, value) {
if (!value)
return true;
else if (value.match('^(6[0-3]|[1-5]?[0-9])(,(6[0-3]|[1-5]?[0-9]))*$') === null)
return _('Expecting: %s').format(_('One or more numbers in the range 0-63 separated by commas'));
return true;
}
so.rmempty = false;
so.depends('routing_dscp_mode', 'bypass_dscp');
so.depends('routing_dscp_mode', 'routing_dscp');
/* Custom Direct list */
ss.tab('direct_list', _('Custom Direct List'));

View File

@ -250,6 +250,10 @@ msgstr ""
msgid "Bypass CN"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:763
msgid "Bypass DSCP"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:552
msgid "CORS Allow origins"
msgstr ""
@ -432,6 +436,10 @@ msgstr ""
msgid "DNS settings"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:766
msgid "DSCP list"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:314
msgid "Dashboard version"
msgstr ""
@ -1437,6 +1445,10 @@ msgstr ""
msgid "Obfuscate type"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:772
msgid "One or more numbers in the range 0-63 separated by commas"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:658
msgid "Only process traffic from specific interfaces. Leave empty for all."
msgstr ""
@ -1799,6 +1811,11 @@ msgstr ""
msgid "Routing Control"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:761
#: htdocs/luci-static/resources/view/fchomo/global.js:764
msgid "Routing DSCP"
msgstr ""
#: htdocs/luci-static/resources/view/fchomo/global.js:747
msgid "Routing GFW"
msgstr ""

View File

@ -258,6 +258,10 @@ msgstr "启动 DNS 服务器 (节点)"
msgid "Bypass CN"
msgstr "绕过 CN 流量"
#: htdocs/luci-static/resources/view/fchomo/global.js:763
msgid "Bypass DSCP"
msgstr "绕过 DSCP"
#: htdocs/luci-static/resources/view/fchomo/global.js:552
msgid "CORS Allow origins"
msgstr "CORS 允许的来源"
@ -440,6 +444,10 @@ msgstr "DNS 服务器"
msgid "DNS settings"
msgstr "DNS 设置"
#: htdocs/luci-static/resources/view/fchomo/global.js:766
msgid "DSCP list"
msgstr "DSCP 列表"
#: htdocs/luci-static/resources/view/fchomo/global.js:314
msgid "Dashboard version"
msgstr "面板版本"
@ -1459,6 +1467,10 @@ msgstr "混淆密码"
msgid "Obfuscate type"
msgstr "混淆类型"
#: htdocs/luci-static/resources/view/fchomo/global.js:772
msgid "One or more numbers in the range 0-63 separated by commas"
msgstr "0-63 范围内的一个或多个数字,以逗号分隔"
#: htdocs/luci-static/resources/view/fchomo/global.js:658
msgid "Only process traffic from specific interfaces. Leave empty for all."
msgstr "只处理来自指定接口的流量。留空表示全部。"
@ -1822,6 +1834,11 @@ msgstr "Restls 剧本"
msgid "Routing Control"
msgstr "路由控制"
#: htdocs/luci-static/resources/view/fchomo/global.js:761
#: htdocs/luci-static/resources/view/fchomo/global.js:764
msgid "Routing DSCP"
msgstr "路由 DSCP"
#: htdocs/luci-static/resources/view/fchomo/global.js:747
msgid "Routing GFW"
msgstr "路由 GFW 流量"

View File

@ -258,6 +258,10 @@ msgstr "啟動 DNS 伺服器 (節點)"
msgid "Bypass CN"
msgstr "繞過 CN 流量"
#: htdocs/luci-static/resources/view/fchomo/global.js:763
msgid "Bypass DSCP"
msgstr "繞過 DSCP"
#: htdocs/luci-static/resources/view/fchomo/global.js:552
msgid "CORS Allow origins"
msgstr "CORS 允許的來源"
@ -440,6 +444,10 @@ msgstr "DNS 伺服器"
msgid "DNS settings"
msgstr "DNS 設定"
#: htdocs/luci-static/resources/view/fchomo/global.js:766
msgid "DSCP list"
msgstr "DSCP 清單"
#: htdocs/luci-static/resources/view/fchomo/global.js:314
msgid "Dashboard version"
msgstr "面板版本"
@ -1195,7 +1203,7 @@ msgstr "有時效能較好。"
#: htdocs/luci-static/resources/view/fchomo/node.js:532
#: htdocs/luci-static/resources/view/fchomo/server.js:332
msgid "List of supported application level protocols, in order of preference."
msgstr "支援的應用層協議協商列表,依序排列。"
msgstr "支援的應用層協議協商清單,依序排列。"
#: htdocs/luci-static/resources/view/fchomo/server.js:118
msgid "Listen address"
@ -1459,6 +1467,10 @@ msgstr "混淆密碼"
msgid "Obfuscate type"
msgstr "混淆類型"
#: htdocs/luci-static/resources/view/fchomo/global.js:772
msgid "One or more numbers in the range 0-63 separated by commas"
msgstr "0-63 範圍內的一個或多個數字,以逗號分隔"
#: htdocs/luci-static/resources/view/fchomo/global.js:658
msgid "Only process traffic from specific interfaces. Leave empty for all."
msgstr "只處理來自指定介面的流量。留空表示全部。"
@ -1822,6 +1834,11 @@ msgstr "Restls 劇本"
msgid "Routing Control"
msgstr "路由控制"
#: htdocs/luci-static/resources/view/fchomo/global.js:761
#: htdocs/luci-static/resources/view/fchomo/global.js:764
msgid "Routing DSCP"
msgstr "路由 DSCP"
#: htdocs/luci-static/resources/view/fchomo/global.js:747
msgid "Routing GFW"
msgstr "路由 GFW 流量"

View File

@ -77,12 +77,14 @@
const dnsmasq_hijacked = uci.get('dhcp', '@dnsmasq[0]', 'dns_redirect') || '0',
dnsmasq_port = uci.get('dhcp', '@dnsmasq[0]', 'port') || '53';
let client_enabled, routing_tcpport, routing_udpport, routing_mode, routing_domain;
let client_enabled, routing_tcpport, routing_udpport, routing_mode, routing_domain, routing_dscp_mode, routing_dscp_list;
client_enabled = uci.get(cfgname, 'routing', 'client_enabled') || '0',
routing_tcpport = uci.get(cfgname, 'routing', 'routing_tcpport') || null;
routing_udpport = uci.get(cfgname, 'routing', 'routing_udpport') || null;
routing_mode = uci.get(cfgname, 'routing', 'routing_mode') || null;
routing_domain = uci.get(cfgname, 'routing', 'routing_domain') || '0';
routing_dscp_mode = uci.get(cfgname, 'routing', 'routing_dscp_mode') || null;
routing_dscp_list = uci.get(cfgname, 'routing', 'routing_dscp_list') || null;
if (routing_tcpport === 'common')
routing_tcpport = common_tcpport;
@ -184,6 +186,18 @@ chain {{ inchain }} {
{% endif %}
{% endif /* routing_mode */ %}
{% if (routing_dscp_mode === 'routing_dscp'): %}
ip dscp != @routing_dscp_list counter return
{% if (global_ipv6 === '1'): %}
ip6 dscp != @routing_dscp_list counter return
{% endif %}
{% elif (routing_dscp_mode === 'bypass_dscp'): %}
ip dscp @bypass_dscp_list counter return
{% if (global_ipv6 === '1'): %}
ip6 dscp @bypass_dscp_list counter return
{% endif %}
{% endif /* routing_dscp_mode */ %}
counter goto {{ outchain }}
}
{% endfunction %}
@ -329,6 +343,23 @@ table inet fchomo {
{% endif %}
{% endif /* routing_mode */ %}
{#- Routing DSCP #}
{% if (match(routing_dscp_mode, /bypass_dscp/)): %}
set bypass_dscp_list {
type dscp
flags interval
auto-merge
elements = { {{ join(', ', split(routing_dscp_list, ',')) }} }
}
{% elif (match(routing_dscp_mode, /routing_dscp/)): %}
set routing_dscp_list {
type dscp
flags interval
auto-merge
elements = { {{ join(', ', split(routing_dscp_list, ',')) }} }
}
{% endif /* routing_dscp_mode */ %}
{#- Routing port #}
{% if (routing_tcpport): %}
set tcp_routing_port {

View File

@ -76,6 +76,8 @@ const listen_interfaces = uci.get(uciconf, uciroute, 'listen_interfaces') || nul
routing_udpport = uci.get(uciconf, uciroute, 'routing_udpport') || null,
routing_mode = uci.get(uciconf, uciroute, 'routing_mode') || null,
routing_domain = strToBool(uci.get(uciconf, uciroute, 'routing_domain')),
routing_dscp_mode = uci.get(uciconf, uciroute, 'routing_dscp_mode') || null,
routing_dscp_list = uci.get(uciconf, uciroute, 'routing_dscp_list') || null,
tposh = 'c2luZ2JveA';
/* WAN DNS server array */

View File

@ -0,0 +1,18 @@
'use strict';
'require view';
'require uci';
return view.extend({
load: function() {
return uci.load('neko');
},
render: function() {
return E('iframe', {
src: window.location.protocol + "//" + window.location.hostname + '/nekobox/configs.php',
style: 'width: 100%; min-height: 95vh; border: none; border-radius: 5px; resize: vertical;'
});
},
handleSaveApply: null,
handleSave: null,
handleReset: null
});

View File

@ -44,16 +44,10 @@ include './cfg.php';
<script type="text/javascript" src="./assets/js/feather.min.js"></script>
<script type="text/javascript" src="./assets/js/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap.min.js"></script>
<?php include './ping.php'; ?>
</head>
<body>
<div class="container-sm container-bg text-center callout border border-3 rounded-4 col-11">
<div class="row">
<a href="./index.php" class="col btn btn-lg">🏠 首页</a>
<a href="./dashboard.php" class="col btn btn-lg">📊 面板</a>
<a href="./configs.php" class="col btn btn-lg">⚙️ 配置</a>
<a href="./singbox.php" class="col btn btn-lg"></i>📦 订阅</a>
<a href="./settings.php" class="col btn btn-lg">🛠️ 设定</a>
<form action="configs.php" method="post">
<div class="container text-center justify-content-md-center" style="padding-left: 4ch; padding-right: 4ch;">
<div class="row justify-content-md-center">

View File

@ -75,7 +75,6 @@ $dash_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/dashbo
<div class="row">
<a href="./index.php" class="col btn btn-lg">🏠 首页</a>
<a href="./dashboard.php" class="col btn btn-lg">📊 面板</a>
<a href="./configs.php" class="col btn btn-lg">⚙️ 配置</a>
<a href="./singbox.php" class="col btn btn-lg">📦 订阅</a>
<a href="./settings.php" class="col btn btn-lg">🛠️ 设定</a>
</div>

View File

@ -238,31 +238,35 @@ MAX_SIZE=$max_size
crontab -l | grep -v "/etc/neko/core/set_cron.sh" | crontab -
(crontab -l 2>/dev/null; echo "$cron_schedule") | crontab -
timestamp() {
date "+%Y-%m-%d %H:%M:%S"
}
if [ -f "\$LOG_FILE" ] && [ \$(stat -c %s "\$LOG_FILE") -gt \$MAX_SIZE ]; then
echo "Log file (\$LOG_FILE) size exceeds \$MAX_SIZE bytes. Clearing logs..." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Log file (\$LOG_FILE) size exceeds \$MAX_SIZE bytes. Clearing logs..." >> /var/log/cron_debug.log 2>&1
> "\$LOG_FILE"
echo "Log file (\$LOG_FILE) cleared." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Log file (\$LOG_FILE) cleared." >> /var/log/cron_debug.log 2>&1
else
echo "Log file (\$LOG_FILE) is within the size limit, no action needed." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Log file (\$LOG_FILE) is within the size limit, no action needed." >> /var/log/cron_debug.log 2>&1
fi
if [ -f "\$TMP_LOG_FILE" ] && [ \$(stat -c %s "\$TMP_LOG_FILE") -gt \$MAX_SIZE ]; then
echo "Temp log file (\$TMP_LOG_FILE) size exceeds \$MAX_SIZE bytes. Clearing logs..." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Temp log file (\$TMP_LOG_FILE) size exceeds \$MAX_SIZE bytes. Clearing logs..." >> /var/log/cron_debug.log 2>&1
> "\$TMP_LOG_FILE"
echo "Temp log file (\$TMP_LOG_FILE) cleared." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Temp log file (\$TMP_LOG_FILE) cleared." >> /var/log/cron_debug.log 2>&1
else
echo "Temp log file (\$TMP_LOG_FILE) is within the size limit, no action needed." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Temp log file (\$TMP_LOG_FILE) is within the size limit, no action needed." >> /var/log/cron_debug.log 2>&1
fi
if [ -f "\$ADDITIONAL_LOG_FILE" ] && [ \$(stat -c %s "\$ADDITIONAL_LOG_FILE") -gt \$MAX_SIZE ]; then
echo "Additional log file (\$ADDITIONAL_LOG_FILE) size exceeds \$MAX_SIZE bytes. Clearing logs..." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Additional log file (\$ADDITIONAL_LOG_FILE) size exceeds \$MAX_SIZE bytes. Clearing logs..." >> /var/log/cron_debug.log 2>&1
> "\$ADDITIONAL_LOG_FILE"
echo "Additional log file (\$ADDITIONAL_LOG_FILE) cleared." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Additional log file (\$ADDITIONAL_LOG_FILE) cleared." >> /var/log/cron_debug.log 2>&1
else
echo "Additional log file (\$ADDITIONAL_LOG_FILE) is within the size limit, no action needed." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Additional log file (\$ADDITIONAL_LOG_FILE) is within the size limit, no action needed." >> /var/log/cron_debug.log 2>&1
fi
echo "Log rotation completed." >> /var/log/cron_debug.log 2>&1
echo "\$(timestamp) Log rotation completed." >> /var/log/cron_debug.log 2>&1
EOL;
$cronScriptPath = '/etc/neko/core/set_cron.sh';
@ -701,7 +705,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['selected_config'])) {
<div class="row">
<a href="./index.php" class="col btn btn-lg">🏠 首页</a>
<a href="./dashboard.php" class="col btn btn-lg">📊 面板</a>
<a href="./configs.php" class="col btn btn-lg">⚙️ 配置</a>
<a href="./singbox.php" class="col btn btn-lg"></i>📦 订阅</a>
<a href="./settings.php" class="col btn btn-lg">🛠️ 设定</a>
<div class="container-sm text-center col-8">

View File

@ -183,7 +183,6 @@ $razordVersion = getRazordVersion();
<div class="row">
<a href="./index.php" class="col btn btn-lg">🏠 首页</a>
<a href="./dashboard.php" class="col btn btn-lg">📊 面板</a>
<a href="./configs.php" class="col btn btn-lg">⚙️ 配置</a>
<a href="./singbox.php" class="col btn btn-lg"></i>📦 订阅</a>
<a href="./settings.php" class="col btn btn-lg">🛠️ 设定</a>
<div class="container px-4">

View File

@ -35,10 +35,19 @@
"path": "nekobox/yacd"
}
},
"admin/services/nekobox/configs": {
"title": "配置",
"order": 4,
"action": {
"type": "view",
"path": "nekobox/configs"
}
},
"admin/services/nekobox/video": {
"title": "播放器",
"order": 4,
"order": 5,
"action": {
"type": "view",
"path": "nekobox/video"
@ -47,7 +56,7 @@
"admin/services/nekobox/filekit": {
"title": "文件助手",
"order": 5,
"order": 6,
"action": {
"type": "view",
"path": "nekobox/filekit"