mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
luci-app-frpc: Support TLS Connection and Admin Web (#6945)
This commit is contained in:
parent
38862e7f50
commit
d871216a7c
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
LUCI_TITLE:=LuCI for FRPC
|
||||
LUCI_DEPENDS:=+wget +frpc
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.3
|
||||
PKG_VERSION:=1.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
@ -42,6 +42,9 @@ e.rmempty=false
|
||||
e=t:taboption("other",Flag, "tcp_mux", translate("TCP Stream Multiplexing"), translate("Default is Ture. This feature in frps.ini and frpc.ini must be same."))
|
||||
e.default = "1"
|
||||
e.rmempty=false
|
||||
e=t:taboption("other",Flag, "tls_enable", translate("Use TLS Connection"), translate("if tls_enable is true, frpc will connect frps by tls."))
|
||||
e.default = "0"
|
||||
e.rmempty=false
|
||||
e=t:taboption("other",ListValue, "protocol", translate("Protocol Type"),translate("Frp support kcp protocol since v0.12.0"))
|
||||
e.default = "tcp"
|
||||
e:value("tcp",translate("TCP Protocol"))
|
||||
@ -78,6 +81,26 @@ e.datatype = "uinteger"
|
||||
e.default = "3"
|
||||
e.rmempty=false
|
||||
e.optional=false
|
||||
e=t:taboption("other",Flag, "admin_enable", translate("Enable Web API"), translate("set admin address for control frpc's action by http api such as reload."))
|
||||
e.default = "0"
|
||||
e.rmempty=false
|
||||
e=t:taboption("other",Value, "admin_port", translate("Admin Web Port"))
|
||||
e.datatype = "port"
|
||||
e.default=7400
|
||||
e.rmempty=false
|
||||
e:depends("admin_enable",1)
|
||||
e=t:taboption("other",Value, "admin_user", translate("Admin Web UserName"))
|
||||
e.optional=false
|
||||
e.default = "admin"
|
||||
e.rmempty=false
|
||||
e:depends("admin_enable",1)
|
||||
e=t:taboption("other",Value, "admin_pwd", translate("Admin Web PassWord"))
|
||||
e.optional=false
|
||||
e.default = "admin"
|
||||
e.password=true
|
||||
e.rmempty=false
|
||||
e:depends("admin_enable",1)
|
||||
|
||||
e=t:taboption("log",TextValue,"log")
|
||||
e.rows=26
|
||||
e.wrap="off"
|
||||
|
@ -68,6 +68,12 @@ msgstr "第一次登录失败就退出程序,否则将持续尝试登陆 Frp
|
||||
msgid "Default is Ture. This feature in frps.ini and frpc.ini must be same."
|
||||
msgstr "该功能默认启用,该配置项在服务端和客户端必须保持一致。"
|
||||
|
||||
msgid "Use TLS Connection"
|
||||
msgstr "TLS连接"
|
||||
|
||||
msgid "if tls_enable is true, frpc will connect frps by tls."
|
||||
msgstr "使用TLS协议与服务器连接(若连接服务器异常可以尝试开启)"
|
||||
|
||||
msgid "Protocol Type"
|
||||
msgstr "协议类型"
|
||||
|
||||
@ -128,6 +134,21 @@ msgstr "错误"
|
||||
msgid "Log Keepd Max Days"
|
||||
msgstr "日志记录天数"
|
||||
|
||||
msgid "Enable Web API"
|
||||
msgstr "开启网页管理"
|
||||
|
||||
msgid "set admin address for control frpc's action by http api such as reload."
|
||||
msgstr "可通过http查看客户端状态以及通过API控制"
|
||||
|
||||
msgid "Admin Web Port"
|
||||
msgstr "管理员端口号"
|
||||
|
||||
msgid "Admin Web UserName"
|
||||
msgstr "管理员用户名"
|
||||
|
||||
msgid "Admin Web PassWord"
|
||||
msgstr "管理员密码"
|
||||
|
||||
msgid "Services List"
|
||||
msgstr "服务列表"
|
||||
|
||||
|
@ -171,8 +171,8 @@ boot() {
|
||||
start() {
|
||||
|
||||
config_load "frp"
|
||||
local enabled server_addr server_port time privilege_token user tcp_mux enable_cpool
|
||||
local pool_count log_level log_max_days login_fail_exit http_proxy protocol
|
||||
local enabled server_addr server_port time privilege_token user tcp_mux enable_cpool tls_enable
|
||||
local pool_count log_level log_max_days login_fail_exit http_proxy protocol admin_port admin_user admin_pwd
|
||||
|
||||
config_get_bool enabled common enabled 1
|
||||
|
||||
@ -189,6 +189,10 @@ start() {
|
||||
config_get http_proxy common http_proxy
|
||||
config_get protocol common protocol
|
||||
config_get time common time
|
||||
config_get admin_port common admin_port
|
||||
config_get admin_user common admin_user
|
||||
config_get admin_pwd common admin_pwd
|
||||
|
||||
|
||||
mkdir -p /var/etc/frp
|
||||
[ ! -f "$LOGFILE" ] && touch $LOGFILE
|
||||
@ -209,9 +213,14 @@ start() {
|
||||
echo "log_file=$LOGFILE" >>$tmpconf
|
||||
[ -n "$http_proxy" ] && echo "http_proxy=$http_proxy" >>$tmpconf
|
||||
[ -n "$pool_count" ] && echo "pool_count=$pool_count" >>$tmpconf
|
||||
[ -n "$admin_port" ] && echo "admin_addr=0.0.0.0" >>$tmpconf && echo "admin_port=$admin_port" >>$tmpconf
|
||||
[ -n "$admin_user" ] && echo "admin_user=$admin_user" >>$tmpconf
|
||||
[ -n "$admin_pwd" ] && echo "admin_pwd=$admin_pwd" >>$tmpconf
|
||||
|
||||
|
||||
config_load "frp"
|
||||
frp_write_bool tcp_mux common 1
|
||||
frp_write_bool tls_enable common 0
|
||||
frp_write_bool login_fail_exit common 1
|
||||
config_foreach conf_proxy_add proxy "$tmpconf"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user