通用配置

通用配置结构。

LogConfig

FieldTypeDescriptionRequired
tostring日志输出文件路径,如果为 console,则会将日志打印在标准输出中。No
levelstring日志级别,可选值为 trace, debug, info, warn, error,默认级别为 info。No
maxDaysint日志文件最多保留天数,默认为 3 天。No
disablePrintColorbool禁用标准输出中的日志颜色。No

WebServerConfig

FieldTypeDescriptionRequired
addrstringwebServer 监听地址,默认为 127.0.0.1。No
portintwebServer 监听端口。Yes
userstringHTTP BasicAuth 用户名。No
passwordstringHTTP BasicAuth 密码。No
assetsDirstring静态资源目录,Dashboard 使用的资源默认打包在二进制文件中,通过指定此参数使用自定义的静态资源。No
pprofEnablebool启动 Go HTTP pprof,用于应用调试。No
tlsTLSConfigDashboard 启用 HTTPS 的 TLS 相关配置。No

TLSConfig

FieldTypeDescriptionRequired
certFilestringTLS 证书文件路径。Yes
keyFilestringTLS 密钥文件路径。Yes
trustedCaFilestringCA 证书文件路径。No
serverNamestringTLS Server 名称。No

QUICOptions

FieldTypeDescriptionRequired
keepalivePeriodint默认值为 10 秒。No
maxIdleTimeoutint默认值为 30 秒。No
maxIncomingStreamsint默认值为 100000。No

PortsRange

FieldTypeDescriptionRequired
startint起始端口。No
endint终止端口。No
singleint单一端口。No

HeaderOperations

FieldTypeDescriptionRequired
setmap[string]string在 Header 中设置指定的 KV 值。No

HTTPHeader

FieldTypeDescriptionRequired
namestringHeader 名称。Yes
valuestringHeader 值。Yes

ValueSource

FieldTypeDescriptionRequired
typestring数据源类型,可选值为 “file” 和 “exec”。Yes
fileFileSource文件数据源配置,当 type 为 “file” 时必填。No
execExecSource外部命令数据源配置,当 type 为 “exec” 时必填。需要启动时添加 --allow-unsafe=TokenSourceExec 参数。No

FileSource

FieldTypeDescriptionRequired
pathstring文件路径。Yes

ExecSource

FieldTypeDescriptionRequired
commandstring要执行的命令路径。Yes
args[]string命令参数列表。No
env[]ExecEnvVar额外的环境变量。No

ExecEnvVar

FieldTypeDescriptionRequired
namestring环境变量名称。Yes
valuestring环境变量值。Yes

NatTraversalConfig

FieldTypeDescriptionRequired
disableAssistedAddrsbool禁用本地网络接口地址的辅助连接。当启用时,仅使用通过 STUN 发现的公网地址进行 NAT 打洞,避免使用可能较慢的本地网络接口(如 VPN)。默认为 false。No
最后修改 January 4, 2026: add docs for v0.66 (#106) (191a9bc)