Skip to content

Commit

Permalink
luci: New options for v0.26.0
Browse files Browse the repository at this point in the history
Signed-off-by: Xingwang Liao <kuoruan@gmail.com>
  • Loading branch information
kuoruan committed Apr 11, 2019
1 parent a2204b7 commit de1a042
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 181 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-frpc
PKG_VERSION:=1.0.1
PKG_VERSION:=1.1.0
PKG_RELEASE:=1

PKG_LICENSE:=MIT
Expand Down
5 changes: 2 additions & 3 deletions luasrc/model/cbi/frpc/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ for k, v in pairs(server_table) do
o:value(k, v)
end

o = s:taboption("general", ListValue, "run_user", translate("Run daemon as user"),
translate("Leave blank to use default user"))
o:value("")
o = s:taboption("general", ListValue, "run_user", translate("Run daemon as user"))
o:value("", translate("-- default --"))
local user
for user in util.execi("cat /etc/passwd | cut -d':' -f1") do
o:value(user)
Expand Down
40 changes: 33 additions & 7 deletions luasrc/model/cbi/frpc/rule-detail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,46 @@ o:value("unix_domain_socket")
o:value("http_proxy")
o:value("socks5")
o:value("static_file")
o:value("https2http")

o = s:option(Value, "plugin_unix_path", translate("Plugin unix path"))
o = s:option(Value, "plugin_unix_path", "% - %" % { translate("Plugin"), translate("Unix path") })
o.datatype = "file"
o:depends("plugin", "unix_domain_socket")

o = s:option(Value, "plugin_user", translate("Plugin user"))
o = s:option(Value, "plugin_user", "% - %" % { translate("Plugin"), translate("User") })
o:depends("plugin", "socks5")

o = s:option(Value, "plugin_passwd", translate("Plugin password"))
o = s:option(Value, "plugin_passwd", "% - %" % { translate("Plugin"), translate("Password") })
o:depends("plugin", "socks5")

o = s:option(Value, "plugin_local_path", translate("Plugin local path"))
o = s:option(Value, "plugin_local_path", "% - %" % { translate("Plugin"), translate("Local path") })
o:depends("plugin", "static_file")

o = s:option(Value, "plugin_strip_prefix", translate("Plugin strip prefix"))
o = s:option(Value, "plugin_strip_prefix", "% - %" % { translate("Plugin"), translate("Strip prefix") })
o:depends("plugin", "static_file")

o = s:option(Value, "plugin_http_user", translate("Plugin http user"))
o = s:option(Value, "plugin_http_user", "% - %" % { translate("Plugin"), translate("HTTP user") })
o:depends("plugin", "http_proxy")
o:depends("plugin", "static_file")

o = s:option(Value, "plugin_http_passwd", translate("Plugin http password"))
o = s:option(Value, "plugin_http_passwd", "% - %" % { translate("Plugin"), translate("HTTP password") })
o:depends("plugin", "http_proxy")
o:depends("plugin", "static_file")

o = s:option(Value, "plugin_local_addr", "% - %" % { translate("Plugin"), translate("Local addr") })
o:depends("plugin", "https2http")

o = s:option(Value, "plugin_crt_path", "% - %" % { translate("Plugin"), translate("Certificate path") })
o.datatype = "file"
o:depends("plugin", "https2http")

o = s:option(Value, "plugin_key_path", "% - %" % { translate("Plugin"), translate("Key path") })
o.datatype = "file"
o:depends("plugin", "https2http")

o = s:option(Value, "plugin_host_header_rewrite", "% - %" % { translate("Plugin"), translate("Host header rewrite") })
o:depends("plugin", "https2http")

o = s:option(Value, "local_ip", translate("Local IP"))
o.datatype = "host"
o:depends("plugin", "")
Expand Down Expand Up @@ -136,6 +152,16 @@ o = s:option(Value, "host_header_rewrite", translate("Host header rewrite"))
o:depends("type", "http")
o:depends("type", "https")

o = s:option(ListValue, "proxy_protocol_version", translate("Proxy protocol version"))
o:value("")
o:value("v1")
o:value("v2")
o:depends("type", "tcp")
o:depends("type", "http")
o:depends("type", "https")
o:depends("type", "stcp")
o:depends("type", "xtcp")

o = s:option(Value, "group", translate("Group"))

o = s:option(Value, "group_key", translate("Group key"))
Expand Down
Loading

0 comments on commit de1a042

Please sign in to comment.