diff options
Diffstat (limited to 'applications/luci-app-openvpn')
6 files changed, 96 insertions, 137 deletions
diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua index dc7718217c..6dc43bec24 100644 --- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua +++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua @@ -204,10 +204,6 @@ local knownParams = { "dev_node", "/dev/net/tun", translate("Use tun/tap device node") }, - { Flag, - "tun_ipv6", - 0, - translate("Make tun device IPv6 capable") }, { Value, "ifconfig", "10.200.200.3 10.200.200.1", @@ -248,15 +244,6 @@ local knownParams = { "mtu_test", 0, translate("Empirically measure MTU") }, - { ListValue, - "comp_lzo", - { "yes", "no", "adaptive" }, - translate("Use fast LZO compression") }, - { Flag, - "comp_noadapt", - 0, - translate("Don't use adaptive lzo compression"), - { comp_lzo=1 } }, { Value, "link_mtu", 1500, @@ -375,7 +362,7 @@ local knownParams = { { client="0" }, { client="" } }, { DynamicList, "push", - { "redirect-gateway", "comp-lzo" }, + { "redirect-gateway" }, translate("Push options to peer"), { client="0" }, { client="" } }, { Flag, @@ -398,12 +385,6 @@ local knownParams = { "/etc/openvpn/ipp.txt 600", translate("Persist/unpersist ifconfig-pool"), { client="0" }, { client="" } }, - -- deprecated and replaced by --topology p2p - -- { Flag, - -- "ifconfig_pool_linear", - -- 0, - -- translate("Use individual addresses rather than /30 subnets"), - -- { client="0" }, { client="" } }, { Value, "ifconfig_push", "10.200.200.1 255.255.255.255", @@ -470,11 +451,6 @@ local knownParams = { translate("Allowed maximum of new connections"), { client="0" }, { client="" } }, { Flag, - "client_cert_not_required", - 0, - translate("Don't require client certificate"), - { client="0" }, { client="" } }, - { Flag, "username_as_common_name", 0, translate("Use username as common name"), @@ -591,10 +567,6 @@ local knownParams = { "engine", "dynamic", translate("Enable OpenSSL hardware crypto engines") }, - { Flag, - "no_replay", - 0, - translate("Disable replay protection") }, { Value, "replay_window", "64 15", @@ -608,10 +580,6 @@ local knownParams = { "/var/run/openvpn-replay-state", translate("Persist replay-protection state") }, { Flag, - "no_iv", - 0, - translate("Disable cipher initialisation vector") }, - { Flag, "tls_server", 0, translate("Enable TLS and assume server role"), diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua index 3f651c0ada..483860c8e9 100644 --- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua +++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua @@ -4,7 +4,6 @@ require("luci.ip") require("luci.model.uci") - local basicParams = { -- -- Widget, Name, Default(s), Description @@ -14,14 +13,12 @@ local basicParams = { { Value, "nice",0, translate("Change process priority") }, { Value,"port",1194, translate("TCP/UDP port # for both local and remote") }, { ListValue,"dev_type",{ "tun", "tap" }, translate("Type of used device") }, - { Flag,"tun_ipv6",0, translate("Make tun device IPv6 capable") }, { Value,"ifconfig","10.200.200.3 10.200.200.1", translate("Set tun/tap adapter parameters") }, { Value,"server","10.200.200.0 255.255.255.0", translate("Configure server mode") }, { Value,"server_bridge","192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254", translate("Configure server bridge") }, { Flag,"nobind",0, translate("Do not bind to local address and port") }, - { ListValue,"comp_lzo",{"yes","no","adaptive"}, translate("Use fast LZO compression") }, { Value,"keepalive","10 60", translate("Helper directive to simplify the expression of --ping and --ping-restart in server mode configurations") }, { ListValue,"proto",{ "udp", "tcp-client", "tcp-server" }, translate("Use protocol") }, diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua index a6b0e1dd90..e17aa4085b 100644 --- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua +++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua @@ -52,21 +52,22 @@ function s.create(self, name) luci.cbi.CREATE_PREFIX .. self.config .. "." .. self.sectiontype .. ".select" ) - name = luci.http.formvalue( + local name = luci.http.formvalue( luci.cbi.CREATE_PREFIX .. self.config .. "." .. self.sectiontype .. ".text" ) if #name > 3 and not name:match("[^a-zA-Z0-9_]") then - uci:section( - "openvpn", "openvpn", name, - uci:get_all( "openvpn_recipes", recipe ) - ) - - uci:delete("openvpn", name, "_role") - uci:delete("openvpn", name, "_description") - uci:save("openvpn") - - luci.http.redirect( self.extedit:format(name) ) + local s = uci:section("openvpn", "openvpn", name) + if s then + local options = uci:get_all("openvpn_recipes", recipe) + for k, v in pairs(options) do + uci:set("openvpn", name, k, v) + end + uci:delete("openvpn", name, "_role") + uci:delete("openvpn", name, "_description") + uci:save("openvpn") + luci.http.redirect( self.extedit:format(name) ) + end elseif #name > 0 then self.invalid_cts = true end diff --git a/applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm b/applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm index f22cb68c7b..8cb019b461 100644 --- a/applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm +++ b/applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm @@ -4,11 +4,11 @@ Licensed to the public under the Apache License 2.0. -%> -<fieldset class="cbi-section"> - <legend> +<div class="cbi-section"> + <h3> <a href="<%=url('admin/services/openvpn')%>"><%:Overview%></a> » <%=luci.i18n.translatef("Instance \"%s\"", self.instance)%> - </legend> + </h3> <% if self.mode == "basic" then %> <a href="<%=url('admin/services/openvpn/advanced', self.instance, "Service")%>"><%:Switch to advanced configuration »%></a> @@ -27,4 +27,4 @@ <% if next(self.categories, i) then %>|<% end %> <% end %> <% end %> -</fieldset> +</div> diff --git a/applications/luci-app-openvpn/po/zh-tw/openvpn.po b/applications/luci-app-openvpn/po/zh-tw/openvpn.po index 38bb6fcd0e..f98d24c6c1 100644 --- a/applications/luci-app-openvpn/po/zh-tw/openvpn.po +++ b/applications/luci-app-openvpn/po/zh-tw/openvpn.po @@ -1,12 +1,12 @@ # -# Yangfl <mmyangfl@gmail.com>, 2017. +# Yangfl <mmyangfl@gmail.com>, 2017, 2018. # msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-05-19 19:35+0200\n" -"PO-Revision-Date: 2017-10-29 14:37+0800\n" +"PO-Revision-Date: 2018-08-07 17:36+0800\n" "Last-Translator: Yangfl <mmyangfl@gmail.com>\n" "Language-Team: <debian-l10n-chinese@lists.debian.org>\n" "Language: zh_TW\n" @@ -68,7 +68,7 @@ msgid "Below is a list of configured OpenVPN instances and their current state" msgstr "以下是 OpenVPN 已配置例項及其當前狀態的列表" msgid "Call down cmd/script before TUN/TAP close" -msgstr "TUN/TAP 關閉前的命令列及指令碼" +msgstr "TUN/TAP 關閉前的指令列及指令碼" msgid "Certificate authority" msgstr "認證授權" @@ -122,7 +122,7 @@ msgid "Diffie Hellman parameters" msgstr "Diffie–Hellman/DH 金鑰交換引數" msgid "Directory for custom client config files" -msgstr "自定義客戶端配置檔案的目錄" +msgstr "自訂客戶端配置檔案的目錄" msgid "Disable Paging" msgstr "禁止分頁" @@ -140,7 +140,7 @@ msgid "Do not bind to local address and port" msgstr "不繫結本地位址和埠" msgid "Don't actually execute ifconfig" -msgstr "不實際執行 ifconfig 命令" +msgstr "不實際執行 ifconfig 指令" msgid "Don't add routes automatically" msgstr "不自動新增路由" @@ -206,10 +206,10 @@ msgid "Encryption cipher for packets" msgstr "加密資料包" msgid "Execute shell cmd after routes are added" -msgstr "新增路由後執行 shell 命令" +msgstr "新增路由後執行 shell 指令" msgid "Execute shell command on remote ip change" -msgstr "當遠端 ip 改變時執行 shell 命令" +msgstr "當遠端 ip 改變時執行 shell 指令" msgid "" "Executed in server mode on new client connections, when the client is still " @@ -348,7 +348,7 @@ msgid "Randomly choose remote server" msgstr "隨機選擇遠端伺服器" msgid "Refuse connection if no custom client config" -msgstr "拒接沒有自定義客戶端配置的連線" +msgstr "拒接沒有自訂客戶端配置的連線" msgid "Remap SIGUSR1 signals" msgstr "重對映 SIGUSR1 訊號" @@ -396,10 +396,10 @@ msgid "Run as an inetd or xinetd server" msgstr "以 inetd 或 xinetd 伺服器的方式執行" msgid "Run script cmd on client connection" -msgstr "當客戶端連線時在命令列下允許指令碼" +msgstr "當客戶端連線時在指令列下允許指令碼" msgid "Run script cmd on client disconnection" -msgstr "當客戶端斷開時在命令列下允許指令碼" +msgstr "當客戶端斷開時在指令列下允許指令碼" msgid "Run up/down scripts for all restarts" msgstr "每次重啟都執行啟動/關閉指令碼" @@ -453,13 +453,13 @@ msgid "Shaping for peer bandwidth" msgstr "改變結點頻寬" msgid "Shell cmd to execute after tun device open" -msgstr "tun 裝置開啟後執行的 shell 命令" +msgstr "tun 裝置開啟後執行的 shell 指令" msgid "Shell cmd to run after tun device close" -msgstr "tun 裝置關閉後執行的 shell 命令" +msgstr "tun 裝置關閉後執行的 shell 指令" msgid "Shell command to verify X509 name" -msgstr "執行 shell 命令以驗證 X509 名稱" +msgstr "執行 shell 指令以驗證 X509 名稱" msgid "Silence the output of replay warnings" msgstr "以靜音的方式發出重播警告" diff --git a/applications/luci-app-openvpn/root/etc/config/openvpn_recipes b/applications/luci-app-openvpn/root/etc/config/openvpn_recipes index 1b394dffbc..69270e48e1 100644 --- a/applications/luci-app-openvpn/root/etc/config/openvpn_recipes +++ b/applications/luci-app-openvpn/root/etc/config/openvpn_recipes @@ -2,101 +2,94 @@ # Routed point-to-point server # config openvpn_recipe server_tun_ptp - option _description "Simple server configuration for a routed point-to-point VPN" - option _role "server" - option dev "tun" - option ifconfig "10.0.0.1 10.0.0.2" - option secret "shared-secret.key" - option keepalive "10 60" - option comp_lzo "yes" - option verb "3" - option mssfix "1420" + option _description 'Simple server configuration for a routed point-to-point VPN' + option _role 'server' + option dev 'tun' + option ifconfig '10.0.0.1 10.0.0.2' + option secret 'shared-secret.key' + option keepalive '10 60' + option verb '3' + option mssfix '1420' # # Routed point-to-point client # config openvpn_recipe client_tun_ptp - option _description "Simple client configuration for a routed point-to-point VPN" - option _role "client" - option dev "tun" - list remote "vpnserver.example.org" - option ifconfig "10.0.0.2 10.0.0.1" - option secret "shared-secret.key" - option nobind "1" - option comp_lzo "yes" - option verb "3" + option _description 'Simple client configuration for a routed point-to-point VPN' + option _role 'client' + option dev 'tun' + list remote 'vpnserver.example.org' + option ifconfig '10.0.0.2 10.0.0.1' + option secret 'shared-secret.key' + option nobind '1' + option verb '3' # # Routed multi-client server # config openvpn_recipe server_tun - option _description "Server configuration for a routed multi-client VPN" - option _role "server" - option dev "tun" - option server "10.0.100.0 255.255.255.0" - option ca "ca.crt" - option cert "server.crt" - option key "server.key" - option dh "dh1024.pem" - option keepalive "10 60" - option comp_lzo "yes" - option verb "3" - option mssfix "1420" + option _description 'Server configuration for a routed multi-client VPN' + option _role 'server' + option dev 'tun' + option server '10.0.100.0 255.255.255.0' + option ca 'ca.crt' + option cert 'server.crt' + option key 'server.key' + option dh 'dh1024.pem' + option keepalive '10 60' + option verb '3' + option mssfix '1420' # # Routed client # config openvpn_recipe client_tun - option _description "Client configuration for a routed multi-client VPN" - option _role "client" - option client "1" - option dev "tun" - list remote "vpnserver.example.org" - option pkcs12 "my_client.p12" - option remote_cert_tls "server" - option comp_lzo "yes" - option nobind "1" - option persist_key "1" - option persist_tun "1" - option verb "3" - option reneg_sec "0" - option float "1" + option _description 'Client configuration for a routed multi-client VPN' + option _role 'client' + option client '1' + option dev 'tun' + list remote 'vpnserver.example.org' + option pkcs12 'my_client.p12' + option remote_cert_tls 'server' + option nobind '1' + option persist_key '1' + option persist_tun '1' + option verb '3' + option reneg_sec '0' + option float '1' # # Multi-client ethernet bridge server # config openvpn_recipe server_tap_bridge - option _description "Server configuration for an ethernet bridge VPN" - option _role "server" - option dev "tap" - option server_bridge "192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254" - option ca "ca.crt" - option cert "server.crt" - option key "server.key" - option dh "dh1024.pem" - option keepalive "10 60" - option comp_lzo "yes" - option verb "3" - option mssfix "1420" + option _description 'Server configuration for an ethernet bridge VPN' + option _role 'server' + option dev 'tap' + option server_bridge '192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254' + option ca 'ca.crt' + option cert 'server.crt' + option key 'server.key' + option dh 'dh1024.pem' + option keepalive '10 60' + option verb '3' + option mssfix '1420' # # Ethernet bridge client # config openvpn_recipe client_tap_bridge - option _description "Client configuration for an ethernet bridge VPN" - option _role "client" - option client "1" - option dev "tap" - list remote "vpnserver.example.org" - option ca "ca.crt" - option cert "my_client.crt" - option key "my_client.key" - option dh "dh1024.pem" - option remote_cert_tls "server" - option comp_lzo "yes" - option nobind "1" - option persist_key "1" - option verb "3" - option reneg_sec "0" - option float "1" - + option _description 'Client configuration for an ethernet bridge VPN' + option _role 'client' + option client '1' + option dev 'tap' + list remote 'vpnserver.example.org' + option ca 'ca.crt' + option cert 'my_client.crt' + option key 'my_client.key' + option dh 'dh1024.pem' + option remote_cert_tls 'server' + option nobind '1' + option persist_key '1' + option verb '3' + option reneg_sec '0' + option float '1' |