├── .gitignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── luasrc ├── controller │ └── kcptun.lua ├── model │ ├── cbi │ │ └── kcptun │ │ │ ├── servers-detail.lua │ │ │ ├── servers.lua │ │ │ └── settings.lua │ └── kcptun.lua └── view │ └── kcptun │ ├── log_view.htm │ └── status.htm ├── po ├── templates │ └── kcptun.pot ├── zh-cn │ └── kcptun.po └── zh_Hans │ └── kcptun.po └── root └── etc ├── config └── kcptun ├── init.d └── kcptun └── uci-defaults └── 40_luci-kcptun /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.bak 3 | *.lmo 4 | *.po~ 5 | *.ipk 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | os: linux 3 | notifications: 4 | email: false 5 | language: c 6 | compiler: gcc 7 | cache: 8 | ccache: true 9 | directories: 10 | - "$HOME/dl" 11 | - "$HOME/files" 12 | - "$HOME/feeds" 13 | git: 14 | depth: 3 15 | submodules: false 16 | env: 17 | global: 18 | - PACKAGE=luci-app-kcptun 19 | - DOWNLOAD_DIR=${HOME}/files 20 | - SDK_PATH=https://downloads.openwrt.org/releases/18.06.8/targets/x86/64 21 | - SDK=-sdk-18.06.8-x86-64_ 22 | - CONFIG_CCACHE=y 23 | install: 24 | - mkdir -p "$HOME/files" && cd "$HOME/files" 25 | - wget "$SDK_PATH/sha256sums" -O sha256sums 26 | - | 27 | if ! grep -- "$SDK" sha256sums > sha256sums.small 2>/dev/null ; then 28 | printf "\033[1;31m=== Can not find ${SDK} file in sha256sums.\033[m\n" 29 | exit 1 30 | fi 31 | - export SDK_FILE="$(cat sha256sums.small | cut -d' ' -f2 | sed 's/*//g')" 32 | - | 33 | if ! sha256sum -c ./sha256sums.small 2>/dev/null ; then 34 | wget "$SDK_PATH/$SDK_FILE" -O "$SDK_FILE" 35 | if ! sha256sum -c ./sha256sums.small 2>/dev/null ; then 36 | printf "\033[1;31m=== SDK can not be verified!\033[m\n" 37 | exit 1 38 | fi 39 | fi 40 | - file "$HOME/files/$SDK_FILE" 41 | - export SDK_HOME="$(mktemp -d)" 42 | - cd "$SDK_HOME" 43 | - tar -Jxf "$HOME/files/$SDK_FILE" --strip=1 44 | - test -d "$HOME/dl" || mkdir -p "$HOME/dl" 45 | - test -d "dl" && rm -rf dl || true 46 | - test -d "feeds" && rm -rf feeds || true 47 | - ln -s "$HOME/dl" dl 48 | - ln -s "$HOME/feeds" feeds 49 | - echo "src-git base https://github.com/openwrt/openwrt.git" >feeds.conf 50 | - echo "src-git packages https://github.com/openwrt/packages.git" >>feeds.conf 51 | - echo "src-git luci https://github.com/openwrt/luci.git" >>feeds.conf 52 | - echo "src-git routing https://git.openwrt.org/feed/routing.git" >>feeds.conf 53 | - echo "src-git telephony https://github.com/openwrt/telephony.git" >>feeds.conf 54 | - ln -s "$TRAVIS_BUILD_DIR" "package/$PACKAGE" 55 | script: 56 | - cd "$SDK_HOME" 57 | - "./scripts/feeds update -a >/dev/null" 58 | - "./scripts/feeds install -a >/dev/null" 59 | - make defconfig 60 | - make package/$PACKAGE/{clean,compile} V=s 61 | - find "$SDK_HOME/bin/" 62 | - find "$SDK_HOME/bin/" -name luci-*-kcptun*.ipk -exec cp {} "$TRAVIS_BUILD_DIR" 63 | \; 64 | - ls -hl "$TRAVIS_BUILD_DIR" | grep .*\.ipk 65 | deploy: 66 | provider: releases 67 | file_glob: true 68 | file: "$TRAVIS_BUILD_DIR/*.ipk" 69 | cleanup: false 70 | edge: true 71 | token: $GITHUB_TOKEN 72 | on: 73 | tags: true 74 | all_branches: true 75 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016-2020 Xingwang Liao 3 | # Licensed to the public under the Apache License 2.0. 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | PKG_NAME:=luci-app-kcptun 9 | PKG_VERSION:=1.5.3 10 | PKG_RELEASE:=1 11 | 12 | PKG_LICENSE:=Apache-2.0 13 | PKG_MAINTAINER:=Xingwang Liao 14 | 15 | LUCI_TITLE:=LuCI support for Kcptun 16 | LUCI_DEPENDS:=+jshn +iptables +iptables-mod-tproxy 17 | LUCI_PKGARCH:=all 18 | 19 | define Package/$(PKG_NAME)/conffiles 20 | /etc/config/kcptun 21 | endef 22 | 23 | include $(TOPDIR)/feeds/luci/luci.mk 24 | 25 | define Package/$(PKG_NAME)/postinst 26 | #!/bin/sh 27 | if [ -z "$${IPKG_INSTROOT}" ]; then 28 | ( . /etc/uci-defaults/40_luci-kcptun ) && rm -f /etc/uci-defaults/40_luci-kcptun 29 | fi 30 | 31 | chmod 755 "$${IPKG_INSTROOT}/etc/init.d/kcptun" >/dev/null 2>&1 32 | ln -sf "../init.d/kcptun" \ 33 | "$${IPKG_INSTROOT}/etc/rc.d/S99kcptun" >/dev/null 2>&1 34 | exit 0 35 | endef 36 | 37 | # call BuildPackage - OpenWrt buildroot signature 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # luci-app-kcptun 2 | 3 | Luci support for kcptun 4 | 5 | OpenWrt/LEDE 上的 Kcptun Luci 支持界面 6 | 7 | [![Release Version](https://img.shields.io/github/release/kuoruan/luci-app-kcptun.svg)](https://github.com/kuoruan/luci-app-kcptun/releases/latest) [![Latest Release Download](https://img.shields.io/github/downloads/kuoruan/luci-app-kcptun/latest/total.svg)](https://github.com/kuoruan/luci-app-kcptun/releases/latest) 8 | 9 | ## 安装说明 10 | 11 | 1. 到 [release](https://github.com/kuoruan/luci-app-kcptun/releases) 页面下载最新版 luci-app-kcptun 和 luci-i18n-kcptun-zh-cn (简体中文翻译文件) 12 | 2. 将下载好的 ipk 文件上传到路由器任意目录下, 如 /tmp 13 | 3. 先安装 luci-app-kcptun 再安装 luci-i18n-kcptun-zh-cn 14 | 15 | ```sh 16 | opkg install luci-app-kcptun_*.ipk 17 | opkg install luci-i18n-kcptun-zh-cn_*.ipk 18 | ``` 19 | 20 | 安装好 LuCI 之后,进入配置页面,会提示 ```客户端文件配置有误```。 21 | 22 | 若路由器上已经有 Kcptun 客户端,直接配置好路径即可;如果没有,请手动下载后上传到路由器。 23 | 24 | ## 客户端文件下载 25 | 26 | 1. OpenWrt 可用的 Kcptun:[https://github.com/kuoruan/openwrt-kcptun](https://github.com/kuoruan/openwrt-kcptun) 27 | 28 | 2. 官方版本: [https://github.com/xtaci/kcptun/releases](https://github.com/xtaci/kcptun/releases) 29 | 30 | ## 编译说明 31 | 32 | 下载 OpenWrt SDK 或者完整源码,进入根目录,运行命令下载 ```luci-app-kcptun``` 源码 33 | 34 | ```sh 35 | git clone https://github.com/kuoruan/luci-app-kcptun.git package/luci-app-kcptun 36 | ``` 37 | 38 | 然后按照正常的编译流程: 39 | 40 | ```sh 41 | ./scripts/feeds update luci-app-kcptun 42 | ./scripts/feeds install luci-app-kcptun 43 | 44 | make menuconfig 45 | make 46 | ``` 47 | 48 | ## 卸载说明 49 | 50 | 卸载时需要先卸载 luci-i18n-kcptun-zh-cn, 再卸载 luci-app-kcptun 51 | 52 | ```sh 53 | opkg remove luci-i18n-kcptun-zh-cn 54 | opkg remove luci-app-kcptun 55 | ``` 56 | -------------------------------------------------------------------------------- /luasrc/controller/kcptun.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2016-2020 Xingwang Liao 2 | -- Licensed to the public under the Apache License 2.0. 3 | 4 | module("luci.controller.kcptun", package.seeall) 5 | 6 | local http = require "luci.http" 7 | local kcp = require "luci.model.kcptun" 8 | 9 | function index() 10 | if not nixio.fs.access("/etc/config/kcptun") then 11 | return 12 | end 13 | 14 | entry({"admin", "services", "kcptun"}, 15 | firstchild(), _("Kcptun Client")).dependent = false 16 | 17 | entry({"admin", "services", "kcptun", "settings"}, 18 | cbi("kcptun/settings"), _("Settings"), 1) 19 | 20 | entry({"admin", "services", "kcptun", "servers"}, 21 | arcombine(cbi("kcptun/servers"), cbi("kcptun/servers-detail")), 22 | _("Server Manage"), 2).leaf = true 23 | 24 | entry({"admin", "services", "kcptun", "log"}, 25 | template("kcptun/log_view"), _("Log"), 3) 26 | 27 | entry({"admin", "services", "kcptun", "status"}, call("action_status")) 28 | 29 | entry({"admin", "services", "kcptun", "log", "data"}, call("action_log_data")) 30 | 31 | entry({"admin", "services", "kcptun", "log", "clear"}, call("action_log_clear")).leaf = true 32 | end 33 | 34 | function action_status() 35 | local client_file = kcp.get_config_option("client_file") 36 | local running = kcp.is_running(client_file) 37 | 38 | http.prepare_content("application/json") 39 | http.write_json({ 40 | client = running 41 | }) 42 | end 43 | 44 | function action_log_data() 45 | local util = require "luci.util" 46 | 47 | local log_data = { client = "", syslog = "" } 48 | 49 | local enable_logging = kcp.get_config_option("enable_logging", "0") == "1" 50 | 51 | if enable_logging then 52 | local client_log_file = kcp.get_current_log_file("client") 53 | log_data.client = util.trim( 54 | util.exec("tail -n 50 %s 2>/dev/null | sed 'x;1!H;$!d;x'" % client_log_file)) 55 | end 56 | 57 | log_data.syslog = util.trim( 58 | util.exec("logread | grep kcptun | tail -n 50 | sed 'x;1!H;$!d;x'")) 59 | 60 | http.prepare_content("application/json") 61 | http.write_json(log_data) 62 | end 63 | 64 | function action_log_clear(type) 65 | if type and type ~= "" then 66 | local fs = require "nixio.fs" 67 | 68 | local log_file = kcp.get_current_log_file(type) 69 | 70 | if fs.access(log_file) then 71 | fs.writefile(log_file, "") 72 | else 73 | http.status(404, "Not found") 74 | return 75 | end 76 | end 77 | 78 | http.prepare_content("application/json") 79 | http.write_json({ code = 0 }) 80 | end 81 | -------------------------------------------------------------------------------- /luasrc/model/cbi/kcptun/servers-detail.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2016-2020 Xingwang Liao 2 | -- Licensed to the public under the Apache License 2.0. 3 | 4 | local dsp = require "luci.dispatcher" 5 | 6 | local m, s, o 7 | local sid = arg[1] 8 | 9 | local encrypt_methods = { 10 | "aes", 11 | "aes-128", 12 | "aes-192", 13 | "salsa20", 14 | "blowfish", 15 | "twofish", 16 | "cast5", 17 | "3des", 18 | "tea", 19 | "xtea", 20 | "xor", 21 | "none", 22 | } 23 | 24 | local modes = { 25 | "normal", 26 | "fast", 27 | "fast2", 28 | "fast3", 29 | "manual", 30 | } 31 | 32 | m = Map("kcptun", "%s - %s" % { translate("Kcptun"), translate("Edit Server") }) 33 | m.redirect = dsp.build_url("admin/services/kcptun/servers") 34 | 35 | if m.uci:get("kcptun", sid) ~= "servers" then 36 | luci.http.redirect(m.redirect) 37 | return 38 | end 39 | 40 | s = m:section(NamedSection, sid, "servers") 41 | s.anonymous = true 42 | s.addremove = false 43 | 44 | o = s:option(Value, "alias", "%s (%s)" % { translate("Alias"), translate("optional") }) 45 | 46 | o = s:option(Value, "server_addr", translate("Server")) 47 | o.datatype = "host" 48 | o.rmempty = false 49 | 50 | o = s:option(Value, "server_port", translate("Server Port")) 51 | o.datatype = "port" 52 | o.placeholder = "29900" 53 | 54 | o = s:option(Value, "listen_addr", "%s (%s)" % { translate("Local Listen Host"), translate("optional") }, 55 | translate("Local listen host.")) 56 | o.datatype = "host" 57 | o.placeholder = "0.0.0.0" 58 | 59 | o = s:option(Value, "listen_port", translate("Local Port"), translate("Local Listen Port.")) 60 | o.datatype = "port" 61 | o.placeholder = "12948" 62 | 63 | o = s:option(Value, "key", "%s (%s)" % { translate("Key"), translate("optional") }, 64 | translate("Pre-shared secret for client and server.")) 65 | o.password = true 66 | o.placeholder = "it's a secret" 67 | 68 | o = s:option(Value, "crypt", translate("crypt"), translate("Encrypt Method")) 69 | for _, v in ipairs(encrypt_methods) do 70 | o:value(v, v:upper()) 71 | end 72 | o.default = "aes" 73 | 74 | o = s:option(ListValue, "mode", translate("mode"), translate("Embedded Mode")) 75 | for _, v in ipairs(modes) do 76 | o:value(v, v:upper()) 77 | end 78 | o.default = "fast" 79 | 80 | o = s:option(Flag, "nodelay", translate("nodelay"), translate("Enable nodelay Mode.")) 81 | o:depends("mode", "manual") 82 | 83 | o = s:option(Value, "interval", translate("interval")) 84 | o:depends("mode", "manual") 85 | o.datatype = "uinteger" 86 | o.placeholder = "50" 87 | 88 | o = s:option(ListValue, "resend", translate("resend")) 89 | o:depends("mode", "manual") 90 | o:value("0", translate("Off")) 91 | o:value("1", translate("On")) 92 | o:value("2", translate("2nd ACK")) 93 | 94 | o = s:option(Flag, "nc", translate("nc")) 95 | o:depends("mode", "manual") 96 | 97 | o = s:option(Value, "mtu", "%s (%s)" % { translate("mtu"), translate("optional") }, 98 | translate("Maximum transmission unit of UDP packets.")) 99 | o.datatype = "range(64,9200)" 100 | o.placeholder = "1350" 101 | 102 | o = s:option(Value, "sndwnd", "%s (%s)" % { translate("sndwnd"), translate("optional") }, 103 | translate("Send Window Size(num of packets).")) 104 | o.datatype = "min(1)" 105 | o.default = "128" 106 | o.placeholder = "128" 107 | 108 | o = s:option(Value, "rcvwnd", "%s (%s)" % { translate("rcvwnd"), translate("optional") }, 109 | translate("Receive Window Size(num of packets).")) 110 | o.datatype = "min(1)" 111 | o.default = "512" 112 | o.placeholder = "512" 113 | 114 | o = s:option(Value, "datashard", "%s (%s)" % { translate("datashard"), translate("optional") }, 115 | translate("Reed-solomon Erasure Coding - datashard.")) 116 | o.datatype = "uinteger" 117 | o.placeholder = "10" 118 | 119 | o = s:option(Value, "parityshard", "%s (%s)" % { translate("parityshard"), translate("optional") }, 120 | translate("Reed-solomon Erasure Coding - parityshard.")) 121 | o.datatype = "uinteger" 122 | o.placeholder = "3" 123 | 124 | o = s:option(Value, "dscp", "%s (%s)" % { translate("dscp"), translate("optional") }, translate("DSCP(6bit)")) 125 | o.datatype = "uinteger" 126 | o.placeholder = "0" 127 | 128 | o = s:option(Flag, "nocomp", translate("nocomp"), translate("Disable Compression?")) 129 | o.enabled = "true" 130 | o.disabled = "false" 131 | o.rmempty = false 132 | 133 | o = s:option(Flag, "quiet", translate("quiet"), translate("Suppress the 'stream open/close' messages")) 134 | o.enabled = "true" 135 | o.disabled = "false" 136 | o.rmempty = false 137 | 138 | o = s:option(Flag, "tcp", translate("tcp"), translate("TCP transmission")) 139 | o.enabled = "true" 140 | o.disabled = "false" 141 | o.rmempty = false 142 | 143 | o = s:option(Flag, "acknodelay", translate("acknodelay")) 144 | o.enabled = "true" 145 | o.disabled = "false" 146 | 147 | o = s:option(Value, "conn", "%s (%s)" %{ translate("conn"), translate("optional") }, 148 | translate("Number of UDP connections to server.")) 149 | o.datatype = "min(1)" 150 | o.placeholder = "1" 151 | 152 | o = s:option(Value, "autoexpire", "%s (%s)" % { translate("autoexpire"), translate("optional") }, 153 | translate("Auto expiration time(in seconds) for a single UDP connection, 0 to disable.")) 154 | o.datatype = "uinteger" 155 | o.placeholder = "0" 156 | 157 | o = s:option(Value, "scavengettl", "%s (%s)" % { translate("scavengettl"), translate("optional") }, 158 | translate("How long an expired connection can live(in sec), -1 to disable.")) 159 | o.datatype = "min(-1)" 160 | o.placeholder = "600" 161 | 162 | o = s:option(Value, "sockbuf", "%s (%s)" % { translate("sockbuf"), translate("optional") }, 163 | translate("Send/secv buffer size of udp sockets, default unit is MB.")) 164 | o.datatype = "uinteger" 165 | o.placeholder = "4" 166 | o.cfgvalue = function(...) 167 | local value = Value.cfgvalue(...) 168 | 169 | if value then 170 | return tonumber(value) / 1024 / 1024 171 | end 172 | end 173 | o.write = function(self, section, value) 174 | local number = tonumber(value) 175 | if number then 176 | Value.write(self, section, number * 1024 * 1024) 177 | else 178 | Value.remove(self, section) 179 | end 180 | end 181 | 182 | o = s:option(Value, "smuxver", "%s (%s)" % { translate("smuxver"), translate("optional") }, 183 | translate("Specify smux version, available 1,2, default: 1")) 184 | o:value("1") 185 | o:value("2") 186 | o.default = "1" 187 | 188 | o = s:option(Value, "smuxbuf", "%s (%s)" % { translate("smuxbuf"), translate("optional") }, 189 | translate("The overall de-mux buffer, default unit is MB.")) 190 | o.datatype = "uinteger" 191 | o.placeholder = "4" 192 | o.cfgvalue = function(...) 193 | local value = Value.cfgvalue(...) 194 | 195 | if value then 196 | return tonumber(value) / 1024 / 1024 197 | end 198 | end 199 | o.write = function(self, section, value) 200 | local number = tonumber(value) 201 | if number then 202 | Value.write(self, section, number * 1024 * 1024) 203 | else 204 | Value.remove(self, section) 205 | end 206 | end 207 | 208 | o = s:option(Value, "streambuf", "%s (%s)" % { translate("streambuf"), translate("optional") }, 209 | translate("Per stream receive buffer, default unit is MB.")) 210 | o.datatype = "uinteger" 211 | o.placeholder = "2" 212 | o.cfgvalue = function(...) 213 | local value = Value.cfgvalue(...) 214 | 215 | if value then 216 | return tonumber(value) / 1024 / 1024 217 | end 218 | end 219 | o.write = function(self, section, value) 220 | local number = tonumber(value) 221 | if number then 222 | Value.write(self, section, number * 1024 * 1024) 223 | else 224 | Value.remove(self, section) 225 | end 226 | end 227 | 228 | o = s:option(Value, "keepalive", "%s (%s)" % { translate("keepalive"), translate("optional") }, 229 | translate("NAT keepalive interval to prevent your router from removing port mapping, default unit is seconds.")) 230 | o.datatype = "uinteger" 231 | o.placeholder = "10" 232 | 233 | o = s:option(Value, "snmpperiod", "%s (%s)" % { translate("snmpperiod"), 234 | translate("optional") }, translate("SNMP collect period, in seconds")) 235 | o.datatype = "min(1)" 236 | o.placeholder = "60" 237 | 238 | return m 239 | -------------------------------------------------------------------------------- /luasrc/model/cbi/kcptun/servers.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2016-2020 Xingwang Liao 2 | -- Licensed to the public under the Apache License 2.0. 3 | 4 | local dsp = require "luci.dispatcher" 5 | local http = require "luci.http" 6 | 7 | local m, s, o 8 | 9 | local function get_ip_string(ip) 10 | if ip and ip:find(":") then 11 | return "[%s]" % ip 12 | else 13 | return ip or "" 14 | end 15 | end 16 | 17 | m = Map("kcptun", "%s - %s" % { translate("Kcptun"), translate("Server List") }) 18 | 19 | s = m:section(TypedSection, "servers") 20 | s.anonymous = true 21 | s.addremove = true 22 | s.sortable = true 23 | s.template = "cbi/tblsection" 24 | s.extedit = dsp.build_url("admin/services/kcptun/servers/%s") 25 | function s.create(...) 26 | local sid = TypedSection.create(...) 27 | if sid then 28 | m.uci:save("kcptun") 29 | http.redirect(s.extedit % sid) 30 | return 31 | end 32 | end 33 | 34 | o = s:option(DummyValue, "alias", translate("Alias")) 35 | function o.cfgvalue(self, section) 36 | return Value.cfgvalue(self, section) or translate("None") 37 | end 38 | 39 | o = s:option(DummyValue, "_server_address", translate("Server Address")) 40 | function o.cfgvalue(self, section) 41 | local server = m.uci:get("kcptun", section, "server_addr") or "?" 42 | local server_port = m.uci:get("kcptun", section, "server_port") or "29900" 43 | return "%s:%s" % { get_ip_string(server), server_port } 44 | end 45 | 46 | o = s:option(DummyValue, "_listen_addres", translate("Listen Address")) 47 | function o.cfgvalue(self, section) 48 | local local_host = m.uci:get("kcptun", section, "listen_addr") or "0.0.0.0" 49 | local local_port = m.uci:get("kcptun", section, "listen_port") or "12984" 50 | return "%s:%s" % { get_ip_string(local_host), local_port } 51 | end 52 | 53 | o = s:option(DummyValue, "crypt", translate("Encrypt Method")) 54 | function o.cfgvalue(...) 55 | local v = Value.cfgvalue(...) 56 | return v and v:upper() or "?" 57 | end 58 | 59 | o = s:option(DummyValue, "mode", translate("Embedded Mode")) 60 | function o.cfgvalue(...) 61 | local v = Value.cfgvalue(...) 62 | return v and v:upper() or "?" 63 | end 64 | 65 | o = s:option(DummyValue, "nocomp", translate("Disable Compression")) 66 | function o.cfgvalue(...) 67 | local v = Value.cfgvalue(...) 68 | return v == "true" and translate("True") or translate("False") 69 | end 70 | 71 | return m 72 | -------------------------------------------------------------------------------- /luasrc/model/cbi/kcptun/settings.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2016-2020 Xingwang Liao 2 | -- Licensed to the public under the Apache License 2.0. 3 | 4 | local uci = require "luci.model.uci".cursor() 5 | local util = require "luci.util" 6 | local sys = require "luci.sys" 7 | local fs = require "nixio.fs" 8 | 9 | local m, s, o 10 | local server_table = { } 11 | 12 | local function get_ip_string(ip) 13 | if ip and ip:find(":") then 14 | return "[%s]" % ip 15 | else 16 | return ip or "" 17 | end 18 | end 19 | 20 | uci:foreach("kcptun", "servers", function(s) 21 | if s.alias then 22 | server_table[s[".name"]] = s.alias 23 | elseif s.server_addr and s.server_port then 24 | server_table[s[".name"]] = "%s:%s" % { get_ip_string(s.server_addr), s.server_port } 25 | end 26 | end) 27 | 28 | m = Map("kcptun", "%s - %s" % { translate("Kcptun"), translate("Settings") }) 29 | m:append(Template("kcptun/status")) 30 | 31 | s = m:section(NamedSection, "general", "general", translate("General Settings")) 32 | s.anonymous = true 33 | s.addremove = false 34 | 35 | o = s:option(ListValue, "server", translate("Server")) 36 | o:value("", translate("Disable")) 37 | for k, v in pairs(server_table) do 38 | o:value(k, v) 39 | end 40 | 41 | o = s:option(Value, "client_file", translate("Client File")) 42 | o.rmempty = false 43 | 44 | o = s:option(ListValue, "daemon_user", translate("Run Daemon as User")) 45 | o:value("") 46 | for u in util.execi("cat /etc/passwd | cut -d ':' -f1") do 47 | o:value(u) 48 | end 49 | 50 | o = s:option(Flag, "enable_logging", translate("Enable Logging")) 51 | o.rmempty = false 52 | 53 | o = s:option(Value, "log_folder", translate("Log Folder")) 54 | o.datatype = "directory" 55 | o.placeholder = "/var/log/kcptun" 56 | o:depends("enable_logging", "1") 57 | o.formvalue = function(...) 58 | local v = (Value.formvalue(...) or ""):trim() 59 | if v ~= "" then 60 | v = string.gsub(v, "\\", "/") 61 | if v:sub(1, 1) ~= "/" then 62 | v = "/" .. v 63 | end 64 | 65 | while v:sub(-1) == "/" do 66 | v = v:sub(1, -2) 67 | end 68 | end 69 | 70 | return v 71 | end 72 | o.validate = function(self, value, section) 73 | if value and not fs.stat(value) then 74 | local res, code, msg = fs.mkdir(value) 75 | if not res then 76 | return nil, msg 77 | end 78 | end 79 | return Value.validate(self, value, section) 80 | end 81 | 82 | o = s:option(Value, "mem_percentage", translate("Memory percentage"), 83 | translate("The maximum percentage of memory used by Kcptun.")) 84 | o.datatype = "range(0, 100)" 85 | o.placeholder = "80" 86 | 87 | return m 88 | -------------------------------------------------------------------------------- /luasrc/model/kcptun.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2016-2020 Xingwang Liao 2 | -- Licensed to the public under the Apache License 2.0. 3 | 4 | local fs = require "nixio.fs" 5 | local sys = require "luci.sys" 6 | local uci = require "luci.model.uci".cursor() 7 | local util = require "luci.util" 8 | 9 | module("luci.model.kcptun", package.seeall) 10 | 11 | function get_config_option(option, default) 12 | return uci:get("kcptun", "general", option) or default 13 | end 14 | 15 | function get_current_log_file(type) 16 | local log_folder = get_config_option("log_folder", "/var/log/kcptun") 17 | return "%s/%s.%s.log" % { log_folder, type, "general" } 18 | end 19 | 20 | function is_running(client) 21 | if client and client ~= "" then 22 | local file_name = client:match(".*/([^/]+)$") or "" 23 | if file_name ~= "" then 24 | return sys.call("pidof %s >/dev/null" % file_name) == 0 25 | end 26 | end 27 | 28 | return false 29 | end 30 | 31 | function get_kcptun_version(file) 32 | if file and file ~= "" then 33 | if not fs.access(file, "rwx", "rx", "rx") then 34 | fs.chmod(file, 755) 35 | end 36 | 37 | local info = util.trim(sys.exec("%s -v 2>/dev/null" % file)) 38 | 39 | if info ~= "" then 40 | local tb = util.split(info, "%s+", nil, true) 41 | return tb[1] == "kcptun" and tb[3] or "" 42 | end 43 | end 44 | 45 | return "" 46 | end 47 | 48 | function get_luci_version() 49 | local ipkg = require "luci.model.ipkg" 50 | 51 | local package_name = "luci-app-kcptun" 52 | local package_info = ipkg.info(package_name) or {} 53 | 54 | if next(package_info) ~= nil then 55 | return package_info[package_name]["Version"] 56 | end 57 | return "" 58 | end 59 | -------------------------------------------------------------------------------- /luasrc/view/kcptun/log_view.htm: -------------------------------------------------------------------------------- 1 | <%# 2 | Copyright 2016-2020 Xingwang Liao 3 | Licensed to the public under the Apache License 2.0. 4 | -%> 5 | 6 | <% css = [[ 7 | 8 | #log_text { 9 | padding: 10px; 10 | text-align: left; 11 | } 12 | #log_text pre { 13 | word-break: break-all; 14 | margin: 0; 15 | } 16 | .description { 17 | background-color: #33ccff; 18 | } 19 | 20 | ]] 21 | %> 22 | 23 | <%+header%> 24 | 25 |
26 |

<%:Kcptun%> - <%:Log Data%>

27 |
28 |
29 | 30 |
31 |
32 |
<%:Loading%><%:Collecting data...%>
33 |
<%:Refresh every 5 seconds.%>
34 |
35 |
36 |
37 | 38 | 39 | 71 | 72 | <%+footer%> 73 | -------------------------------------------------------------------------------- /luasrc/view/kcptun/status.htm: -------------------------------------------------------------------------------- 1 | <%# 2 | Copyright 2016-2020 Xingwang Liao 3 | Licensed to the public under the Apache License 2.0. 4 | -%> 5 | 6 | <% 7 | local kcp = require "luci.model.kcptun" 8 | local dsp = require "luci.dispatcher" 9 | 10 | local client_file = kcp.get_config_option("client_file") 11 | local client_version = kcp.get_kcptun_version(client_file) 12 | local luci_version = kcp.get_luci_version() 13 | -%> 14 | 15 | 43 | 44 |
45 | <%:Running Status%> 46 |
47 |
48 |
<%:Client Status%>
49 |
50 | <%:Collecting data...%> 51 |
52 |
53 |
54 |
<%:Client Version%>
55 |
56 | <%- if client_version == "" then -%> 57 | <%:Invalid Client File.%> 58 | <% else -%> 59 | <%=pcdata(client_version)%> 60 | <%- end %> 61 | <%:Get latest%> 62 | <%:Get latest%> (ipk) 63 |
64 |
65 | <% if luci_version ~= "" then -%> 66 |
67 |
<%:LuCI Version%>
68 |
69 | <%=pcdata(luci_version)%> 70 | <%:Get latest%> 71 |
72 |
73 | <% end -%> 74 |
75 |
76 | 77 | 88 | -------------------------------------------------------------------------------- /po/templates/kcptun.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "Content-Type: text/plain; charset=UTF-8" 3 | 4 | #: luasrc/model/cbi/kcptun/servers-detail.lua:92 5 | msgid "2nd ACK" 6 | msgstr "" 7 | 8 | #: luasrc/model/cbi/kcptun/servers-detail.lua:44 9 | #: luasrc/model/cbi/kcptun/servers.lua:34 10 | msgid "Alias" 11 | msgstr "" 12 | 13 | #: luasrc/model/cbi/kcptun/servers-detail.lua:153 14 | msgid "" 15 | "Auto expiration time(in seconds) for a single UDP connection, 0 to disable." 16 | msgstr "" 17 | 18 | #: luasrc/view/kcptun/log_view.htm:29 19 | msgid "Clear Log File" 20 | msgstr "" 21 | 22 | #: luasrc/model/cbi/kcptun/settings.lua:41 23 | msgid "Client File" 24 | msgstr "" 25 | 26 | #: luasrc/view/kcptun/status.htm:48 27 | msgid "Client Status" 28 | msgstr "" 29 | 30 | #: luasrc/view/kcptun/status.htm:54 31 | msgid "Client Version" 32 | msgstr "" 33 | 34 | #: luasrc/view/kcptun/log_view.htm:32 luasrc/view/kcptun/status.htm:50 35 | msgid "Collecting data..." 36 | msgstr "" 37 | 38 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 39 | msgid "DSCP(6bit)" 40 | msgstr "" 41 | 42 | #: luasrc/model/cbi/kcptun/settings.lua:36 43 | msgid "Disable" 44 | msgstr "" 45 | 46 | #: luasrc/model/cbi/kcptun/servers.lua:65 47 | msgid "Disable Compression" 48 | msgstr "" 49 | 50 | #: luasrc/model/cbi/kcptun/servers-detail.lua:128 51 | msgid "Disable Compression?" 52 | msgstr "" 53 | 54 | #: luasrc/model/cbi/kcptun/servers-detail.lua:32 55 | msgid "Edit Server" 56 | msgstr "" 57 | 58 | #: luasrc/model/cbi/kcptun/servers-detail.lua:74 59 | #: luasrc/model/cbi/kcptun/servers.lua:59 60 | msgid "Embedded Mode" 61 | msgstr "" 62 | 63 | #: luasrc/model/cbi/kcptun/settings.lua:50 64 | msgid "Enable Logging" 65 | msgstr "" 66 | 67 | #: luasrc/model/cbi/kcptun/servers-detail.lua:80 68 | msgid "Enable nodelay Mode." 69 | msgstr "" 70 | 71 | #: luasrc/model/cbi/kcptun/servers-detail.lua:68 72 | #: luasrc/model/cbi/kcptun/servers.lua:53 73 | msgid "Encrypt Method" 74 | msgstr "" 75 | 76 | #: luasrc/view/kcptun/log_view.htm:66 77 | msgid "Error get log data." 78 | msgstr "" 79 | 80 | #: luasrc/model/cbi/kcptun/servers.lua:68 81 | msgid "False" 82 | msgstr "" 83 | 84 | #: luasrc/model/cbi/kcptun/settings.lua:31 85 | msgid "General Settings" 86 | msgstr "" 87 | 88 | #: luasrc/view/kcptun/status.htm:61 luasrc/view/kcptun/status.htm:62 89 | #: luasrc/view/kcptun/status.htm:70 90 | msgid "Get latest" 91 | msgstr "" 92 | 93 | #: luasrc/model/cbi/kcptun/servers-detail.lua:158 94 | msgid "How long an expired connection can live(in sec), -1 to disable." 95 | msgstr "" 96 | 97 | #: luasrc/view/kcptun/status.htm:57 98 | msgid "Invalid Client File." 99 | msgstr "" 100 | 101 | #: luasrc/model/cbi/kcptun/servers-detail.lua:32 102 | #: luasrc/model/cbi/kcptun/servers.lua:17 103 | #: luasrc/model/cbi/kcptun/settings.lua:28 luasrc/view/kcptun/log_view.htm:26 104 | msgid "Kcptun" 105 | msgstr "" 106 | 107 | #: luasrc/controller/kcptun.lua:15 108 | msgid "Kcptun Client" 109 | msgstr "" 110 | 111 | #: luasrc/model/cbi/kcptun/servers-detail.lua:63 112 | msgid "Key" 113 | msgstr "" 114 | 115 | #: luasrc/view/kcptun/log_view.htm:61 116 | msgid "Last 50 lines of log file:" 117 | msgstr "" 118 | 119 | #: luasrc/view/kcptun/log_view.htm:63 120 | msgid "Last 50 lines of syslog:" 121 | msgstr "" 122 | 123 | #: luasrc/model/cbi/kcptun/servers.lua:46 124 | msgid "Listen Address" 125 | msgstr "" 126 | 127 | #: luasrc/view/kcptun/log_view.htm:32 128 | msgid "Loading" 129 | msgstr "" 130 | 131 | #: luasrc/model/cbi/kcptun/servers-detail.lua:54 132 | msgid "Local Listen Host" 133 | msgstr "" 134 | 135 | #: luasrc/model/cbi/kcptun/servers-detail.lua:59 136 | msgid "Local Listen Port." 137 | msgstr "" 138 | 139 | #: luasrc/model/cbi/kcptun/servers-detail.lua:59 140 | msgid "Local Port" 141 | msgstr "" 142 | 143 | #: luasrc/model/cbi/kcptun/servers-detail.lua:55 144 | msgid "Local listen host." 145 | msgstr "" 146 | 147 | #: luasrc/controller/kcptun.lua:25 148 | msgid "Log" 149 | msgstr "" 150 | 151 | #: luasrc/view/kcptun/log_view.htm:26 152 | msgid "Log Data" 153 | msgstr "" 154 | 155 | #: luasrc/model/cbi/kcptun/settings.lua:53 156 | msgid "Log Folder" 157 | msgstr "" 158 | 159 | #: luasrc/view/kcptun/status.htm:67 160 | msgid "LuCI Version" 161 | msgstr "" 162 | 163 | #: luasrc/model/cbi/kcptun/servers-detail.lua:98 164 | msgid "Maximum transmission unit of UDP packets." 165 | msgstr "" 166 | 167 | #: luasrc/model/cbi/kcptun/settings.lua:82 168 | msgid "Memory percentage" 169 | msgstr "" 170 | 171 | #: luasrc/model/cbi/kcptun/servers-detail.lua:229 172 | msgid "" 173 | "NAT keepalive interval to prevent your router from removing port mapping, " 174 | "default unit is seconds." 175 | msgstr "" 176 | 177 | #: luasrc/view/kcptun/log_view.htm:62 luasrc/view/kcptun/log_view.htm:64 178 | msgid "No log data." 179 | msgstr "" 180 | 181 | #: luasrc/model/cbi/kcptun/servers.lua:36 182 | msgid "None" 183 | msgstr "" 184 | 185 | #: luasrc/view/kcptun/status.htm:83 186 | msgid "Not Running" 187 | msgstr "" 188 | 189 | #: luasrc/model/cbi/kcptun/servers-detail.lua:148 190 | msgid "Number of UDP connections to server." 191 | msgstr "" 192 | 193 | #: luasrc/model/cbi/kcptun/servers-detail.lua:90 194 | msgid "Off" 195 | msgstr "" 196 | 197 | #: luasrc/model/cbi/kcptun/servers-detail.lua:91 198 | msgid "On" 199 | msgstr "" 200 | 201 | #: luasrc/model/cbi/kcptun/servers-detail.lua:209 202 | msgid "Per stream receive buffer, default unit is MB." 203 | msgstr "" 204 | 205 | #: luasrc/model/cbi/kcptun/servers-detail.lua:64 206 | msgid "Pre-shared secret for client and server." 207 | msgstr "" 208 | 209 | #: luasrc/view/kcptun/log_view.htm:42 210 | msgid "Processing..." 211 | msgstr "" 212 | 213 | #: luasrc/model/cbi/kcptun/servers-detail.lua:109 214 | msgid "Receive Window Size(num of packets)." 215 | msgstr "" 216 | 217 | #: luasrc/model/cbi/kcptun/servers-detail.lua:115 218 | msgid "Reed-solomon Erasure Coding - datashard." 219 | msgstr "" 220 | 221 | #: luasrc/model/cbi/kcptun/servers-detail.lua:120 222 | msgid "Reed-solomon Erasure Coding - parityshard." 223 | msgstr "" 224 | 225 | #: luasrc/view/kcptun/log_view.htm:33 226 | msgid "Refresh every 5 seconds." 227 | msgstr "" 228 | 229 | #: luasrc/model/cbi/kcptun/settings.lua:44 230 | msgid "Run Daemon as User" 231 | msgstr "" 232 | 233 | #: luasrc/view/kcptun/status.htm:83 234 | msgid "Running" 235 | msgstr "" 236 | 237 | #: luasrc/view/kcptun/status.htm:45 238 | msgid "Running Status" 239 | msgstr "" 240 | 241 | #: luasrc/model/cbi/kcptun/servers-detail.lua:234 242 | msgid "SNMP collect period, in seconds" 243 | msgstr "" 244 | 245 | #: luasrc/model/cbi/kcptun/servers-detail.lua:103 246 | msgid "Send Window Size(num of packets)." 247 | msgstr "" 248 | 249 | #: luasrc/model/cbi/kcptun/servers-detail.lua:163 250 | msgid "Send/secv buffer size of udp sockets, default unit is MB." 251 | msgstr "" 252 | 253 | #: luasrc/model/cbi/kcptun/servers-detail.lua:46 254 | #: luasrc/model/cbi/kcptun/settings.lua:35 255 | msgid "Server" 256 | msgstr "" 257 | 258 | #: luasrc/model/cbi/kcptun/servers.lua:39 259 | msgid "Server Address" 260 | msgstr "" 261 | 262 | #: luasrc/model/cbi/kcptun/servers.lua:17 263 | msgid "Server List" 264 | msgstr "" 265 | 266 | #: luasrc/controller/kcptun.lua:22 267 | msgid "Server Manage" 268 | msgstr "" 269 | 270 | #: luasrc/model/cbi/kcptun/servers-detail.lua:50 271 | msgid "Server Port" 272 | msgstr "" 273 | 274 | #: luasrc/controller/kcptun.lua:18 luasrc/model/cbi/kcptun/settings.lua:28 275 | msgid "Settings" 276 | msgstr "" 277 | 278 | #: luasrc/model/cbi/kcptun/servers-detail.lua:183 279 | msgid "Specify smux version, available 1,2, default: 1" 280 | msgstr "" 281 | 282 | #: luasrc/model/cbi/kcptun/servers-detail.lua:133 283 | msgid "Suppress the 'stream open/close' messages" 284 | msgstr "" 285 | 286 | #: luasrc/model/cbi/kcptun/servers-detail.lua:138 287 | msgid "TCP transmission" 288 | msgstr "" 289 | 290 | #: luasrc/model/cbi/kcptun/settings.lua:83 291 | msgid "The maximum percentage of memory used by Kcptun." 292 | msgstr "" 293 | 294 | #: luasrc/model/cbi/kcptun/servers-detail.lua:189 295 | msgid "The overall de-mux buffer, default unit is MB." 296 | msgstr "" 297 | 298 | #: luasrc/model/cbi/kcptun/servers.lua:68 299 | msgid "True" 300 | msgstr "" 301 | 302 | #: luasrc/model/cbi/kcptun/servers-detail.lua:143 303 | msgid "acknodelay" 304 | msgstr "" 305 | 306 | #: luasrc/model/cbi/kcptun/servers-detail.lua:152 307 | msgid "autoexpire" 308 | msgstr "" 309 | 310 | #: luasrc/model/cbi/kcptun/servers-detail.lua:147 311 | msgid "conn" 312 | msgstr "" 313 | 314 | #: luasrc/model/cbi/kcptun/servers-detail.lua:68 315 | msgid "crypt" 316 | msgstr "" 317 | 318 | #: luasrc/model/cbi/kcptun/servers-detail.lua:114 319 | msgid "datashard" 320 | msgstr "" 321 | 322 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 323 | msgid "dscp" 324 | msgstr "" 325 | 326 | #: luasrc/model/cbi/kcptun/servers-detail.lua:83 327 | msgid "interval" 328 | msgstr "" 329 | 330 | #: luasrc/model/cbi/kcptun/servers-detail.lua:228 331 | msgid "keepalive" 332 | msgstr "" 333 | 334 | #: luasrc/model/cbi/kcptun/servers-detail.lua:74 335 | msgid "mode" 336 | msgstr "" 337 | 338 | #: luasrc/model/cbi/kcptun/servers-detail.lua:97 339 | msgid "mtu" 340 | msgstr "" 341 | 342 | #: luasrc/model/cbi/kcptun/servers-detail.lua:94 343 | msgid "nc" 344 | msgstr "" 345 | 346 | #: luasrc/model/cbi/kcptun/servers-detail.lua:128 347 | msgid "nocomp" 348 | msgstr "" 349 | 350 | #: luasrc/model/cbi/kcptun/servers-detail.lua:80 351 | msgid "nodelay" 352 | msgstr "" 353 | 354 | #: luasrc/model/cbi/kcptun/servers-detail.lua:44 355 | #: luasrc/model/cbi/kcptun/servers-detail.lua:54 356 | #: luasrc/model/cbi/kcptun/servers-detail.lua:63 357 | #: luasrc/model/cbi/kcptun/servers-detail.lua:97 358 | #: luasrc/model/cbi/kcptun/servers-detail.lua:102 359 | #: luasrc/model/cbi/kcptun/servers-detail.lua:108 360 | #: luasrc/model/cbi/kcptun/servers-detail.lua:114 361 | #: luasrc/model/cbi/kcptun/servers-detail.lua:119 362 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 363 | #: luasrc/model/cbi/kcptun/servers-detail.lua:147 364 | #: luasrc/model/cbi/kcptun/servers-detail.lua:152 365 | #: luasrc/model/cbi/kcptun/servers-detail.lua:157 366 | #: luasrc/model/cbi/kcptun/servers-detail.lua:162 367 | #: luasrc/model/cbi/kcptun/servers-detail.lua:182 368 | #: luasrc/model/cbi/kcptun/servers-detail.lua:188 369 | #: luasrc/model/cbi/kcptun/servers-detail.lua:208 370 | #: luasrc/model/cbi/kcptun/servers-detail.lua:228 371 | #: luasrc/model/cbi/kcptun/servers-detail.lua:234 372 | msgid "optional" 373 | msgstr "" 374 | 375 | #: luasrc/model/cbi/kcptun/servers-detail.lua:119 376 | msgid "parityshard" 377 | msgstr "" 378 | 379 | #: luasrc/model/cbi/kcptun/servers-detail.lua:133 380 | msgid "quiet" 381 | msgstr "" 382 | 383 | #: luasrc/model/cbi/kcptun/servers-detail.lua:108 384 | msgid "rcvwnd" 385 | msgstr "" 386 | 387 | #: luasrc/model/cbi/kcptun/servers-detail.lua:88 388 | msgid "resend" 389 | msgstr "" 390 | 391 | #: luasrc/model/cbi/kcptun/servers-detail.lua:157 392 | msgid "scavengettl" 393 | msgstr "" 394 | 395 | #: luasrc/model/cbi/kcptun/servers-detail.lua:188 396 | msgid "smuxbuf" 397 | msgstr "" 398 | 399 | #: luasrc/model/cbi/kcptun/servers-detail.lua:182 400 | msgid "smuxver" 401 | msgstr "" 402 | 403 | #: luasrc/model/cbi/kcptun/servers-detail.lua:102 404 | msgid "sndwnd" 405 | msgstr "" 406 | 407 | #: luasrc/model/cbi/kcptun/servers-detail.lua:233 408 | msgid "snmpperiod" 409 | msgstr "" 410 | 411 | #: luasrc/model/cbi/kcptun/servers-detail.lua:162 412 | msgid "sockbuf" 413 | msgstr "" 414 | 415 | #: luasrc/model/cbi/kcptun/servers-detail.lua:208 416 | msgid "streambuf" 417 | msgstr "" 418 | 419 | #: luasrc/model/cbi/kcptun/servers-detail.lua:138 420 | msgid "tcp" 421 | msgstr "" 422 | -------------------------------------------------------------------------------- /po/zh-cn/kcptun.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "Content-Type: text/plain; charset=UTF-8\n" 3 | 4 | #: luasrc/model/cbi/kcptun/servers-detail.lua:92 5 | msgid "2nd ACK" 6 | msgstr "2次 ACK 跨越重传" 7 | 8 | #: luasrc/model/cbi/kcptun/servers-detail.lua:44 9 | #: luasrc/model/cbi/kcptun/servers.lua:34 10 | msgid "Alias" 11 | msgstr "别名" 12 | 13 | #: luasrc/model/cbi/kcptun/servers-detail.lua:153 14 | msgid "" 15 | "Auto expiration time(in seconds) for a single UDP connection, 0 to disable." 16 | msgstr "单个 UDP 连接的自动过期时间 (秒),设置 0 来禁用" 17 | 18 | #: luasrc/view/kcptun/log_view.htm:29 19 | msgid "Clear Log File" 20 | msgstr "清理日志文件" 21 | 22 | #: luasrc/model/cbi/kcptun/settings.lua:41 23 | msgid "Client File" 24 | msgstr "客户端文件" 25 | 26 | #: luasrc/view/kcptun/status.htm:48 27 | msgid "Client Status" 28 | msgstr "客户端状态" 29 | 30 | #: luasrc/view/kcptun/status.htm:54 31 | msgid "Client Version" 32 | msgstr "客户端版本" 33 | 34 | #: luasrc/view/kcptun/log_view.htm:32 luasrc/view/kcptun/status.htm:50 35 | msgid "Collecting data..." 36 | msgstr "正在收集数据..." 37 | 38 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 39 | msgid "DSCP(6bit)" 40 | msgstr "DSCP(6bit)" 41 | 42 | #: luasrc/model/cbi/kcptun/settings.lua:36 43 | msgid "Disable" 44 | msgstr "禁用" 45 | 46 | #: luasrc/model/cbi/kcptun/servers.lua:65 47 | msgid "Disable Compression" 48 | msgstr "禁用压缩" 49 | 50 | #: luasrc/model/cbi/kcptun/servers-detail.lua:128 51 | msgid "Disable Compression?" 52 | msgstr "是否禁用压缩?" 53 | 54 | #: luasrc/model/cbi/kcptun/servers-detail.lua:32 55 | msgid "Edit Server" 56 | msgstr "编辑服务端" 57 | 58 | #: luasrc/model/cbi/kcptun/servers-detail.lua:74 59 | #: luasrc/model/cbi/kcptun/servers.lua:59 60 | msgid "Embedded Mode" 61 | msgstr "内置模式" 62 | 63 | #: luasrc/model/cbi/kcptun/settings.lua:50 64 | msgid "Enable Logging" 65 | msgstr "启用日志记录" 66 | 67 | #: luasrc/model/cbi/kcptun/servers-detail.lua:80 68 | msgid "Enable nodelay Mode." 69 | msgstr "启用 nodelay 模式" 70 | 71 | #: luasrc/model/cbi/kcptun/servers-detail.lua:68 72 | #: luasrc/model/cbi/kcptun/servers.lua:53 73 | msgid "Encrypt Method" 74 | msgstr "加密方式" 75 | 76 | #: luasrc/view/kcptun/log_view.htm:66 77 | msgid "Error get log data." 78 | msgstr "获取日志数据失败。" 79 | 80 | #: luasrc/model/cbi/kcptun/servers.lua:68 81 | msgid "False" 82 | msgstr "否" 83 | 84 | #: luasrc/model/cbi/kcptun/settings.lua:31 85 | msgid "General Settings" 86 | msgstr "基本设置" 87 | 88 | #: luasrc/view/kcptun/status.htm:61 luasrc/view/kcptun/status.htm:62 89 | #: luasrc/view/kcptun/status.htm:70 90 | msgid "Get latest" 91 | msgstr "获取最新版" 92 | 93 | #: luasrc/model/cbi/kcptun/servers-detail.lua:158 94 | msgid "How long an expired connection can live(in sec), -1 to disable." 95 | msgstr "过期连接保留多长时间 (秒),设置 -1 来禁用" 96 | 97 | #: luasrc/view/kcptun/status.htm:57 98 | msgid "Invalid Client File." 99 | msgstr "客户端文件配置有误" 100 | 101 | #: luasrc/model/cbi/kcptun/servers-detail.lua:32 102 | #: luasrc/model/cbi/kcptun/servers.lua:17 103 | #: luasrc/model/cbi/kcptun/settings.lua:28 luasrc/view/kcptun/log_view.htm:26 104 | msgid "Kcptun" 105 | msgstr "" 106 | 107 | #: luasrc/controller/kcptun.lua:15 108 | msgid "Kcptun Client" 109 | msgstr "Kcptun 客户端" 110 | 111 | #: luasrc/model/cbi/kcptun/servers-detail.lua:63 112 | msgid "Key" 113 | msgstr "密码" 114 | 115 | #: luasrc/view/kcptun/log_view.htm:61 116 | msgid "Last 50 lines of log file:" 117 | msgstr "日志文件的最新 50 行:" 118 | 119 | #: luasrc/view/kcptun/log_view.htm:63 120 | msgid "Last 50 lines of syslog:" 121 | msgstr "系统日志的最新 50 行:" 122 | 123 | #: luasrc/model/cbi/kcptun/servers.lua:46 124 | msgid "Listen Address" 125 | msgstr "监听地址" 126 | 127 | #: luasrc/view/kcptun/log_view.htm:32 128 | msgid "Loading" 129 | msgstr "正在加载..." 130 | 131 | #: luasrc/model/cbi/kcptun/servers-detail.lua:54 132 | msgid "Local Listen Host" 133 | msgstr "本地监听地址" 134 | 135 | #: luasrc/model/cbi/kcptun/servers-detail.lua:59 136 | msgid "Local Listen Port." 137 | msgstr "本地监听端口" 138 | 139 | #: luasrc/model/cbi/kcptun/servers-detail.lua:59 140 | msgid "Local Port" 141 | msgstr "本地端口" 142 | 143 | #: luasrc/model/cbi/kcptun/servers-detail.lua:55 144 | msgid "Local listen host." 145 | msgstr "本地监听主机" 146 | 147 | #: luasrc/controller/kcptun.lua:25 148 | msgid "Log" 149 | msgstr "日志" 150 | 151 | #: luasrc/view/kcptun/log_view.htm:26 152 | msgid "Log Data" 153 | msgstr "日志数据" 154 | 155 | #: luasrc/model/cbi/kcptun/settings.lua:53 156 | msgid "Log Folder" 157 | msgstr "日志文件夹" 158 | 159 | #: luasrc/view/kcptun/status.htm:67 160 | msgid "LuCI Version" 161 | msgstr "LuCI 版本" 162 | 163 | #: luasrc/model/cbi/kcptun/servers-detail.lua:98 164 | msgid "Maximum transmission unit of UDP packets." 165 | msgstr "UDP 数据包的最大传输单元" 166 | 167 | #: luasrc/model/cbi/kcptun/settings.lua:82 168 | msgid "Memory percentage" 169 | msgstr "内存百分比" 170 | 171 | #: luasrc/model/cbi/kcptun/servers-detail.lua:229 172 | msgid "" 173 | "NAT keepalive interval to prevent your router from removing port mapping, " 174 | "default unit is seconds." 175 | msgstr "NAT Keepalive 包间隔时间(秒), 防止路由器删除端口映射" 176 | 177 | #: luasrc/view/kcptun/log_view.htm:62 luasrc/view/kcptun/log_view.htm:64 178 | msgid "No log data." 179 | msgstr "无日志数据。" 180 | 181 | #: luasrc/model/cbi/kcptun/servers.lua:36 182 | msgid "None" 183 | msgstr "无" 184 | 185 | #: luasrc/view/kcptun/status.htm:83 186 | msgid "Not Running" 187 | msgstr "未运行" 188 | 189 | #: luasrc/model/cbi/kcptun/servers-detail.lua:148 190 | msgid "Number of UDP connections to server." 191 | msgstr "到服务端的 UDP 连接数量" 192 | 193 | #: luasrc/model/cbi/kcptun/servers-detail.lua:90 194 | msgid "Off" 195 | msgstr "关闭" 196 | 197 | #: luasrc/model/cbi/kcptun/servers-detail.lua:91 198 | msgid "On" 199 | msgstr "开启" 200 | 201 | #: luasrc/model/cbi/kcptun/servers-detail.lua:209 202 | msgid "Per stream receive buffer, default unit is MB." 203 | msgstr "每个传输流最大内存大小 (MB)" 204 | 205 | #: luasrc/model/cbi/kcptun/servers-detail.lua:64 206 | msgid "Pre-shared secret for client and server." 207 | msgstr "客户端和服务端的通信密码" 208 | 209 | #: luasrc/view/kcptun/log_view.htm:42 210 | msgid "Processing..." 211 | msgstr "正在操作..." 212 | 213 | #: luasrc/model/cbi/kcptun/servers-detail.lua:109 214 | msgid "Receive Window Size(num of packets)." 215 | msgstr "接收窗口大小 (数据包数量)" 216 | 217 | #: luasrc/model/cbi/kcptun/servers-detail.lua:115 218 | msgid "Reed-solomon Erasure Coding - datashard." 219 | msgstr "前向纠错 - datashard" 220 | 221 | #: luasrc/model/cbi/kcptun/servers-detail.lua:120 222 | msgid "Reed-solomon Erasure Coding - parityshard." 223 | msgstr "前向纠错 - parityshard" 224 | 225 | #: luasrc/view/kcptun/log_view.htm:33 226 | msgid "Refresh every 5 seconds." 227 | msgstr "每 5 秒刷新。" 228 | 229 | #: luasrc/model/cbi/kcptun/settings.lua:44 230 | msgid "Run Daemon as User" 231 | msgstr "以该用户启动" 232 | 233 | #: luasrc/view/kcptun/status.htm:83 234 | msgid "Running" 235 | msgstr "运行中" 236 | 237 | #: luasrc/view/kcptun/status.htm:45 238 | msgid "Running Status" 239 | msgstr "运行状态" 240 | 241 | #: luasrc/model/cbi/kcptun/servers-detail.lua:234 242 | msgid "SNMP collect period, in seconds" 243 | msgstr "SNMP采集周期 (秒)" 244 | 245 | #: luasrc/model/cbi/kcptun/servers-detail.lua:103 246 | msgid "Send Window Size(num of packets)." 247 | msgstr "发送窗口大小 (数据包数量)" 248 | 249 | #: luasrc/model/cbi/kcptun/servers-detail.lua:163 250 | msgid "Send/secv buffer size of udp sockets, default unit is MB." 251 | msgstr "发送/接收UDP数据包的缓冲区大小 (MB)" 252 | 253 | #: luasrc/model/cbi/kcptun/servers-detail.lua:46 254 | #: luasrc/model/cbi/kcptun/settings.lua:35 255 | msgid "Server" 256 | msgstr "服务端地址" 257 | 258 | #: luasrc/model/cbi/kcptun/servers.lua:39 259 | msgid "Server Address" 260 | msgstr "服务端地址" 261 | 262 | #: luasrc/model/cbi/kcptun/servers.lua:17 263 | msgid "Server List" 264 | msgstr "服务端列表" 265 | 266 | #: luasrc/controller/kcptun.lua:22 267 | msgid "Server Manage" 268 | msgstr "服务端管理" 269 | 270 | #: luasrc/model/cbi/kcptun/servers-detail.lua:50 271 | msgid "Server Port" 272 | msgstr "服务端端口" 273 | 274 | #: luasrc/controller/kcptun.lua:18 luasrc/model/cbi/kcptun/settings.lua:28 275 | msgid "Settings" 276 | msgstr "设置" 277 | 278 | #: luasrc/model/cbi/kcptun/servers-detail.lua:183 279 | msgid "Specify smux version, available 1,2, default: 1" 280 | msgstr "设置 smux 版本,可选 1, 2。默认:1" 281 | 282 | #: luasrc/model/cbi/kcptun/servers-detail.lua:133 283 | msgid "Suppress the 'stream open/close' messages" 284 | msgstr "不打印 'stream open/close' 信息" 285 | 286 | #: luasrc/model/cbi/kcptun/servers-detail.lua:138 287 | msgid "TCP transmission" 288 | msgstr "TCP 传输" 289 | 290 | #: luasrc/model/cbi/kcptun/settings.lua:83 291 | msgid "The maximum percentage of memory used by Kcptun." 292 | msgstr "Kcptun 可使用的最大内存百分比" 293 | 294 | #: luasrc/model/cbi/kcptun/servers-detail.lua:189 295 | msgid "The overall de-mux buffer, default unit is MB." 296 | msgstr "缓存大小 (MB)" 297 | 298 | #: luasrc/model/cbi/kcptun/servers.lua:68 299 | msgid "True" 300 | msgstr "是" 301 | 302 | #: luasrc/model/cbi/kcptun/servers-detail.lua:143 303 | msgid "acknodelay" 304 | msgstr "" 305 | 306 | #: luasrc/model/cbi/kcptun/servers-detail.lua:152 307 | msgid "autoexpire" 308 | msgstr "" 309 | 310 | #: luasrc/model/cbi/kcptun/servers-detail.lua:147 311 | msgid "conn" 312 | msgstr "" 313 | 314 | #: luasrc/model/cbi/kcptun/servers-detail.lua:68 315 | msgid "crypt" 316 | msgstr "" 317 | 318 | #: luasrc/model/cbi/kcptun/servers-detail.lua:114 319 | msgid "datashard" 320 | msgstr "" 321 | 322 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 323 | msgid "dscp" 324 | msgstr "" 325 | 326 | #: luasrc/model/cbi/kcptun/servers-detail.lua:83 327 | msgid "interval" 328 | msgstr "" 329 | 330 | #: luasrc/model/cbi/kcptun/servers-detail.lua:228 331 | msgid "keepalive" 332 | msgstr "" 333 | 334 | #: luasrc/model/cbi/kcptun/servers-detail.lua:74 335 | msgid "mode" 336 | msgstr "" 337 | 338 | #: luasrc/model/cbi/kcptun/servers-detail.lua:97 339 | msgid "mtu" 340 | msgstr "" 341 | 342 | #: luasrc/model/cbi/kcptun/servers-detail.lua:94 343 | msgid "nc" 344 | msgstr "" 345 | 346 | #: luasrc/model/cbi/kcptun/servers-detail.lua:128 347 | msgid "nocomp" 348 | msgstr "" 349 | 350 | #: luasrc/model/cbi/kcptun/servers-detail.lua:80 351 | msgid "nodelay" 352 | msgstr "" 353 | 354 | #: luasrc/model/cbi/kcptun/servers-detail.lua:44 355 | #: luasrc/model/cbi/kcptun/servers-detail.lua:54 356 | #: luasrc/model/cbi/kcptun/servers-detail.lua:63 357 | #: luasrc/model/cbi/kcptun/servers-detail.lua:97 358 | #: luasrc/model/cbi/kcptun/servers-detail.lua:102 359 | #: luasrc/model/cbi/kcptun/servers-detail.lua:108 360 | #: luasrc/model/cbi/kcptun/servers-detail.lua:114 361 | #: luasrc/model/cbi/kcptun/servers-detail.lua:119 362 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 363 | #: luasrc/model/cbi/kcptun/servers-detail.lua:147 364 | #: luasrc/model/cbi/kcptun/servers-detail.lua:152 365 | #: luasrc/model/cbi/kcptun/servers-detail.lua:157 366 | #: luasrc/model/cbi/kcptun/servers-detail.lua:162 367 | #: luasrc/model/cbi/kcptun/servers-detail.lua:182 368 | #: luasrc/model/cbi/kcptun/servers-detail.lua:188 369 | #: luasrc/model/cbi/kcptun/servers-detail.lua:208 370 | #: luasrc/model/cbi/kcptun/servers-detail.lua:228 371 | #: luasrc/model/cbi/kcptun/servers-detail.lua:234 372 | msgid "optional" 373 | msgstr "可选" 374 | 375 | #: luasrc/model/cbi/kcptun/servers-detail.lua:119 376 | msgid "parityshard" 377 | msgstr "" 378 | 379 | #: luasrc/model/cbi/kcptun/servers-detail.lua:133 380 | msgid "quiet" 381 | msgstr "" 382 | 383 | #: luasrc/model/cbi/kcptun/servers-detail.lua:108 384 | msgid "rcvwnd" 385 | msgstr "" 386 | 387 | #: luasrc/model/cbi/kcptun/servers-detail.lua:88 388 | msgid "resend" 389 | msgstr "" 390 | 391 | #: luasrc/model/cbi/kcptun/servers-detail.lua:157 392 | msgid "scavengettl" 393 | msgstr "" 394 | 395 | #: luasrc/model/cbi/kcptun/servers-detail.lua:188 396 | msgid "smuxbuf" 397 | msgstr "" 398 | 399 | #: luasrc/model/cbi/kcptun/servers-detail.lua:182 400 | msgid "smuxver" 401 | msgstr "" 402 | 403 | #: luasrc/model/cbi/kcptun/servers-detail.lua:102 404 | msgid "sndwnd" 405 | msgstr "" 406 | 407 | #: luasrc/model/cbi/kcptun/servers-detail.lua:233 408 | msgid "snmpperiod" 409 | msgstr "" 410 | 411 | #: luasrc/model/cbi/kcptun/servers-detail.lua:162 412 | msgid "sockbuf" 413 | msgstr "" 414 | 415 | #: luasrc/model/cbi/kcptun/servers-detail.lua:208 416 | msgid "streambuf" 417 | msgstr "" 418 | 419 | #: luasrc/model/cbi/kcptun/servers-detail.lua:138 420 | msgid "tcp" 421 | msgstr "" 422 | 423 | #~ msgid "Auto" 424 | #~ msgstr "自动" 425 | 426 | #~ msgid "CPU Architecture" 427 | #~ msgstr "CPU 架构" 428 | 429 | #~ msgid "Can't determine ARCH, or ARCH not supported. Please select manually." 430 | #~ msgstr "无法自动确定 ARCH,或者不支持该 ARCH,请手动重新选择。" 431 | 432 | #~ msgid "Can't find client in file: %s" 433 | #~ msgstr "无法在文件中找到客户端:%s" 434 | 435 | #~ msgid "Can't move new file to path: %s" 436 | #~ msgstr "无法移动新文件到:%s" 437 | 438 | #~ msgid "Check Kcptun Update" 439 | #~ msgstr "检查 Kcptun 更新" 440 | 441 | #~ msgid "Check LuCI Update" 442 | #~ msgstr "检查 LuCI 更新" 443 | 444 | #~ msgid "Click to Update" 445 | #~ msgstr "点击更新" 446 | 447 | #~ msgid "Client file is required." 448 | #~ msgstr "请指定客户端文件。" 449 | 450 | #~ msgid "Download url is required." 451 | #~ msgstr "请指定下载链接。" 452 | 453 | #~ msgid "Downloading..." 454 | #~ msgstr "正在下载..." 455 | 456 | #~ msgid "Extracting..." 457 | #~ msgstr "正在解压..." 458 | 459 | #~ msgid "File download failed or timed out: %s" 460 | #~ msgstr "文件下载失败或超时:%s" 461 | 462 | #~ msgid "File path required." 463 | #~ msgstr "请指定文件路径。" 464 | 465 | #~ msgid "Get remote version info failed." 466 | #~ msgstr "获取远程版本信息失败。" 467 | 468 | #~ msgid "Make sure that the 'Client File' dictionary has enough space." 469 | #~ msgstr "请确保“客户端文件”所在的文件夹具有足够的空间。" 470 | 471 | #~ msgid "Moving..." 472 | #~ msgstr "正在移动..." 473 | 474 | #~ msgid "New version found, but failed to get new version download url." 475 | #~ msgstr "发现新版本,但是获取下载地址失败。" 476 | 477 | #~ msgid "No Update Found" 478 | #~ msgstr "未发现更新" 479 | 480 | #~ msgid "Package update failed." 481 | #~ msgstr "软件包升级失败。" 482 | 483 | #~ msgid "Save Config File" 484 | #~ msgstr "保留配置文件" 485 | 486 | #~ msgid "Save config file while upgrade LuCI." 487 | #~ msgstr "在更新 LuCI 时保留配置文件" 488 | 489 | #~ msgid "The ARCH for checking updates." 490 | #~ msgstr "用于检查更新的 ARCH。" 491 | 492 | #~ msgid "" 493 | #~ "The client file is not suitable for current device. Please reselect ARCH." 494 | #~ msgstr "客户端文件不适用于当前设备,请重新选择 ARCH。" 495 | 496 | #~ msgid "Update Success." 497 | #~ msgstr "更新成功!" 498 | 499 | #~ msgid "Update in progress. Are you sure to close window?" 500 | #~ msgstr "正在更新,确定关闭窗口?" 501 | 502 | #~ msgid "" 503 | #~ "You may need to reload current page after update LuCI. Note that " 504 | #~ "translation will not be updated." 505 | #~ msgstr "更新 LuCI 之后你可能需要手动刷新当前页面。注意:翻译不会被更新" 506 | -------------------------------------------------------------------------------- /po/zh_Hans/kcptun.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "Content-Type: text/plain; charset=UTF-8\n" 3 | 4 | #: luasrc/model/cbi/kcptun/servers-detail.lua:92 5 | msgid "2nd ACK" 6 | msgstr "2次 ACK 跨越重传" 7 | 8 | #: luasrc/model/cbi/kcptun/servers-detail.lua:44 9 | #: luasrc/model/cbi/kcptun/servers.lua:34 10 | msgid "Alias" 11 | msgstr "别名" 12 | 13 | #: luasrc/model/cbi/kcptun/servers-detail.lua:153 14 | msgid "" 15 | "Auto expiration time(in seconds) for a single UDP connection, 0 to disable." 16 | msgstr "单个 UDP 连接的自动过期时间 (秒),设置 0 来禁用" 17 | 18 | #: luasrc/view/kcptun/log_view.htm:29 19 | msgid "Clear Log File" 20 | msgstr "清理日志文件" 21 | 22 | #: luasrc/model/cbi/kcptun/settings.lua:41 23 | msgid "Client File" 24 | msgstr "客户端文件" 25 | 26 | #: luasrc/view/kcptun/status.htm:48 27 | msgid "Client Status" 28 | msgstr "客户端状态" 29 | 30 | #: luasrc/view/kcptun/status.htm:54 31 | msgid "Client Version" 32 | msgstr "客户端版本" 33 | 34 | #: luasrc/view/kcptun/log_view.htm:32 luasrc/view/kcptun/status.htm:50 35 | msgid "Collecting data..." 36 | msgstr "正在收集数据..." 37 | 38 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 39 | msgid "DSCP(6bit)" 40 | msgstr "DSCP(6bit)" 41 | 42 | #: luasrc/model/cbi/kcptun/settings.lua:36 43 | msgid "Disable" 44 | msgstr "禁用" 45 | 46 | #: luasrc/model/cbi/kcptun/servers.lua:65 47 | msgid "Disable Compression" 48 | msgstr "禁用压缩" 49 | 50 | #: luasrc/model/cbi/kcptun/servers-detail.lua:128 51 | msgid "Disable Compression?" 52 | msgstr "是否禁用压缩?" 53 | 54 | #: luasrc/model/cbi/kcptun/servers-detail.lua:32 55 | msgid "Edit Server" 56 | msgstr "编辑服务端" 57 | 58 | #: luasrc/model/cbi/kcptun/servers-detail.lua:74 59 | #: luasrc/model/cbi/kcptun/servers.lua:59 60 | msgid "Embedded Mode" 61 | msgstr "内置模式" 62 | 63 | #: luasrc/model/cbi/kcptun/settings.lua:50 64 | msgid "Enable Logging" 65 | msgstr "启用日志记录" 66 | 67 | #: luasrc/model/cbi/kcptun/servers-detail.lua:80 68 | msgid "Enable nodelay Mode." 69 | msgstr "启用 nodelay 模式" 70 | 71 | #: luasrc/model/cbi/kcptun/servers-detail.lua:68 72 | #: luasrc/model/cbi/kcptun/servers.lua:53 73 | msgid "Encrypt Method" 74 | msgstr "加密方式" 75 | 76 | #: luasrc/view/kcptun/log_view.htm:66 77 | msgid "Error get log data." 78 | msgstr "获取日志数据失败。" 79 | 80 | #: luasrc/model/cbi/kcptun/servers.lua:68 81 | msgid "False" 82 | msgstr "否" 83 | 84 | #: luasrc/model/cbi/kcptun/settings.lua:31 85 | msgid "General Settings" 86 | msgstr "基本设置" 87 | 88 | #: luasrc/view/kcptun/status.htm:61 luasrc/view/kcptun/status.htm:62 89 | #: luasrc/view/kcptun/status.htm:70 90 | msgid "Get latest" 91 | msgstr "获取最新版" 92 | 93 | #: luasrc/model/cbi/kcptun/servers-detail.lua:158 94 | msgid "How long an expired connection can live(in sec), -1 to disable." 95 | msgstr "过期连接保留多长时间 (秒),设置 -1 来禁用" 96 | 97 | #: luasrc/view/kcptun/status.htm:57 98 | msgid "Invalid Client File." 99 | msgstr "客户端文件配置有误" 100 | 101 | #: luasrc/model/cbi/kcptun/servers-detail.lua:32 102 | #: luasrc/model/cbi/kcptun/servers.lua:17 103 | #: luasrc/model/cbi/kcptun/settings.lua:28 luasrc/view/kcptun/log_view.htm:26 104 | msgid "Kcptun" 105 | msgstr "" 106 | 107 | #: luasrc/controller/kcptun.lua:15 108 | msgid "Kcptun Client" 109 | msgstr "Kcptun 客户端" 110 | 111 | #: luasrc/model/cbi/kcptun/servers-detail.lua:63 112 | msgid "Key" 113 | msgstr "密码" 114 | 115 | #: luasrc/view/kcptun/log_view.htm:61 116 | msgid "Last 50 lines of log file:" 117 | msgstr "日志文件的最新 50 行:" 118 | 119 | #: luasrc/view/kcptun/log_view.htm:63 120 | msgid "Last 50 lines of syslog:" 121 | msgstr "系统日志的最新 50 行:" 122 | 123 | #: luasrc/model/cbi/kcptun/servers.lua:46 124 | msgid "Listen Address" 125 | msgstr "监听地址" 126 | 127 | #: luasrc/view/kcptun/log_view.htm:32 128 | msgid "Loading" 129 | msgstr "正在加载..." 130 | 131 | #: luasrc/model/cbi/kcptun/servers-detail.lua:54 132 | msgid "Local Listen Host" 133 | msgstr "本地监听地址" 134 | 135 | #: luasrc/model/cbi/kcptun/servers-detail.lua:59 136 | msgid "Local Listen Port." 137 | msgstr "本地监听端口" 138 | 139 | #: luasrc/model/cbi/kcptun/servers-detail.lua:59 140 | msgid "Local Port" 141 | msgstr "本地端口" 142 | 143 | #: luasrc/model/cbi/kcptun/servers-detail.lua:55 144 | msgid "Local listen host." 145 | msgstr "本地监听主机" 146 | 147 | #: luasrc/controller/kcptun.lua:25 148 | msgid "Log" 149 | msgstr "日志" 150 | 151 | #: luasrc/view/kcptun/log_view.htm:26 152 | msgid "Log Data" 153 | msgstr "日志数据" 154 | 155 | #: luasrc/model/cbi/kcptun/settings.lua:53 156 | msgid "Log Folder" 157 | msgstr "日志文件夹" 158 | 159 | #: luasrc/view/kcptun/status.htm:67 160 | msgid "LuCI Version" 161 | msgstr "LuCI 版本" 162 | 163 | #: luasrc/model/cbi/kcptun/servers-detail.lua:98 164 | msgid "Maximum transmission unit of UDP packets." 165 | msgstr "UDP 数据包的最大传输单元" 166 | 167 | #: luasrc/model/cbi/kcptun/settings.lua:82 168 | msgid "Memory percentage" 169 | msgstr "内存百分比" 170 | 171 | #: luasrc/model/cbi/kcptun/servers-detail.lua:229 172 | msgid "" 173 | "NAT keepalive interval to prevent your router from removing port mapping, " 174 | "default unit is seconds." 175 | msgstr "NAT Keepalive 包间隔时间(秒), 防止路由器删除端口映射" 176 | 177 | #: luasrc/view/kcptun/log_view.htm:62 luasrc/view/kcptun/log_view.htm:64 178 | msgid "No log data." 179 | msgstr "无日志数据。" 180 | 181 | #: luasrc/model/cbi/kcptun/servers.lua:36 182 | msgid "None" 183 | msgstr "无" 184 | 185 | #: luasrc/view/kcptun/status.htm:83 186 | msgid "Not Running" 187 | msgstr "未运行" 188 | 189 | #: luasrc/model/cbi/kcptun/servers-detail.lua:148 190 | msgid "Number of UDP connections to server." 191 | msgstr "到服务端的 UDP 连接数量" 192 | 193 | #: luasrc/model/cbi/kcptun/servers-detail.lua:90 194 | msgid "Off" 195 | msgstr "关闭" 196 | 197 | #: luasrc/model/cbi/kcptun/servers-detail.lua:91 198 | msgid "On" 199 | msgstr "开启" 200 | 201 | #: luasrc/model/cbi/kcptun/servers-detail.lua:209 202 | msgid "Per stream receive buffer, default unit is MB." 203 | msgstr "每个传输流最大内存大小 (MB)" 204 | 205 | #: luasrc/model/cbi/kcptun/servers-detail.lua:64 206 | msgid "Pre-shared secret for client and server." 207 | msgstr "客户端和服务端的通信密码" 208 | 209 | #: luasrc/view/kcptun/log_view.htm:42 210 | msgid "Processing..." 211 | msgstr "正在操作..." 212 | 213 | #: luasrc/model/cbi/kcptun/servers-detail.lua:109 214 | msgid "Receive Window Size(num of packets)." 215 | msgstr "接收窗口大小 (数据包数量)" 216 | 217 | #: luasrc/model/cbi/kcptun/servers-detail.lua:115 218 | msgid "Reed-solomon Erasure Coding - datashard." 219 | msgstr "前向纠错 - datashard" 220 | 221 | #: luasrc/model/cbi/kcptun/servers-detail.lua:120 222 | msgid "Reed-solomon Erasure Coding - parityshard." 223 | msgstr "前向纠错 - parityshard" 224 | 225 | #: luasrc/view/kcptun/log_view.htm:33 226 | msgid "Refresh every 5 seconds." 227 | msgstr "每 5 秒刷新。" 228 | 229 | #: luasrc/model/cbi/kcptun/settings.lua:44 230 | msgid "Run Daemon as User" 231 | msgstr "以该用户启动" 232 | 233 | #: luasrc/view/kcptun/status.htm:83 234 | msgid "Running" 235 | msgstr "运行中" 236 | 237 | #: luasrc/view/kcptun/status.htm:45 238 | msgid "Running Status" 239 | msgstr "运行状态" 240 | 241 | #: luasrc/model/cbi/kcptun/servers-detail.lua:234 242 | msgid "SNMP collect period, in seconds" 243 | msgstr "SNMP采集周期 (秒)" 244 | 245 | #: luasrc/model/cbi/kcptun/servers-detail.lua:103 246 | msgid "Send Window Size(num of packets)." 247 | msgstr "发送窗口大小 (数据包数量)" 248 | 249 | #: luasrc/model/cbi/kcptun/servers-detail.lua:163 250 | msgid "Send/secv buffer size of udp sockets, default unit is MB." 251 | msgstr "发送/接收UDP数据包的缓冲区大小 (MB)" 252 | 253 | #: luasrc/model/cbi/kcptun/servers-detail.lua:46 254 | #: luasrc/model/cbi/kcptun/settings.lua:35 255 | msgid "Server" 256 | msgstr "服务端地址" 257 | 258 | #: luasrc/model/cbi/kcptun/servers.lua:39 259 | msgid "Server Address" 260 | msgstr "服务端地址" 261 | 262 | #: luasrc/model/cbi/kcptun/servers.lua:17 263 | msgid "Server List" 264 | msgstr "服务端列表" 265 | 266 | #: luasrc/controller/kcptun.lua:22 267 | msgid "Server Manage" 268 | msgstr "服务端管理" 269 | 270 | #: luasrc/model/cbi/kcptun/servers-detail.lua:50 271 | msgid "Server Port" 272 | msgstr "服务端端口" 273 | 274 | #: luasrc/controller/kcptun.lua:18 luasrc/model/cbi/kcptun/settings.lua:28 275 | msgid "Settings" 276 | msgstr "设置" 277 | 278 | #: luasrc/model/cbi/kcptun/servers-detail.lua:183 279 | msgid "Specify smux version, available 1,2, default: 1" 280 | msgstr "设置 smux 版本,可选 1, 2。默认:1" 281 | 282 | #: luasrc/model/cbi/kcptun/servers-detail.lua:133 283 | msgid "Suppress the 'stream open/close' messages" 284 | msgstr "不打印 'stream open/close' 信息" 285 | 286 | #: luasrc/model/cbi/kcptun/servers-detail.lua:138 287 | msgid "TCP transmission" 288 | msgstr "TCP 传输" 289 | 290 | #: luasrc/model/cbi/kcptun/settings.lua:83 291 | msgid "The maximum percentage of memory used by Kcptun." 292 | msgstr "Kcptun 可使用的最大内存百分比" 293 | 294 | #: luasrc/model/cbi/kcptun/servers-detail.lua:189 295 | msgid "The overall de-mux buffer, default unit is MB." 296 | msgstr "缓存大小 (MB)" 297 | 298 | #: luasrc/model/cbi/kcptun/servers.lua:68 299 | msgid "True" 300 | msgstr "是" 301 | 302 | #: luasrc/model/cbi/kcptun/servers-detail.lua:143 303 | msgid "acknodelay" 304 | msgstr "" 305 | 306 | #: luasrc/model/cbi/kcptun/servers-detail.lua:152 307 | msgid "autoexpire" 308 | msgstr "" 309 | 310 | #: luasrc/model/cbi/kcptun/servers-detail.lua:147 311 | msgid "conn" 312 | msgstr "" 313 | 314 | #: luasrc/model/cbi/kcptun/servers-detail.lua:68 315 | msgid "crypt" 316 | msgstr "" 317 | 318 | #: luasrc/model/cbi/kcptun/servers-detail.lua:114 319 | msgid "datashard" 320 | msgstr "" 321 | 322 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 323 | msgid "dscp" 324 | msgstr "" 325 | 326 | #: luasrc/model/cbi/kcptun/servers-detail.lua:83 327 | msgid "interval" 328 | msgstr "" 329 | 330 | #: luasrc/model/cbi/kcptun/servers-detail.lua:228 331 | msgid "keepalive" 332 | msgstr "" 333 | 334 | #: luasrc/model/cbi/kcptun/servers-detail.lua:74 335 | msgid "mode" 336 | msgstr "" 337 | 338 | #: luasrc/model/cbi/kcptun/servers-detail.lua:97 339 | msgid "mtu" 340 | msgstr "" 341 | 342 | #: luasrc/model/cbi/kcptun/servers-detail.lua:94 343 | msgid "nc" 344 | msgstr "" 345 | 346 | #: luasrc/model/cbi/kcptun/servers-detail.lua:128 347 | msgid "nocomp" 348 | msgstr "" 349 | 350 | #: luasrc/model/cbi/kcptun/servers-detail.lua:80 351 | msgid "nodelay" 352 | msgstr "" 353 | 354 | #: luasrc/model/cbi/kcptun/servers-detail.lua:44 355 | #: luasrc/model/cbi/kcptun/servers-detail.lua:54 356 | #: luasrc/model/cbi/kcptun/servers-detail.lua:63 357 | #: luasrc/model/cbi/kcptun/servers-detail.lua:97 358 | #: luasrc/model/cbi/kcptun/servers-detail.lua:102 359 | #: luasrc/model/cbi/kcptun/servers-detail.lua:108 360 | #: luasrc/model/cbi/kcptun/servers-detail.lua:114 361 | #: luasrc/model/cbi/kcptun/servers-detail.lua:119 362 | #: luasrc/model/cbi/kcptun/servers-detail.lua:124 363 | #: luasrc/model/cbi/kcptun/servers-detail.lua:147 364 | #: luasrc/model/cbi/kcptun/servers-detail.lua:152 365 | #: luasrc/model/cbi/kcptun/servers-detail.lua:157 366 | #: luasrc/model/cbi/kcptun/servers-detail.lua:162 367 | #: luasrc/model/cbi/kcptun/servers-detail.lua:182 368 | #: luasrc/model/cbi/kcptun/servers-detail.lua:188 369 | #: luasrc/model/cbi/kcptun/servers-detail.lua:208 370 | #: luasrc/model/cbi/kcptun/servers-detail.lua:228 371 | #: luasrc/model/cbi/kcptun/servers-detail.lua:234 372 | msgid "optional" 373 | msgstr "可选" 374 | 375 | #: luasrc/model/cbi/kcptun/servers-detail.lua:119 376 | msgid "parityshard" 377 | msgstr "" 378 | 379 | #: luasrc/model/cbi/kcptun/servers-detail.lua:133 380 | msgid "quiet" 381 | msgstr "" 382 | 383 | #: luasrc/model/cbi/kcptun/servers-detail.lua:108 384 | msgid "rcvwnd" 385 | msgstr "" 386 | 387 | #: luasrc/model/cbi/kcptun/servers-detail.lua:88 388 | msgid "resend" 389 | msgstr "" 390 | 391 | #: luasrc/model/cbi/kcptun/servers-detail.lua:157 392 | msgid "scavengettl" 393 | msgstr "" 394 | 395 | #: luasrc/model/cbi/kcptun/servers-detail.lua:188 396 | msgid "smuxbuf" 397 | msgstr "" 398 | 399 | #: luasrc/model/cbi/kcptun/servers-detail.lua:182 400 | msgid "smuxver" 401 | msgstr "" 402 | 403 | #: luasrc/model/cbi/kcptun/servers-detail.lua:102 404 | msgid "sndwnd" 405 | msgstr "" 406 | 407 | #: luasrc/model/cbi/kcptun/servers-detail.lua:233 408 | msgid "snmpperiod" 409 | msgstr "" 410 | 411 | #: luasrc/model/cbi/kcptun/servers-detail.lua:162 412 | msgid "sockbuf" 413 | msgstr "" 414 | 415 | #: luasrc/model/cbi/kcptun/servers-detail.lua:208 416 | msgid "streambuf" 417 | msgstr "" 418 | 419 | #: luasrc/model/cbi/kcptun/servers-detail.lua:138 420 | msgid "tcp" 421 | msgstr "" 422 | 423 | #~ msgid "Auto" 424 | #~ msgstr "自动" 425 | 426 | #~ msgid "CPU Architecture" 427 | #~ msgstr "CPU 架构" 428 | 429 | #~ msgid "Can't determine ARCH, or ARCH not supported. Please select manually." 430 | #~ msgstr "无法自动确定 ARCH,或者不支持该 ARCH,请手动重新选择。" 431 | 432 | #~ msgid "Can't find client in file: %s" 433 | #~ msgstr "无法在文件中找到客户端:%s" 434 | 435 | #~ msgid "Can't move new file to path: %s" 436 | #~ msgstr "无法移动新文件到:%s" 437 | 438 | #~ msgid "Check Kcptun Update" 439 | #~ msgstr "检查 Kcptun 更新" 440 | 441 | #~ msgid "Check LuCI Update" 442 | #~ msgstr "检查 LuCI 更新" 443 | 444 | #~ msgid "Click to Update" 445 | #~ msgstr "点击更新" 446 | 447 | #~ msgid "Client file is required." 448 | #~ msgstr "请指定客户端文件。" 449 | 450 | #~ msgid "Download url is required." 451 | #~ msgstr "请指定下载链接。" 452 | 453 | #~ msgid "Downloading..." 454 | #~ msgstr "正在下载..." 455 | 456 | #~ msgid "Extracting..." 457 | #~ msgstr "正在解压..." 458 | 459 | #~ msgid "File download failed or timed out: %s" 460 | #~ msgstr "文件下载失败或超时:%s" 461 | 462 | #~ msgid "File path required." 463 | #~ msgstr "请指定文件路径。" 464 | 465 | #~ msgid "Get remote version info failed." 466 | #~ msgstr "获取远程版本信息失败。" 467 | 468 | #~ msgid "Make sure that the 'Client File' dictionary has enough space." 469 | #~ msgstr "请确保“客户端文件”所在的文件夹具有足够的空间。" 470 | 471 | #~ msgid "Moving..." 472 | #~ msgstr "正在移动..." 473 | 474 | #~ msgid "New version found, but failed to get new version download url." 475 | #~ msgstr "发现新版本,但是获取下载地址失败。" 476 | 477 | #~ msgid "No Update Found" 478 | #~ msgstr "未发现更新" 479 | 480 | #~ msgid "Package update failed." 481 | #~ msgstr "软件包升级失败。" 482 | 483 | #~ msgid "Save Config File" 484 | #~ msgstr "保留配置文件" 485 | 486 | #~ msgid "Save config file while upgrade LuCI." 487 | #~ msgstr "在更新 LuCI 时保留配置文件" 488 | 489 | #~ msgid "The ARCH for checking updates." 490 | #~ msgstr "用于检查更新的 ARCH。" 491 | 492 | #~ msgid "" 493 | #~ "The client file is not suitable for current device. Please reselect ARCH." 494 | #~ msgstr "客户端文件不适用于当前设备,请重新选择 ARCH。" 495 | 496 | #~ msgid "Update Success." 497 | #~ msgstr "更新成功!" 498 | 499 | #~ msgid "Update in progress. Are you sure to close window?" 500 | #~ msgstr "正在更新,确定关闭窗口?" 501 | 502 | #~ msgid "" 503 | #~ "You may need to reload current page after update LuCI. Note that " 504 | #~ "translation will not be updated." 505 | #~ msgstr "更新 LuCI 之后你可能需要手动刷新当前页面。注意:翻译不会被更新" 506 | -------------------------------------------------------------------------------- /root/etc/config/kcptun: -------------------------------------------------------------------------------- 1 | 2 | config general 'general' 3 | option server '' 4 | option client_file '/usr/bin/kcptun-client' 5 | option daemon_user 'root' 6 | option enable_logging '1' 7 | option mem_percentage '0' 8 | 9 | config servers 'default' 10 | option server_addr '' 11 | option server_port '29900' 12 | option listen_addr '0.0.0.0' 13 | option listen_port '12948' 14 | option crypt 'aes' 15 | option mode 'fast' 16 | option nocomp 'false' 17 | option quiet 'false' 18 | option tcp 'false' 19 | -------------------------------------------------------------------------------- /root/etc/init.d/kcptun: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # 3 | # Copyright 2016-2020 Xingwang Liao 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | START=99 19 | USE_PROCD=1 20 | 21 | KCPTUN=kcptun 22 | CONFIG_FOLDER=/var/etc/$KCPTUN 23 | 24 | if [ -r /usr/share/libubox/jshn.sh ]; then 25 | . /usr/share/libubox/jshn.sh 26 | elif [ -r /lib/functions/jshn.sh ]; then 27 | . /lib/functions/jshn.sh 28 | else 29 | logger -p daemon.err -t "$KCPTUN" \ 30 | "Package required: jshn." 31 | exit 1 32 | fi 33 | 34 | _log() { 35 | local level="$1" 36 | local msg="$2" 37 | 38 | logger -p "daemon.${level}" -t "$KCPTUN" "$msg" 39 | } 40 | 41 | gen_client_config_file() { 42 | local config_file="$1" 43 | 44 | json_init 45 | json_add_string "remoteaddr" "${server_addr}:${server_port}" 46 | json_add_string "localaddr" "${listen_addr}:${listen_port}" 47 | 48 | add_configs() { 49 | local type="$1"; shift 50 | local k v 51 | 52 | for k in "$@"; do 53 | v="$(eval echo "\$$k")" 54 | 55 | if [ -n "$v" ]; then 56 | if [ "$type" = "string" ]; then 57 | json_add_string "$k" "$v" 58 | elif [ "$type" = "int" ]; then 59 | json_add_int "$k" "$v" 60 | elif [ "$type" = "boolean" ]; then 61 | if [ "$v" = "true" ]; then 62 | json_add_boolean "$k" "1" 63 | else 64 | json_add_boolean "$k" "0" 65 | fi 66 | fi 67 | fi 68 | done 69 | } 70 | 71 | add_configs "string" key crypt mode 72 | add_configs "int" conn autoexpire mtu sndwnd rcvwnd datashard parityshard dscp \ 73 | nodelay interval resend nc sockbuf smuxver smuxbuf streambuf keepalive scavengettl snmpperiod 74 | add_configs "boolean" nocomp acknodelay quiet tcp 75 | 76 | if [ -n "$log_file" ]; then 77 | json_add_string "log" "$log_file" 78 | fi 79 | 80 | json_close_object 81 | 82 | json_dump -i >"$config_file" 83 | } 84 | 85 | add_iptables_rule() { 86 | local port="$1" 87 | 88 | iptables-restore --noflush <<-EOF 2>/dev/null 89 | *nat 90 | :KCPTUN - 91 | -A KCPTUN -p tcp --dport $port -j ACCEPT 92 | -A INPUT -p tcp -j KCPTUN 93 | COMMIT 94 | EOF 95 | } 96 | 97 | clear_iptables_rule() { 98 | iptables-save --counters | grep -vi "KCPTUN" | iptables-restore --counters 99 | } 100 | 101 | validate_config_section() { 102 | uci_validate_section "$KCPTUN" general "$1" \ 103 | 'server:uciname' \ 104 | 'client_file:string' \ 105 | 'daemon_user:string:root' \ 106 | 'enable_logging:bool:0' \ 107 | 'log_folder:directory:/var/log/kcptun' \ 108 | 'mem_percentage:range(0,100):80' 109 | } 110 | 111 | validate_server_section() { 112 | uci_validate_section "$KCPTUN" servers "$1" \ 113 | 'server_addr:host' \ 114 | 'server_port:port:29900' \ 115 | 'listen_addr:host:0.0.0.0' \ 116 | 'listen_port:port:12948' \ 117 | 'key:string' \ 118 | 'crypt:string:aes' \ 119 | 'mode:or("normal","fast","fast2","fast3","manual"):fast' \ 120 | 'conn:min(1)' \ 121 | 'autoexpire:uinteger' \ 122 | 'scavengettl:min(-1)' \ 123 | 'mtu:range(64,9200)' \ 124 | 'sndwnd:min(1)' \ 125 | 'rcvwnd:min(1)' \ 126 | 'datashard:uinteger' \ 127 | 'parityshard:uinteger' \ 128 | 'dscp:uinteger' \ 129 | 'nocomp:or("true", "false")' \ 130 | 'quiet:or("true", "false")' \ 131 | 'tcp:or("true", "false")' \ 132 | 'nodelay:bool' \ 133 | 'interval:uinteger' \ 134 | 'resend:range(0,2)' \ 135 | 'nc:bool' \ 136 | 'acknodelay:or("true", "false")' \ 137 | 'sockbuf:uinteger' \ 138 | 'smuxver:or("1", "2")' \ 139 | 'smuxbuf:uinteger' \ 140 | 'streambuf:uinteger' \ 141 | 'keepalive:uinteger' \ 142 | 'snmpperiod:min(1)' 143 | } 144 | 145 | validate_client_file() { 146 | local file="$1" 147 | 148 | if [ ! -f "$file" ]; then 149 | return 1 150 | fi 151 | 152 | test -x "$file" || chmod 755 "$file" 153 | 154 | ( $file -v 2>/dev/null | grep -q "$KCPTUN" ) 155 | } 156 | 157 | start_kcptun_instance() { 158 | local section="$1" 159 | 160 | if ! validate_config_section "$section" ; then 161 | _log "err" "Config validate failed." 162 | return 1 163 | fi 164 | 165 | if [ -z "$server" ] || [ "$server" = "nil" ]; then 166 | _log "info" "No server selected, Client will stop." 167 | return 0 168 | elif ! validate_server_section "$server"; then 169 | _log "err" "Server config validation failed." 170 | return 1 171 | elif [ -z "$server_addr" ] || [ -z "$listen_port" ]; then 172 | _log "err" "Server config validation failed." 173 | return 1 174 | fi 175 | 176 | if [ -z "$client_file" ]; then 177 | _log "err" "Please set client file path, or use auto download." 178 | return 1; 179 | elif ! validate_client_file "$client_file"; then 180 | _log "err" "Client file validation failed." 181 | return 1 182 | fi 183 | 184 | is_ipv6_address() { 185 | echo "$1" | grep -q ":" 186 | } 187 | 188 | is_ipv6_address "$server_addr" && server_addr="[${server_addr}]" 189 | is_ipv6_address "$listen_addr" && listen_addr="[${listen_addr}]" 190 | 191 | test -d "$CONFIG_FOLDER" || mkdir -p "$CONFIG_FOLDER" 192 | 193 | log_file="" 194 | if [ "x$enable_logging" = "x1" ]; then 195 | mkdir -p "$log_folder" 196 | chown -R "$daemon_user" "$log_folder" 197 | log_file="${log_folder}/client.${section}.log" 198 | fi 199 | 200 | local config_file="${CONFIG_FOLDER}/client.${section}.json" 201 | 202 | if ! ( gen_client_config_file "$config_file" ); then 203 | _log "err" "Can't create config file". 204 | return 1 205 | fi 206 | 207 | add_iptables_rule "$listen_port" 208 | 209 | procd_open_instance 210 | procd_set_param command "$client_file" 211 | procd_append_param command -c "$config_file" 212 | 213 | procd_set_param limits nofile="65535 65535" 214 | if [ -e /proc/sys/kernel/core_pattern ] ; then 215 | procd_append_param limits core="unlimited" 216 | fi 217 | 218 | if [ "$mem_percentage" -gt "0" ] ; then 219 | local mem_total="$(awk '/MemTotal/ {print $2}' /proc/meminfo)" 220 | if [ -n "$mem_total" ] ; then 221 | local use_mem="$(expr $mem_total \* $mem_percentage \* 10)" 222 | procd_append_param limits as="$use_mem $use_mem" 223 | 224 | _log "info" "Starting kcptun with $use_mem virt mem" 225 | fi 226 | fi 227 | 228 | procd_set_param respawn 229 | procd_set_param user "$daemon_user" 230 | procd_set_param file "$config_file" 231 | procd_close_instance 232 | } 233 | 234 | service_triggers() { 235 | procd_add_reload_trigger "$KCPTUN" 236 | } 237 | 238 | start_service() { 239 | clear_iptables_rule 240 | 241 | config_load "$KCPTUN" 242 | config_foreach start_kcptun_instance "general" 243 | } 244 | 245 | stop_service() { 246 | clear_iptables_rule 247 | } 248 | -------------------------------------------------------------------------------- /root/etc/uci-defaults/40_luci-kcptun: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@kcptun[-1] 5 | add ucitrack kcptun 6 | set ucitrack.@kcptun[-1].init=kcptun 7 | commit ucitrack 8 | EOF 9 | 10 | general=$(uci -q get kcptun.@general[-1]) 11 | 12 | if [ -z "$general" ]; then 13 | uci -q add kcptun general 14 | fi 15 | 16 | if [ ."$general" != ."general" ]; then 17 | uci -q batch <<-EOF >/dev/null 18 | rename kcptun.@general[-1]="general" 19 | set kcptun.general.server="" 20 | commit kcptun 21 | EOF 22 | fi 23 | 24 | rm -rf /tmp/luci-indexcache /tmp/luci-modulecache 25 | exit 0 26 | --------------------------------------------------------------------------------