diff --git a/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js b/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js index 71df1fab1..a740f45ff 100644 --- a/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js +++ b/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js @@ -109,7 +109,7 @@ return view.extend({ o = s.option(form.Value, 'start_delay', _('Start Delay')); o.datatype = 'uinteger'; - o.placeholder = '0'; + o.placeholder = _('Start Immidiately'); o = s.option(form.Flag, 'scheduled_restart', _('Scheduled Restart')); o.rmempty = false; @@ -122,15 +122,53 @@ return view.extend({ o = s.option(form.Flag, 'test_profile', _('Test Profile')); o.rmempty = false; - o = s.option(form.Flag, 'fast_reload', _('Fast Reload')); - o.rmempty = false; - o = s.option(form.Flag, 'core_only', _('Core Only')); o.rmempty = false; - s = m.section(form.NamedSection, 'env', 'env', _('Core Environment Variable Config')); + s = m.section(form.NamedSection, 'procd', 'procd', _('procd Config')); - o = s.option(form.DynamicList, 'safe_paths', _('Safe Paths')); + s.tab('general', _('General Config')); + + o = s.taboption('general', form.Flag, 'fast_reload', _('Fast Reload')); + o.rmempty = false; + + s.tab('rlimit', _('RLIMIT Config')); + + o = s.taboption('rlimit', form.Value, 'rlimit_address_space_soft', _('Address Space Size Soft Limit')); + o.datatype = 'uinteger'; + o.placeholder = _('Unlimited'); + + o = s.taboption('rlimit', form.Value, 'rlimit_address_space_hard', _('Address Space Size Hard Limit')); + o.datatype = 'uinteger'; + o.placeholder = _('Unlimited'); + + o = s.taboption('rlimit', form.Value, 'rlimit_data_soft', _('Heap Size Soft Limit')); + o.datatype = 'uinteger'; + o.placeholder = _('Unlimited'); + + o = s.taboption('rlimit', form.Value, 'rlimit_data_hard', _('Heap Size Hard Limit')); + o.datatype = 'uinteger'; + o.placeholder = _('Unlimited'); + + o = s.taboption('rlimit', form.Value, 'rlimit_stack_soft', _('Stack Size Soft Limit')); + o.datatype = 'uinteger'; + o.placeholder = _('Unlimited'); + + o = s.taboption('rlimit', form.Value, 'rlimit_stack_hard', _('Stack Size Hard Limit')); + o.datatype = 'uinteger'; + o.placeholder = _('Unlimited'); + + o = s.taboption('rlimit', form.Value, 'rlimit_nofile_soft', _('Number of Open Files Soft Limit')); + o.datatype = 'uinteger'; + o.placeholder = _('Unlimited'); + + o = s.taboption('rlimit', form.Value, 'rlimit_nofile_hard', _('Number of Open Files Hard Limit')); + o.datatype = 'uinteger'; + o.placeholder = _('Unlimited'); + + s.tab('environment_variable', _('Environment Variable Config')); + + o = s.taboption('environment_variable', form.DynamicList, 'env_safe_paths', _('Safe Paths')); o.load = function (section_id) { return this.super('load', section_id)?.split(':'); }; @@ -138,16 +176,16 @@ return view.extend({ this.super('write', section_id, formvalue?.join(':')); }; - o = s.option(form.Flag, 'disable_loopback_detector', _('Disable Loopback Detector')); + o = s.taboption('environment_variable', form.Flag, 'env_disable_loopback_detector', _('Disable Loopback Detector')); o.rmempty = false; - o = s.option(form.Flag, 'disable_quic_go_gso', _('Disable GSO of quic-go')); + o = s.taboption('environment_variable', form.Flag, 'env_disable_quic_go_gso', _('Disable GSO of quic-go')); o.rmempty = false; - o = s.option(form.Flag, 'disable_quic_go_ecn', _('Disable ECN of quic-go')); + o = s.taboption('environment_variable', form.Flag, 'env_disable_quic_go_ecn', _('Disable ECN of quic-go')); o.rmempty = false; - o = s.option(form.Flag, 'skip_system_ipv6_check', _('Skip System IPv6 Check')); + o = s.taboption('environment_variable', form.Flag, 'env_skip_system_ipv6_check', _('Skip System IPv6 Check')); o.rmempty = false; return m.render(); diff --git a/luci-app-nikki/po/templates/nikki.pot b/luci-app-nikki/po/templates/nikki.pot index 7c9b14231..778067cb5 100644 --- a/luci-app-nikki/po/templates/nikki.pot +++ b/luci-app-nikki/po/templates/nikki.pot @@ -14,6 +14,14 @@ msgstr "" msgid "Access Control" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:141 +msgid "Address Space Size Hard Limit" +msgstr "" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:137 +msgid "Address Space Size Soft Limit" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/proxy.js:181 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/proxy.js:186 msgid "All Port" @@ -94,15 +102,11 @@ msgstr "" msgid "Commonly Used Port" msgstr "" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:131 -msgid "Core Environment Variable Config" -msgstr "" - #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/log.js:60 msgid "Core Log" msgstr "" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:128 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:125 msgid "Core Only" msgstr "" @@ -191,15 +195,15 @@ msgstr "" msgid "Disable" msgstr "" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:147 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:185 msgid "Disable ECN of quic-go" msgstr "" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:144 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:182 msgid "Disable GSO of quic-go" msgstr "" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:141 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:179 msgid "Disable Loopback Detector" msgstr "" @@ -316,6 +320,10 @@ msgstr "" msgid "Enable" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:169 +msgid "Environment Variable Config" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/profile.js:47 msgid "Expire At" msgstr "" @@ -340,7 +348,7 @@ msgstr "" msgid "Fake-IP Range" msgstr "" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:125 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:132 msgid "Fast Reload" msgstr "" @@ -377,6 +385,7 @@ msgstr "" msgid "GSO Max Size" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:130 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:28 msgid "General Config" msgstr "" @@ -441,6 +450,14 @@ msgstr "" msgid "HTTP Port" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:149 +msgid "Heap Size Hard Limit" +msgstr "" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:145 +msgid "Heap Size Soft Limit" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:38 msgid "How To Use" msgstr "" @@ -554,6 +571,14 @@ msgstr "" msgid "Not Running" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:165 +msgid "Number of Open Files Hard Limit" +msgstr "" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:161 +msgid "Number of Open Files Soft Limit" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:89 msgid "Open Dashboard" msgstr "" @@ -650,6 +675,10 @@ msgstr "" msgid "Proxy Provider:" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:135 +msgid "RLIMIT Config" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:98 msgid "Random" msgstr "" @@ -706,7 +735,7 @@ msgstr "" msgid "SOCKS Port" msgstr "" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:133 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:171 msgid "Safe Paths" msgstr "" @@ -723,7 +752,7 @@ msgstr "" msgid "Scroll To Bottom" msgstr "" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:150 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:188 msgid "Skip System IPv6 Check" msgstr "" @@ -747,6 +776,14 @@ msgstr "" msgid "Stack" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:157 +msgid "Stack Size Hard Limit" +msgstr "" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:153 +msgid "Stack Size Soft Limit" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:542 msgid "Standard Loader" msgstr "" @@ -755,6 +792,10 @@ msgstr "" msgid "Start Delay" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:112 +msgid "Start Immidiately" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:40 msgid "Status" msgstr "" @@ -852,6 +893,17 @@ msgstr "" msgid "Unify Delay" msgstr "" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:139 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:143 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:147 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:151 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:155 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:159 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:163 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:167 +msgid "Unlimited" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:32 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:41 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:48 @@ -953,3 +1005,7 @@ msgstr "" #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:176 msgid "Username" msgstr "" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:128 +msgid "procd Config" +msgstr "" diff --git a/luci-app-nikki/po/zh_Hans/nikki.po b/luci-app-nikki/po/zh_Hans/nikki.po index 1d849802b..c47b926d6 100644 --- a/luci-app-nikki/po/zh_Hans/nikki.po +++ b/luci-app-nikki/po/zh_Hans/nikki.po @@ -21,6 +21,14 @@ msgstr "API 密钥" msgid "Access Control" msgstr "访问控制" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:141 +msgid "Address Space Size Hard Limit" +msgstr "地址空间大小硬限制" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:137 +msgid "Address Space Size Soft Limit" +msgstr "地址空间大小软限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/proxy.js:181 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/proxy.js:186 msgid "All Port" @@ -101,15 +109,11 @@ msgstr "清空日志" msgid "Commonly Used Port" msgstr "常用端口" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:131 -msgid "Core Environment Variable Config" -msgstr "核心环境变量配置" - #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/log.js:60 msgid "Core Log" msgstr "核心日志" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:128 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:125 msgid "Core Only" msgstr "仅核心" @@ -198,15 +202,15 @@ msgstr "直连模式" msgid "Disable" msgstr "禁用" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:147 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:185 msgid "Disable ECN of quic-go" msgstr "禁用 quic-go 的显式拥塞通知" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:144 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:182 msgid "Disable GSO of quic-go" msgstr "禁用 quic-go 的通用分段卸载" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:141 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:179 msgid "Disable Loopback Detector" msgstr "禁用回环检测" @@ -323,6 +327,10 @@ msgstr "编辑器" msgid "Enable" msgstr "启用" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:169 +msgid "Environment Variable Config" +msgstr "环境变量配置" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/profile.js:47 msgid "Expire At" msgstr "到期时间" @@ -347,7 +355,7 @@ msgstr "Fake-IP Ping 劫持" msgid "Fake-IP Range" msgstr "Fake-IP 范围" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:125 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:132 msgid "Fast Reload" msgstr "快速重载" @@ -384,6 +392,7 @@ msgstr "通用分段卸载" msgid "GSO Max Size" msgstr "分段最大长度" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:130 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:28 msgid "General Config" msgstr "全局配置" @@ -448,6 +457,14 @@ msgstr "用户组" msgid "HTTP Port" msgstr "HTTP 端口" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:149 +msgid "Heap Size Hard Limit" +msgstr "堆大小硬限制" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:145 +msgid "Heap Size Soft Limit" +msgstr "堆大小软限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:38 msgid "How To Use" msgstr "使用说明" @@ -561,6 +578,14 @@ msgstr "节点" msgid "Not Running" msgstr "未在运行" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:165 +msgid "Number of Open Files Hard Limit" +msgstr "打开文件数量硬限制" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:161 +msgid "Number of Open Files Soft Limit" +msgstr "打开文件数量软限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:89 msgid "Open Dashboard" msgstr "打开面板" @@ -657,6 +682,10 @@ msgstr "代理配置" msgid "Proxy Provider:" msgstr "代理提供者:" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:135 +msgid "RLIMIT Config" +msgstr "资源限制配置" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:98 msgid "Random" msgstr "随机" @@ -713,7 +742,7 @@ msgstr "运行中" msgid "SOCKS Port" msgstr "SOCKS 端口" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:133 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:171 msgid "Safe Paths" msgstr "安全路径" @@ -730,7 +759,7 @@ msgstr "定时重启" msgid "Scroll To Bottom" msgstr "滚动到底部" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:150 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:188 msgid "Skip System IPv6 Check" msgstr "跳过系统 IPv6 检查" @@ -754,6 +783,14 @@ msgstr "嗅探器配置" msgid "Stack" msgstr "栈" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:157 +msgid "Stack Size Hard Limit" +msgstr "栈大小硬限制" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:153 +msgid "Stack Size Soft Limit" +msgstr "栈大小软限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:542 msgid "Standard Loader" msgstr "标准加载器" @@ -762,6 +799,10 @@ msgstr "标准加载器" msgid "Start Delay" msgstr "启动延迟" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:112 +msgid "Start Immidiately" +msgstr "立即启动" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:40 msgid "Status" msgstr "状态" @@ -859,6 +900,17 @@ msgstr "UI 下载地址" msgid "Unify Delay" msgstr "统一延迟" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:139 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:143 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:147 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:151 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:155 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:159 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:163 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:167 +msgid "Unlimited" +msgstr "无限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:32 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:41 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:48 @@ -960,3 +1012,7 @@ msgstr "用户代理(UA)" #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:176 msgid "Username" msgstr "用户名" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:128 +msgid "procd Config" +msgstr "procd 配置" diff --git a/luci-app-nikki/po/zh_Hant/nikki.po b/luci-app-nikki/po/zh_Hant/nikki.po index e513e3d49..fdf725255 100644 --- a/luci-app-nikki/po/zh_Hant/nikki.po +++ b/luci-app-nikki/po/zh_Hant/nikki.po @@ -21,6 +21,14 @@ msgstr "API 密鑰" msgid "Access Control" msgstr "存取控制" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:141 +msgid "Address Space Size Hard Limit" +msgstr "位址空間大小硬限制" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:137 +msgid "Address Space Size Soft Limit" +msgstr "位址空間大小軟限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/proxy.js:181 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/proxy.js:186 msgid "All Port" @@ -101,15 +109,11 @@ msgstr "清空日誌" msgid "Commonly Used Port" msgstr "常用埠" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:131 -msgid "Core Environment Variable Config" -msgstr "核心環境變數設定" - #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/log.js:60 msgid "Core Log" msgstr "核心日誌" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:128 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:125 msgid "Core Only" msgstr "僅核心" @@ -198,15 +202,15 @@ msgstr "直連模式" msgid "Disable" msgstr "停用" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:147 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:185 msgid "Disable ECN of quic-go" msgstr "停用 quic-go 的顯式擁塞通知" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:144 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:182 msgid "Disable GSO of quic-go" msgstr "停用 quic-go 的通用分段卸載" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:141 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:179 msgid "Disable Loopback Detector" msgstr "停用迴路檢測" @@ -323,6 +327,10 @@ msgstr "編輯器" msgid "Enable" msgstr "啟用" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:169 +msgid "Environment Variable Config" +msgstr "環境變數設定" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/profile.js:47 msgid "Expire At" msgstr "到期時間" @@ -347,7 +355,7 @@ msgstr "Fake-IP Ping 劫持" msgid "Fake-IP Range" msgstr "Fake-IP 範圍" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:125 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:132 msgid "Fast Reload" msgstr "快速重載" @@ -384,6 +392,7 @@ msgstr "通用分段卸載" msgid "GSO Max Size" msgstr "分段最大長度" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:130 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:28 msgid "General Config" msgstr "一般設定" @@ -448,6 +457,14 @@ msgstr "使用者群組" msgid "HTTP Port" msgstr "HTTP 埠" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:149 +msgid "Heap Size Hard Limit" +msgstr "堆積大小硬限制" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:145 +msgid "Heap Size Soft Limit" +msgstr "堆積大小軟限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:38 msgid "How To Use" msgstr "使用說明" @@ -561,6 +578,14 @@ msgstr "節點" msgid "Not Running" msgstr "未在執行" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:165 +msgid "Number of Open Files Hard Limit" +msgstr "可開啟檔案數量硬限制" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:161 +msgid "Number of Open Files Soft Limit" +msgstr "可開啟檔案數量軟限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:89 msgid "Open Dashboard" msgstr "開啟儀表板" @@ -657,6 +682,10 @@ msgstr "代理設定" msgid "Proxy Provider:" msgstr "代理提供者:" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:135 +msgid "RLIMIT Config" +msgstr "RLIMIT 設定" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:98 msgid "Random" msgstr "隨機" @@ -713,7 +742,7 @@ msgstr "執行中" msgid "SOCKS Port" msgstr "SOCKS 埠" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:133 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:171 msgid "Safe Paths" msgstr "安全路徑" @@ -730,7 +759,7 @@ msgstr "定時重新啟動" msgid "Scroll To Bottom" msgstr "捲動到底部" -#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:150 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:188 msgid "Skip System IPv6 Check" msgstr "跳過系統 IPv6 檢查" @@ -754,6 +783,14 @@ msgstr "嗅探器設定" msgid "Stack" msgstr "堆疊" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:157 +msgid "Stack Size Hard Limit" +msgstr "" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:153 +msgid "Stack Size Soft Limit" +msgstr "" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:542 msgid "Standard Loader" msgstr "標準載入器" @@ -762,6 +799,10 @@ msgstr "標準載入器" msgid "Start Delay" msgstr "啟動延遲" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:112 +msgid "Start Immidiately" +msgstr "立即啟動" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:40 msgid "Status" msgstr "狀態" @@ -859,6 +900,17 @@ msgstr "UI 下載網址" msgid "Unify Delay" msgstr "統一延遲" +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:139 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:143 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:147 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:151 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:155 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:159 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:163 +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:167 +msgid "Unlimited" +msgstr "無限制" + #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:32 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:41 #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:48 @@ -960,3 +1012,10 @@ msgstr "使用者代理(UA)" #: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/mixin.js:176 msgid "Username" msgstr "使用者名稱" + +#: applications/luci-app-nikki/htdocs/luci-static/resources/view/nikki/app.js:128 +msgid "procd Config" +msgstr "procd 設定" + +#~ msgid "Core Environment Variable Config" +#~ msgstr "核心環境變數設定" diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm index c3fc5bd2a..b24a07871 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm @@ -177,13 +177,13 @@ function import_ssr_url(btn, urlname, sid) { // 再分离 ? 或 /?(参数) var queryIndex = (url0 = url0.replace('/?', '?')).indexOf("?"); - var queryStr = ""; + var query = ""; if (queryIndex >= 0) { - queryStr = url0.substring(queryIndex + 1); + query = url0.substring(queryIndex + 1); url0 = url0.substring(0, queryIndex); } - var params = Object.fromEntries(new URLSearchParams(queryStr)); + var params = Object.fromEntries(new URLSearchParams(query)); if ( ! params.type) { // 普通 SS 导入逻辑 @@ -503,7 +503,7 @@ function import_ssr_url(btn, urlname, sid) { document.getElementsByName('cbid.shadowsocksr.' + sid + '.password')[0].value = decodeURIComponent(url.username); document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].checked = true; document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event); - document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = params.get("sni"); + document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = params.get("peer") || params.get("sni"); if (params.get("allowInsecure") === "1") { document.getElementsByName('cbid.shadowsocksr.' + sid + '.insecure')[0].checked = true; // 设置 insecure 为 true document.getElementsByName('cbid.shadowsocksr.' + sid + '.insecure')[0].dispatchEvent(event); // 触发事件 @@ -834,13 +834,13 @@ function import_ssr_url(btn, urlname, sid) { // 再分离 ? 或 /?(参数) var queryIndex = (url0 = url0.replace('/?', '?')).indexOf("?"); - var queryStr = ""; + var query = ""; if (queryIndex >= 0) { - queryStr = url0.substring(queryIndex + 1); + query = url0.substring(queryIndex + 1); url0 = url0.substring(0, queryIndex); } - var params = Object.fromEntries(new URLSearchParams(queryStr)); + var params = Object.fromEntries(new URLSearchParams(query)); var sipIndex = url0.indexOf("@"); var userInfo = url0.substring(0, sipIndex); // 格式:uuid:password diff --git a/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua b/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua index 542d63581..f8b94b0dc 100755 --- a/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua +++ b/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua @@ -318,8 +318,10 @@ local function processData(szType, content) result.xhttp_host = info.host result.xhttp_path = info.path -- 检查 extra 参数是否存在且非空 - result.enable_xhttp_extra = (info.extra and info.extra ~= "") and "1" or nil - result.xhttp_extra = (info.extra and info.extra ~= "") and info.extra or nil + if params.extra and params.extra ~= "" then + result.enable_xhttp_extra = "1" + result.xhttp_extra = params.extra + end -- 尝试解析 JSON 数据 local success, Data = pcall(jsonParse, info.extra or "") if success and type(Data) == "table" then @@ -403,16 +405,18 @@ local function processData(szType, content) local idx_sp = content:find("#") or 0 local alias = "" if idx_sp > 0 then - alias = UrlDecode(content:sub(idx_sp + 1)) + alias = content:sub(idx_sp + 1, -1) + content = content:sub(0, idx_sp - 1):gsub("/%?", "?") end - local info = content:sub(1, idx_sp > 0 and idx_sp - 1 or #content):gsub("/%?", "?") + result.alias = UrlDecode(alias) -- 拆 base64 主体和 ? 参数部分 - local uri_main, query_str = info:match("^([^?]+)%??(.*)$") - --log("SS 节点格式:", uri_main) + local info = content + local find_index, query = info:match("^([^?]+)%??(.*)$") + --log("SS 节点格式:", find_index) local params = {} - if query_str and query_str ~= "" then - for _, v in ipairs(split(query_str, '&')) do + if query and query ~= "" then + for _, v in ipairs(split(query, '&')) do local t = split(v, '=') if #t >= 2 then params[t[1]] = UrlDecode(t[2]) @@ -421,28 +425,28 @@ local function processData(szType, content) end if not params.type or params.type == "" then - local is_old_format = uri_main:find("@") and not uri_main:find("://.*@") - local base64_str, host_port, userinfo, server, port, method, password + local is_old_format = find_index:find("@") and not find_index:find("://.*@") + local old_base64, host_port, userinfo, server, port, method, password if is_old_format then -- 旧格式:base64(method:pass)@host:port - base64_str, host_port = uri_main:match("^([^@]+)@(.-)$") - log("SS 节点旧格式解析:", base64_str) - if not base64_str or not host_port then - log("SS 节点旧格式解析失败:", uri_main) + old_base64, host_port = find_index:match("^([^@]+)@(.-)$") + log("SS 节点旧格式解析:", old_base64) + if not old_base64 or not host_port then + log("SS 节点旧格式解析失败:", find_index) return nil end - local decoded = base64Decode(UrlDecode(base64_str)) + local decoded = base64Decode(UrlDecode(old_base64)) if not decoded then - log("SS base64 解码失败(旧格式):", base64_str) + log("SS base64 解码失败(旧格式):", old_base64) return nil end userinfo = decoded else -- 新格式:base64(method:pass@host:port) - local decoded = base64Decode(UrlDecode(uri_main)) + local decoded = base64Decode(UrlDecode(find_index)) if not decoded then - log("SS base64 解码失败(新格式):", uri_main) + log("SS base64 解码失败(新格式):", find_index) return nil end userinfo, host_port = decoded:match("^(.-)@(.-)$") @@ -453,13 +457,13 @@ local function processData(szType, content) end -- 解析加密方式和密码(允许密码包含冒号) - local split_pos = userinfo:find(":") - if not split_pos then + local meth_pass = userinfo:find(":") + if not meth_pass then log("SS 用户信息格式错误:", userinfo) return nil end - method = userinfo:sub(1, split_pos - 1) - password = userinfo:sub(split_pos + 1) + method = userinfo:sub(1, meth_pass - 1) + password = userinfo:sub(meth_pass + 1) -- 判断密码是否经过url编码 local function isURLEncodedPassword(pwd) @@ -492,23 +496,13 @@ local function processData(szType, content) end -- 填充 result - result.alias = alias result.type = v2_ss - result.v2ray_protocol = (v2_ss == "v2ray") and "shadowsocks" or nil result.has_ss_type = has_ss_type result.encrypt_method_ss = method result.password = password result.server = server result.server_port = port - -- 仅在 v2ray + shadowsocks 协议时处理 ECH - if v2_ss == "v2ray" and result.v2ray_protocol == "shadowsocks" then - if params.ech and params.ech ~= "" then - result.enable_ech = "1" - result.ech_config = ech - end - end - -- 插件处理 if params.plugin then local plugin_info = UrlDecode(params.plugin) @@ -573,17 +567,17 @@ local function processData(szType, content) local url = URL.parse("http://" .. info) local params = url.query - result.alias = alias - result.type = "v2ray" + v2_ss = "v2ray" + result.type = v2_ss result.v2ray_protocol = "shadowsocks" result.server = url.host result.server_port = url.port -- 判断 @ 前部分是否为 Base64 - local is_base64_decoded = base64Decode(UrlDecode(url.user)) - if is_base64_decoded:find(":") then + local is_base64 = base64Decode(UrlDecode(url.user)) + if is_base64:find(":") then -- 新格式:method:password - result.encrypt_method_ss, result.password = is_base64_decoded:match("^(.-):(.*)$") + result.encrypt_method_ss, result.password = is_base64:match("^(.-):(.*)$") else -- 旧格式:UUID 直接作为密码 result.password = url.user @@ -613,11 +607,15 @@ local function processData(szType, content) result.reality_shortid = params.sid result.reality_spiderx = params.spx and UrlDecode(params.spx) or nil -- 检查 ech 参数是否存在且非空 - result.enable_ech = (params.ech and params.ech ~= "") and "1" or nil - result.ech_config = (params.ech and params.ech ~= "") and params.ech or nil + if params.ech and params.ech ~= "" then + result.enable_ech = "1" + result.ech_config = params.ech + end -- 检查 pqv 参数是否存在且非空 - result.enable_mldsa65verify = (params.pqv and params.pqv ~= "") and "1" or nil - result.reality_mldsa65verify = (params.pqv and params.pqv ~= "") and params.pqv or nil + if params.pqv and params.pqv ~= "" then + result.enable_mldsa65verify = "1" + result.reality_mldsa65verify = params.pqv + end if result.transport == "ws" then result.ws_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil result.ws_path = params.path and UrlDecode(params.path) or "/" @@ -629,8 +627,10 @@ local function processData(szType, content) result.xhttp_mode = params.mode or "auto" result.xhttp_path = params.path and UrlDecode(params.path) or "/" -- 检查 extra 参数是否存在且非空 - result.enable_xhttp_extra = (params.extra and params.extra ~= "") and "1" or nil - result.xhttp_extra = (params.extra and params.extra ~= "") and params.extra or nil + if params.extra and params.extra ~= "" then + result.enable_xhttp_extra = "1" + result.xhttp_extra = params.extra + end -- 尝试解析 JSON 数据 local success, Data = pcall(jsonParse, params.extra or "") if success and type(Data) == "table" then @@ -703,90 +703,67 @@ local function processData(szType, content) result.server = nil end elseif szType == "trojan" then - local params = {} - local idx_sp = 0 - local alias = "" - -- 提取别名(如果存在) + local alias = "" if content:find("#") then - idx_sp = content:find("#") + local idx_sp = content:find("#") alias = content:sub(idx_sp + 1, -1) + content = content:sub(0, idx_sp - 1) end - local info = content:sub(1, idx_sp > 0 and idx_sp - 1 or #content):gsub("/%?", "?") - local paramStr = "" - - if info:find("?") then - paramStr = info:match("%?(.*)$") or "" - info = info:gsub("%?.*$", "") -- 去掉 ? 后的参数部分 - end - - -- 解析 query 参数(key=value&key2=value2) - for k, v in paramStr:gmatch("([^&=?]+)=([^&=?]+)") do - params[k] = UrlDecode(v) - end - - local hostInfo = split(info, "@") - - -- 基础验证 - if #hostInfo < 2 then - --log("Trojan节点格式错误: 缺少@符号") - return nil - end - - local userinfo = hostInfo[1] - local hostPort = hostInfo[2] - - -- 分离服务器地址和端口 - local hostParts = split(hostPort, ":") - - -- 验证服务器地址和端口 - if #hostParts < 2 then - --log("Trojan节点格式错误: 缺少端口号") - return nil - end - - local server = hostParts[1] - local port = hostParts[2] - result.alias = UrlDecode(alias) - result.server = server - result.password = userinfo - -- 默认设置 - -- 按照官方的建议 默认验证ssl证书 - result.insecure = "0" - result.tls = "1" + -- 分离和提取 password + local Info = content + local params = {} + if Info:find("@") then + local contents = split(Info, "@") + result.password = UrlDecode(contents[1]) + local port = "443" + Info = (contents[2] or ""):gsub("/%?", "?") - -- 解析查询参数(如果存在) - if port:find("?") then - local queryParts = split(port, "?") - result.server_port = queryParts[1] - - -- 解析查询参数 - for _, v in pairs(split(queryParts[2], "&")) do - local t = split(v, "=") - if #t >= 2 then - params[t[1]] = t[2] + -- 分离主机和 query 参数(key=value&key2=value2) + local query = split(Info, "%?") + local host_port = query[1] + for _, v in pairs(split(query[2], '&')) do + local t = split(v, '=') + if #t > 1 then + params[string.lower(t[1])] = UrlDecode(t[2]) end end + -- 提取服务器地址和端口 + if host_port:find(":") then + local sp = split(host_port, ":") + result.server_port = sp[#sp] + result.server = sp[1] + else + result.server = host_port + end + + -- 默认设置 + -- 按照官方的建议 默认验证ssl证书 + result.insecure = "0" + result.tls = "1" + -- 处理参数 if params.alpn then -- 处理 alpn 参数 result.tls_alpn = params.alpn end - - if params.sni then + if params.peer or params.sni then -- 未指定peer(sni)默认使用remote addr - result.tls_host = params.sni + result.tls_host = params.peer or params.sni end - if params.allowInsecure then -- 处理 insecure 参数 - result.insecure = params.allowInsecure + if params.allowinsecure == "1" or params.allowinsecure == "0" then + result.insecure = params.allowInsecure + else + result.insecure = string.lower(params.allowinsecure) == "true" and "1" or "0" + end end if params.tfo then - -- 处理 insecure 参数 + -- 处理 fast open 参数 result.fast_open = params.tfo end else @@ -831,8 +808,10 @@ local function processData(szType, content) result.xhttp_mode = params.mode or "auto" result.xhttp_path = params.path and UrlDecode(params.path) or "/" -- 检查 extra 参数是否存在且非空 - result.enable_xhttp_extra = (params.extra and params.extra ~= "") and "1" or nil - result.xhttp_extra = (params.extra and params.extra ~= "") and params.extra or nil + if params.extra and params.extra ~= "" then + result.enable_xhttp_extra = "1" + result.xhttp_extra = params.extra + end -- 尝试解析 JSON 数据 local success, Data = pcall(jsonParse, params.extra or "") if success and type(Data) == "table" then @@ -908,11 +887,15 @@ local function processData(szType, content) result.reality_shortid = params.sid result.reality_spiderx = params.spx and UrlDecode(params.spx) or nil -- 检查 ech 参数是否存在且非空 - result.enable_ech = (params.ech and params.ech ~= "") and "1" or nil - result.ech_config = (params.ech and params.ech ~= "") and params.ech or nil + if params.ech and params.ech ~= "" then + result.enable_ech = "1" + result.ech_config = params.ech + end -- 检查 pqv 参数是否存在且非空 - result.enable_mldsa65verify = (params.pqv and params.pqv ~= "") and "1" or nil - result.reality_mldsa65verify = (params.pqv and params.pqv ~= "") and params.pqv or nil + if params.pqv and params.pqv ~= "" then + result.enable_mldsa65verify = "1" + result.reality_mldsa65verify = params.pqv + end if result.transport == "ws" then result.ws_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil result.ws_path = params.path and UrlDecode(params.path) or "/" @@ -924,8 +907,10 @@ local function processData(szType, content) result.xhttp_mode = params.mode or "auto" result.xhttp_path = params.path and UrlDecode(params.path) or "/" -- 检查 extra 参数是否存在且非空 - result.enable_xhttp_extra = (params.extra and params.extra ~= "") and "1" or nil - result.xhttp_extra = (params.extra and params.extra ~= "") and params.extra or nil + if params.extra and params.extra ~= "" then + result.enable_xhttp_extra = "1" + result.xhttp_extra = params.extra + end -- 尝试解析 JSON 数据 local success, Data = pcall(jsonParse, params.extra or "") if success and type(Data) == "table" then @@ -965,64 +950,48 @@ local function processData(szType, content) end end elseif szType == "tuic" then - local params = {} - local idx_sp = 0 - local alias = "" - -- 提取别名(如果存在) + local alias = "" if content:find("#") then - idx_sp = content:find("#") + local idx_sp = content:find("#") alias = content:sub(idx_sp + 1, -1) + content = content:sub(0, idx_sp - 1) end - local info = content:sub(1, idx_sp > 0 and idx_sp - 1 or #content):gsub("/%?", "?") - local paramStr = "" + result.alias = UrlDecode(alias) - if info:find("?") then - paramStr = info:match("%?(.*)$") or "" - info = info:gsub("%?.*$", "") -- 去掉 ? 后的参数部分 + -- 分离和提取 uuid 和 password + local Info = content + if Info:find("@") then + local contents = split(Info, "@") + if contents[1]:find(":") then + local userinfo = split(contents[1], ":") + result.tuic_uuid = UrlDecode(userinfo[1]) + result.tuic_passwd = UrlDecode(userinfo[2]) + end + Info = (contents[2] or ""):gsub("/%?", "?") end - -- 解析 query 参数(key=value&key2=value2) - for k, v in paramStr:gmatch("([^&=?]+)=([^&=?]+)") do - params[k] = UrlDecode(v) + -- 分离主机和 query 参数(key=value&key2=value2) + local query = split(Info, "%?") + local host_port = query[1] + local params = {} + for _, v in pairs(split(query[2], '&')) do + local t = split(v, '=') + if #t > 1 then + params[string.lower(t[1])] = UrlDecode(t[2]) + end end - local hostInfo = split(info, "@") - -- 基础验证 - if #hostInfo < 2 then - log("TUIC 节点格式错误: 缺少 @") - return nil + -- 提取服务器地址和端口 + if host_port:find(":") then + local sp = split(host_port, ":") + result.server_port = sp[#sp] + result.server = sp[1] + else + result.server = host_port end - local userinfo = hostInfo[1] - local hostPort = hostInfo[2] - - -- 分离 uuid 和 password - local userInfoSplit = split(userinfo, ":") - if #userInfoSplit < 2 then - log("TUIC 节点格式错误: 用户信息不完整") - return nil - end - local uuid = userInfoSplit[1] - local password = userInfoSplit[2] - - -- 分离服务器地址和端口 - local hostParts = split(hostPort, ":") - -- 验证服务器地址和端口 - if #hostParts < 2 then - log("TUIC 节点格式错误: 缺少端口号") - return nil - end - local server = hostParts[1] - local port = hostParts[2] - result.type = tuic_type - result.alias = UrlDecode(alias) - result.server = server - result.server_port = port - result.tuic_uuid = uuid - result.tuic_passwd = password - result.tuic_ip = params.sni or "" result.udp_relay_mode = params.udp_relay_mode or "native" result.congestion_control = params.congestion_control or "cubic" diff --git a/nikki/files/nikki.conf b/nikki/files/nikki.conf index 3eaf5b7fb..55c0db6de 100644 --- a/nikki/files/nikki.conf +++ b/nikki/files/nikki.conf @@ -8,14 +8,14 @@ config config 'config' option 'scheduled_restart' '0' option 'cron_expression' '0 3 * * *' option 'test_profile' '1' - option 'fast_reload' '0' option 'core_only' '0' -config env 'env' - option 'disable_loopback_detector' '0' - option 'disable_quic_go_gso' '0' - option 'disable_quic_go_ecn' '0' - option 'skip_system_ipv6_check' '0' +config procd 'procd' + option 'fast_reload' '0' + option 'env_disable_loopback_detector' '0' + option 'env_disable_quic_go_gso' '0' + option 'env_disable_quic_go_ecn' '0' + option 'env_skip_system_ipv6_check' '0' config subscription 'subscription' option 'name' 'default' diff --git a/nikki/files/nikki.init b/nikki/files/nikki.init index b84739e70..e40b5c71c 100644 --- a/nikki/files/nikki.init +++ b/nikki/files/nikki.init @@ -47,6 +47,12 @@ start_service() { # start log "App" "Enabled." log "App" "Start." + # check if executable + if [ ! -x $PROG ]; then + log "App" "Core is not executable." + log "App" "Exit." + return + fi # get config ## app config local scheduled_restart cron_expression profile test_profile fast_reload core_only @@ -54,15 +60,27 @@ start_service() { config_get cron_expression "config" "cron_expression" config_get profile "config" "profile" config_get_bool test_profile "config" "test_profile" 0 - config_get_bool fast_reload "config" "fast_reload" 0 config_get_bool core_only "config" "core_only" 0 - ## environment variable - local safe_paths disable_loopback_detector disable_quic_go_gso disable_quic_go_ecn skip_system_ipv6_check - config_get safe_paths "env" "safe_paths" - config_get_bool disable_loopback_detector "env" "disable_loopback_detector" 0 - config_get_bool disable_quic_go_gso "env" "disable_quic_go_gso" 0 - config_get_bool disable_quic_go_ecn "env" "disable_quic_go_ecn" 0 - config_get_bool skip_system_ipv6_check "env" "skip_system_ipv6_check" 0 + ## procd config + ### fast reload + config_get_bool fast_reload "procd" "fast_reload" 0 + ### rlimit + local rlimit_address_space_soft rlimit_address_space_hard rlimit_data_soft rlimit_data_hard rlimit_stack_soft rlimit_stack_hard rlimit_nofile_soft rlimit_nofile_hard + config_get rlimit_address_space_soft "procd" "rlimit_address_space_soft" + config_get rlimit_address_space_hard "procd" "rlimit_address_space_hard" + config_get rlimit_data_soft "procd" "rlimit_data_soft" + config_get rlimit_data_hard "procd" "rlimit_data_hard" + config_get rlimit_stack_soft "procd" "rlimit_stack_soft" + config_get rlimit_stack_hard "procd" "rlimit_stack_hard" + config_get rlimit_nofile_soft "procd" "rlimit_nofile_soft" + config_get rlimit_nofile_hard "procd" "rlimit_nofile_hard" + ### environment variable + local env_safe_paths env_disable_loopback_detector env_disable_quic_go_gso env_disable_quic_go_ecn env_skip_system_ipv6_check + config_get env_safe_paths "procd" "env_safe_paths" + config_get_bool env_disable_loopback_detector "procd" "env_disable_loopback_detector" 0 + config_get_bool env_disable_quic_go_gso "procd" "env_disable_quic_go_gso" 0 + config_get_bool env_disable_quic_go_ecn "procd" "env_disable_quic_go_ecn" 0 + config_get_bool env_skip_system_ipv6_check "procd" "env_skip_system_ipv6_check" 0 ## mixin config ### overwrite local overwrite_authentication overwrite_tun_dns_hijack overwrite_fake_ip_filter overwrite_hosts overwrite_dns_nameserver overwrite_dns_nameserver_policy overwrite_sniffer_sniff overwrite_sniffer_force_domain_name overwrite_sniffer_ignore_domain_name @@ -210,18 +228,20 @@ start_service() { procd_set_param command /bin/sh -c "$PROG -d $RUN_DIR >> $CORE_LOG_PATH 2>&1" procd_set_param file "$RUN_PROFILE_PATH" - procd_append_param env SAFE_PATHS="$safe_paths" - procd_append_param env DISABLE_LOOPBACK_DETECTOR="$disable_loopback_detector" - procd_append_param env QUIC_GO_DISABLE_GSO="$disable_quic_go_gso" - procd_append_param env QUIC_GO_DISABLE_ECN="$disable_quic_go_ecn" - procd_append_param env SKIP_SYSTEM_IPV6_CHECK="$skip_system_ipv6_check" + procd_append_param env SAFE_PATHS="$env_safe_paths" + procd_append_param env DISABLE_LOOPBACK_DETECTOR="$env_disable_loopback_detector" + procd_append_param env QUIC_GO_DISABLE_GSO="$env_disable_quic_go_gso" + procd_append_param env QUIC_GO_DISABLE_ECN="$env_disable_quic_go_ecn" + procd_append_param env SKIP_SYSTEM_IPV6_CHECK="$env_skip_system_ipv6_check" if [ "$fast_reload" = 1 ]; then procd_set_param reload_signal HUP fi procd_set_param pidfile "$PID_FILE_PATH" procd_set_param respawn - procd_append_param limits core="unlimited" - procd_append_param limits nofile="1048576 1048576" + procd_append_param limits as="${rlimit_address_space_soft:-unlimited} ${rlimit_address_space_hard:-unlimited}" + procd_append_param limits data="${rlimit_data_soft:-unlimited} ${rlimit_data_hard:-unlimited}" + procd_append_param limits stack="${rlimit_stack_soft:-unlimited} ${rlimit_stack_hard:-unlimited}" + procd_append_param limits nofile="${rlimit_nofile_soft:-unlimited} ${rlimit_nofile_hard:-unlimited}" procd_close_instance # cron @@ -290,7 +310,7 @@ service_started() { if [ "$tun_enable" = 1 ]; then log "Proxy" "Waiting for tun device online within $tun_timeout seconds..." while [ "$tun_timeout" -gt 0 ]; do - if ip -j link show dev "$tun_device" 2>/dev/null | jsonfilter -q -e "@[@['flags'][@='UP']]"; then + if ip -j link show dev "$tun_device" 2>/dev/null | jsonfilter -q -e "@[@['flags'][@='UP']]" > /dev/null 2>&1; then log "Proxy" "TUN device is online." break fi diff --git a/nikki/files/uci-defaults/migrate.sh b/nikki/files/uci-defaults/migrate.sh index 7313e4dd8..1eee74e06 100644 --- a/nikki/files/uci-defaults/migrate.sh +++ b/nikki/files/uci-defaults/migrate.sh @@ -199,6 +199,18 @@ proxy_bypass_china_mainland_ip6=$(uci -q get nikki.proxy.bypass_china_mainland_i routing_tproxy_fw_mask=$(uci -q get nikki.routing.tproxy_fw_mask); [ -z "$routing_tproxy_fw_mask" ] && uci set nikki.routing.tproxy_fw_mask=0xFF routing_tun_fw_mask=$(uci -q get nikki.routing.tun_fw_mask); [ -z "$routing_tun_fw_mask" ] && uci set nikki.routing.tun_fw_mask=0xFF +procd=$(uci -q get nikki.procd); [ -z "$procd" ] && { + uci set nikki.procd=procd + uci set nikki.procd.fast_reload=$(uci -q get nikki.config.fast_reload) + uci set nikki.procd.env_safe_paths=$(uci -q get nikki.env.safe_paths) + uci set nikki.procd.env_disable_loopback_detector=$(uci -q get nikki.env.disable_loopback_detector) + uci set nikki.procd.env_disable_quic_go_gso=$(uci -q get nikki.env.disable_quic_go_gso) + uci set nikki.procd.env_disable_quic_go_ecn=$(uci -q get nikki.env.disable_quic_go_ecn) + uci set nikki.procd.env_skip_system_ipv6_check=$(uci -q get nikki.env.skip_system_ipv6_check) + uci del nikki.config.fast_reload + uci del nikki.env +} + # commit uci commit nikki diff --git a/v2ray-core/Makefile b/v2ray-core/Makefile index 5c146b0c6..a6ad441c0 100644 --- a/v2ray-core/Makefile +++ b/v2ray-core/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray-core -PKG_VERSION:=5.40.0 +PKG_VERSION:=5.41.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=14e333c7454781f0b44fe9cba1616e25accfb04cf0d9d31db7acdd33e2e8d0ac +PKG_HASH:=c67caa2d73f35a9562ecaeb5184733c943c9dafb47e8f1cfeacb892a9247e9b5 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/v2ray-plugin/Makefile b/v2ray-plugin/Makefile index e0b66a0d3..55ae19c90 100644 --- a/v2ray-plugin/Makefile +++ b/v2ray-plugin/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray-plugin -PKG_VERSION:=5.40.0 +PKG_VERSION:=5.41.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/teddysun/v2ray-plugin/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=4c13f0bfa8217bdb81cf82c5d138a55833d10191cf0347b85f7633c68d5da819 +PKG_HASH:=75d83f24e60fb7e71e7774732f6ebcfbc00a1b3ae27f4702f75afb14055ce606 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE