尝试修复插件使之正常工作
This commit is contained in:
parent
4fe412086d
commit
933df1aeea
@ -4,32 +4,32 @@
|
||||
local m, s, o
|
||||
|
||||
m = Map("frps")
|
||||
#页面标题和描述
|
||||
-- 页面标题和描述
|
||||
m.title = translate("Frps - Common Settings")
|
||||
m.description = translate("Frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.<br/><a href=\"https://github.com/fatedier/frp\" target=\"_blank\">Project GitHub URL</a>")
|
||||
|
||||
#获取frps服务器状态与版本
|
||||
-- 获取frps服务器状态与版本
|
||||
m:section(SimpleSection).template = "frps/frps_status"
|
||||
|
||||
#读配置文件
|
||||
-- 读配置文件
|
||||
s = m:section(NamedSection, "main", "frps")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
# 创建Tab分页
|
||||
-- 创建Tab分页
|
||||
s:tab("general", translate("General Options"))
|
||||
s:tab("advanced", translate("Advanced Options"))
|
||||
s:tab("dashboard", translate("Dashboard Options"))
|
||||
|
||||
#是否启用插件功能
|
||||
-- 是否启用插件功能
|
||||
o = s:taboption("general", Flag, "enabled", translate("Enabled"))
|
||||
|
||||
#执行文件路径
|
||||
-- 执行文件路径
|
||||
o = s:taboption("general", Value, "client_file", translate("Client file"))
|
||||
o.default = "/usr/bin/frps"
|
||||
o.rmempty = false
|
||||
|
||||
#运行在什么用户下
|
||||
-- 运行在什么用户下
|
||||
o = s:taboption("general", ListValue, "run_user", translate("Run daemon as user"))
|
||||
o:value("", translate("root"))
|
||||
local user
|
||||
@ -37,17 +37,20 @@ for user in luci.util.execi("cat /etc/passwd | cut -d':' -f1") do
|
||||
o:value(user)
|
||||
end
|
||||
|
||||
#是否启用日志
|
||||
-- 是否启用日志
|
||||
o = s:taboption("general", Flag, "enable_logging", translate("Enable logging"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.default = o.enabled
|
||||
|
||||
#日志路径
|
||||
-- 日志路径
|
||||
o = s:taboption("general", Value, "log_to", translate("Log file"))
|
||||
o:depends("enable_logging", "1")
|
||||
o:depends("enable_logging", "true")
|
||||
o.default = "/var/log/frps.log"
|
||||
|
||||
#日志等级
|
||||
-- 日志等级
|
||||
o = s:taboption("general", ListValue, "log_level", translate("Log level"))
|
||||
o:depends("enable_logging", "1")
|
||||
o:depends("enable_logging", "true")
|
||||
o:value("trace", translate("Trace"))
|
||||
o:value("debug", translate("Debug"))
|
||||
o:value("info", translate("Info"))
|
||||
@ -55,10 +58,10 @@ o:value("warn", translate("Warning"))
|
||||
o:value("error", translate("Error"))
|
||||
o.default = "Warn"
|
||||
|
||||
#日志保留天数
|
||||
-- 日志保留天数
|
||||
o = s:taboption("general", ListValue, "log_maxdays", translate("Log max days"))
|
||||
o.description = translate("Maximum number of days to keep log files is 3 day.")
|
||||
o:depends("enable_logging", "1")
|
||||
o:depends("enable_logging", "true")
|
||||
o.datatype = "uinteger"
|
||||
o:value("1", translate("1"))
|
||||
o:value("2", translate("2"))
|
||||
@ -70,29 +73,30 @@ o:value("7", translate("7"))
|
||||
o.default = "3"
|
||||
o.optional = false
|
||||
|
||||
#禁用日志颜色
|
||||
-- 禁用日志颜色
|
||||
o = s:taboption("general", Flag, "log_disable_print_color", translate("Disable log color"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.default = o.enabled
|
||||
|
||||
#允许客户端设置的最大连接池大小
|
||||
-- 允许客户端设置的最大连接池大小
|
||||
o = s:taboption("advanced", Value, "transport_max_pool_count", translate("Max pool count"))
|
||||
o.description = translate("pool_count in each proxy will change to max_pool_count if they exceed the maximum value")
|
||||
o.datatype = "uinteger"
|
||||
|
||||
#限制单个客户端最大同时存在的代理数
|
||||
-- 限制单个客户端最大同时存在的代理数
|
||||
o = s:taboption("advanced", Value, "max_ports_per_client", translate("Max ports per-client"))
|
||||
o.description = translate("max ports can be used for each client, default value is 0 means no limit")
|
||||
o.datatype = "uinteger"
|
||||
o.defalut = '0'
|
||||
o.placeholder = '0'
|
||||
|
||||
#二级子域名
|
||||
-- 二级子域名
|
||||
o = s:taboption("advanced", Value, "sub_domain_host", translate("Subdomain host"))
|
||||
o.description = translatef("if subdomain_host is not empty, you can set subdomain when type is http or https in frpc's configure file; when subdomain is test, the host used by routing is test.frps.com")
|
||||
o.datatype = "host"
|
||||
|
||||
#WEB面板设置
|
||||
-- WEB面板设置
|
||||
o = s:taboption("dashboard", Value, "webserver_addr", translate("Dashboard addr"))
|
||||
o.description = translatef("dashboard addr's default value is same with bind_addr")
|
||||
o.default = "0.0.0.0"
|
||||
@ -109,13 +113,8 @@ o.description = translatef("dashboard user and passwd for basic auth protect, if
|
||||
o = s:taboption("dashboard", Value, "webserver_password", translate("Dashboard password"))
|
||||
o.password = true
|
||||
|
||||
#禁用日志颜色
|
||||
o = s:taboption("dashboard", Flag, "enable_prometheus", translate("asd654asd65"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
|
||||
#是否提供 Prometheus 监控接口,需要同时启用了 webServer 后才会生效。
|
||||
o = s:taboption("dashboard", Flag, "enable_prometheus", translate("sad65asd645a"))
|
||||
-- 是否提供 Prometheus 监控接口,需要同时启用了 webServer 后才会生效。
|
||||
o = s:taboption("dashboard", Flag, "enable_prometheus", translate("Enable Prometheus"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.defalut = o.disabled
|
||||
|
@ -4,31 +4,31 @@
|
||||
local m, s, o
|
||||
|
||||
m = Map("frps")
|
||||
#页面标题和描述
|
||||
-- 页面标题和描述
|
||||
m.title = translate("Frps - Server Settings")
|
||||
m.description = translate("FRPS Server Settings")
|
||||
|
||||
#读配置文件
|
||||
-- 读配置文件
|
||||
s = m:section(NamedSection, "main", "frps")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
#绑定IP
|
||||
o = s:taboption("dashboard", Value, "bind_addr", translate("Bind addr"))
|
||||
o.description = translatef("asd65as4d6as6d5")
|
||||
o.default = "0.0.0.0"
|
||||
-- 绑定IP
|
||||
o = s:option(Value, "bind_addr", translate("Bind addr"))
|
||||
o.datatype = "host"
|
||||
o.default = "0.0.0.0"
|
||||
o.rmempty = false
|
||||
|
||||
#绑定端口
|
||||
-- 绑定端口
|
||||
o = s:option(Value, "bind_port", translate("Bind port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
|
||||
#登录令牌
|
||||
-- 登录令牌
|
||||
o = s:option(Value, "auth_token", translate("Token"))
|
||||
o.password = true
|
||||
|
||||
#只允许tls登录服务器
|
||||
-- 只允许tls登录服务器
|
||||
o = s:option(Flag, "tls_force", translate("Enforce frps only accept TLS connection"))
|
||||
o.description = translatef("Requirements: frpc v0.25.0+, frps v0.32.0+")
|
||||
o.enabled = "true"
|
||||
@ -36,32 +36,32 @@ o.disabled = "false"
|
||||
o.default = o.disabled
|
||||
o.rmempty = false
|
||||
|
||||
#kcp协议绑定端口
|
||||
-- kcp协议绑定端口
|
||||
o = s:option(Value, "kcp_bind_port", translate("KCP bind port"))
|
||||
o.description = translatef("Optional: udp port used for kcp protocol, it can be same with 'bind port'; if not set, kcp is disabled in frps")
|
||||
o.datatype = "port"
|
||||
|
||||
#quic协议绑定端口
|
||||
-- quic协议绑定端口
|
||||
o = s:option(Value, "quic_bind_port", translate("Quic bind port"))
|
||||
o.description = translatef("Optional: udp port used for quic protocol, it can be same with 'bind port'; if not set, quic is disabled in frps")
|
||||
o.datatype = "port"
|
||||
|
||||
#http绑定端口
|
||||
-- http绑定端口
|
||||
o = s:option(Value, "vhost_http_port", translate("vhost http port"))
|
||||
o.description = translatef("Optional: if you want to support virtual host, you must set the http port for listening")
|
||||
o.datatype = "port"
|
||||
|
||||
#https绑定端口
|
||||
-- https绑定端口
|
||||
o = s:option(Value, "vhost_https_port", translate("vhost https port"))
|
||||
o.description = translatef("Optional: Note: http port and https port can be same with bind_port")
|
||||
o.datatype = "port"
|
||||
|
||||
#tcpmuxHTTP绑定端口
|
||||
-- tcpmuxHTTP绑定端口
|
||||
o = s:option(Value, "tcpmux_http_connect_port", translate("vhost https port"))
|
||||
o.description = translatef("Optional: Note: http port and https port can be same with bind_port")
|
||||
o.datatype = "port"
|
||||
|
||||
#额外设置
|
||||
-- 额外设置
|
||||
o = s:option(DynamicList, "extra_setting", translate("Extra Settings"))
|
||||
o.description = translatef("List of extra settings will be added to config file. Format: option=value, eg. <code>detailed_errors_to_client=false</code>.(NO SPACE!)")
|
||||
o.placeholder = "option=value"
|
||||
|
@ -4,7 +4,7 @@ config frps 'main'
|
||||
option bind_addr '0.0.0.0'
|
||||
option bind_port '7000'
|
||||
option auth_token 'as65d46as5d4'
|
||||
option tls_force '0'
|
||||
option tls_force 'false'
|
||||
option kcp_bind_port '7001'
|
||||
option quic_bind_port '7002'
|
||||
option vhost_http_port '7003'
|
||||
@ -20,7 +20,7 @@ config frps 'main'
|
||||
option webserver_password 'admin'
|
||||
option sub_domain_host ''
|
||||
|
||||
option enable_logging '1'
|
||||
option enable_logging 'true'
|
||||
option log_to '/var/log/frps.log'
|
||||
option log_level 'info'
|
||||
option log_maxdays '3'
|
||||
|
@ -158,7 +158,7 @@ frps_scetion_validate() {
|
||||
'webserver_user:string' \
|
||||
'webserver_password:string' \
|
||||
'sub_domain_host:host' \
|
||||
'enable_logging:bool:0' \
|
||||
'enable_logging:or("true", "false"):false' \
|
||||
'log_to:string:/var/log/frps.log' \
|
||||
'log_level:or("trace", "debug", "info", "warn", "error"):warn' \
|
||||
'log_maxdays:uinteger:3' \
|
||||
|
Loading…
Reference in New Issue
Block a user