检查规则
nginx-ui plugin lint 和 nginx-ui plugin conformance 报告的每个问题都附带它违反的规则名称。本页解释每一条规则,并链接到指南中的相关内容。
- lint 规则根据插件目录或插件包中的文件检查。error 会阻止插件包安装;warning 指出安装插件的人会注意到的问题。
- conformance 规则通过运行插件来检查。每个用例的结果为通过、失败,或在不适用时跳过。
清单
manifest-json
lint errorplugin.json 缺失,或不是单个 JSON 对象。参见清单文件。
manifest-id
lint errorid 缺失、超过 64 个字符,或不是 io.github.example.mydns 这样以点分隔的小写 ID。参见命名规则。
manifest-name
lint errorname 缺失或为空。
manifest-version
lint errorversion 缺失,或不是语义化版本。
manifest-api-version
lint errorapi_version 缺失,或不是 Nginx UI 实现的协议代次。参见版本与兼容性。
manifest-parts
lint error清单没有声明 server、webapp 和 content 中的任何一个,插件什么也不会安装。
manifest-icon
lint erroricon_path 不是安全的相对路径。
manifest-i18n
lint error warningi18n 的某个键不是 zh_CN 这样的语言代码时为错误;运行检查工具的 Nginx UI 没有该语言时为警告,这时它显示英文。参见清单文件。
manifest-requires
lint errorrequires 中某一项的插件 ID 无效。参见依赖与冲突。
manifest-conflicts
lint errorconflicts 中某一项不是有效的插件 ID、是插件自己的 ID、重复出现,或同时出现在 requires 中。参见依赖与冲突。
manifest-permissions
lint error warning未知权限为错误,重复列出的权限为警告。参见权限与安全。
manifest-permission-reasons
lint errorpermission_reasons 或 i18n 中它的翻译里,某个键不是 permissions 中的一项,或者原因超过 300 个字符。参见说明权限用途。
manifest-screenshots
lint errorscreenshots 超过 8 张;某个 id 缺失、格式不对或者重复;某个路径缺失、不是安全的相对路径、不是 PNG、JPEG 或 WebP 图片,或者重复出现;某条说明超过 200 个字符;或者 i18n 的 screenshot_captions 中某个键不是截图的 id。参见截图。
capability-name
lint error某个能力名称不是 Nginx UI 认识的能力。参见清单文件。
capability-duplicate
lint error某个能力被列出了两次。
server-entry
lint errorserver 既没有 executables 也没有 command。参见服务端进程。
server-command
lint errorserver.command 的第一个元素为空。
server-lifecycle
lint errorserver.lifecycle 不是 resident 或 on_demand。
server-idle-timeout
lint errorserver.idle_timeout_seconds 为负数。
server-paths
lint error warning可执行文件路径,或包含分隔符的 command 第一个元素不是安全的相对路径时为错误;在运行检查工具的机器上,command 指定的程序在 PATH 中找不到时为警告。
server-resources
lint errorserver.resources 的某个值为负数。参见资源。
settings-key
lint error某个设置字段没有键,或两个字段使用了同一个键。参见设置。
settings-type
lint error warning字段类型未知,或 list 的默认值不是字符串数组时为错误;默认值与类型不符时为警告。
settings-options
lint errorselect 字段没有选项。
event-permission
lint warning订阅了 log.paths_changed 却没有 log.files 权限,因此该事件永远不会送达。参见宿主 API。
reserved-namespace
lint warningID 使用了保留给 Nginx UI 项目的 com.nginxui.*。参见命名规则。
network-permission
lint warning与服务商或目标通信的能力没有声明 network 权限。参见权限与安全。
unused-permission
lint warning请求了只有插件未声明的能力才会用到的权限,例如没有 mcp 能力却请求 mcp。
插件包
package-file-name
lint warning插件包文件名中的 ID 或版本与清单不一致。参见命名规则。
package-layout
lint errorplugin.json 既不在归档根目录,也不在一层目录之下,或者归档无法读取。参见打包。
package-paths
lint error某个归档条目不是安全的相对路径。
package-links
lint error归档中包含符号链接或硬链接。
package-escape
lint error某个条目会被解压到插件目录之外。
package-entries
lint error插件包的条目超过 10,000 个。参见限制。
package-size
lint error插件包中的文件解压后超过 256 MiB。
package-docs
lint error warning缺少 README.md 时为错误;缺少 LICENSE,或者 README 缺少应有的章节时为警告。参见打包。
package-executables
lint error warningserver.executables 或 server.command 声明的文件缺失或不是普通文件时为错误;缺少可执行权限时为警告。参见可执行文件。
package-platform
lint error单一平台的插件包没有在 server.executables 中恰好只声明自己的平台。参见单一平台的插件包。
签名
signature-sums
lint errorplugin.sums 不符合规定的格式。参见手动签名。
signature-files
lint warningplugin.sums 和 plugin.sums.minisig 只有一个,因此插件包被视为未签名。
signature-mismatch
lint errorplugin.sums 与文件不符:列出的文件缺失或 SHA-256 不同,或者有文件没有列出。插件包在签名后被修改过,永远无法安装。参见 Nginx UI 如何检查插件包。
signature-signer
lint warning签名无法用检查工具已知的密钥验证:项目的官方插件签名密钥,或插件包中带有有效证书的合作伙伴密钥。对于社区插件这是预期的,因为它的密钥只由插件目录或运维人员指定。参见信任等级。
partner-files
lint warningplugin.partner 和 plugin.partner.minisig 只有一个,因此插件包没有合作伙伴证书。参见合作伙伴插件。
partner-comment
lint warning合作伙伴证书无法验证:plugin.partner 不是公钥,没有官方插件签名密钥为它签名,或者可信注释的格式错误。
partner-certificate
lint warning合作伙伴证书已过期,或者 plugin.sums.minisig 不是由证书指定的密钥签名的,因此证书对插件包不起作用。
signer-files
lint warning插件包中只有 plugin.signer 和 plugin.signer.minisig 之一,因此签名密钥证书被忽略。参见签名密钥。
signer-certificate
lint warning签名密钥证书无法解析、可信注释指明的不是插件包本身的插件,或者 plugin.sums.minisig 不是由证书指定的密钥签名的,因此证书对插件包不起作用。lint 不知道主密钥,证书由谁签发由插件目录和 Nginx UI 检查。参见签名密钥。
协议与生命周期
protocol-stderr
conformance插件把日志写到标准错误。参见通信协议。
protocol-notification
conformance未知方法的通知不会得到回复,且连接仍然可用。参见消息。
protocol-concurrency
conformance20 个并发的 plugin.ping 调用全部得到回复。
protocol-errors
conformance插件没有的方法回复 -32601,格式错误的参数回复 -32602 或 -32000,而不是挂起。参见错误码。
protocol-grpc
conformance插件报告的 gRPC 端点接受连接并回复 plugin.ping。参见 gRPC 传输。
protocol-transports
conformance同一个调用通过标准输入输出和通过 gRPC 得到相同的结果或错误。两种传输方式都测试过时才运行。
lifecycle-handshake
conformance握手在时间限制内完成。参见生命周期。
lifecycle-api-version
conformance握手报告的协议代次与 Nginx UI 实现的一致。
lifecycle-capabilities
conformance握手报告的能力与清单完全一致。
lifecycle-ping
conformanceplugin.ping 得到回复。参见健康检查。
lifecycle-shutdown
conformanceplugin.shutdown 和 plugin.exit 能及时停止进程。参见停止。
网页界面
webapp-paths
lint errorwebapp.bundle_path 或 webapp.style_path 不是安全的相对路径。参见浏览器包。
webapp-pages
lint error某个页面没有 path,或其 file 不是安全的相对路径。参见静态页面。
webapp-chunks
lint error声明了 webapp.chunks 却没有 bundle_path,或者某个分块的名称或路径无效、指向浏览器包本身、与其他分块共用路径,或指向缺失的文件。参见分块。
webapp-bundle
lint conformance浏览器包文件存在,并且是 Nginx UI 可以加载的脚本。参见构建。
webapp-register
conformance浏览器包用清单 ID 注册自己。参见注册插件。
webapp-chunk-files
lint conformance分块文件为空或缺失时为错误;位于 Nginx UI 提供浏览器包的目录之外时为警告。
DNS-01
dns01-block
lint error声明了 dns01 能力却没有服务商。参见 DNS-01。
dns01-code
lint error服务商代码不匹配 ^[a-z0-9-]{2,32}$,或被声明了两次。
dns01-name
lint error服务商没有名称。
dns01-form
lint error服务商没有 form,或者表单违反了凭据表单的规则:字段没有键或标签、键重复、group 或 unit 未知、只有一种登录方式、方式名称重复、方式列出了非凭据字段、values 的键使用不当、两种方式完全相同,或者有多个推荐方式。
dns01-present
conformancedns01.present 对第一个服务商有回复。
dns01-validate
conformancedns01.validate 对空配置的回复符合预期。
dns01-options
conformancedns01.options 有回复,或回复 -32002。
dns01-check
conformancedns01.check 有回复,或回复 -32002。
HTTP 接口
http-block
lint error声明了 http 能力却没有 http 块,或者 listen 不是 unix 或 rpc。参见 HTTP 接口。
配置表单
configuration-fields
lint errorconfiguration 表单中的某个字段没有键、键重复、类型未知或没有 display_name。参见配置表单。
通知渠道
notify-block
lint error声明了 notify 能力却没有渠道。参见通知渠道。
notify-code
lint error渠道代码不匹配 ^[a-z0-9-]{2,32}$,或被声明了两次。
notify-name
lint error渠道没有名称。
notify-validate
conformancenotify.validate 对空配置回复指出必填字段的 -32003,或者在渠道没有必填字段时回复 {}。测试从不调用 notify.send,因为它会访问真实服务。
健康检查
probe-block
lint error声明了 probe 能力却没有类型。参见健康检查。
probe-code
lint error类型代码不匹配 ^[a-z0-9-]{2,32}$,或被声明了两次。
probe-kind
lint error类型没有名称,或其配置表单无效。
probe-check
conformance对不可达目标执行第一个类型的 probe.check,能够及时回复。
probe-result
conformance回复包含已知的 status 和非负的 latency_ms,或者是指出字段的 -32003。
MCP 工具
mcp-block
lint error声明了 mcp 能力却没有工具,或没有 mcp 权限。参见 MCP 工具。
mcp-tool
lint error工具名称不匹配 ^[a-z0-9][a-z0-9_-]{0,47}$、被声明了两次,或者工具没有描述。
mcp-input-schema
lint errorinput_schema 的 type 不是 object。
mcp-unknown-tool
conformance调用清单未声明的工具会得到 -32602。测试不会调用任何已声明的工具,因为它们可能改变状态。
存储
storage-block
lint error声明了 storage 能力却没有后端。参见存储。
storage-code
lint error后端代码不匹配 ^[a-z0-9-]{2,32}$,或被声明了两次。
storage-backend
lint error后端没有名称,或其配置表单无效。
storage-list
conformance使用空配置的 storage.list 能及时回复,结果为指出必填字段的 -32003 或一个列表。测试不会保存、取回或删除任何内容。
storage-validate
conformancestorage.validate 对空配置回复指出必填字段的 -32003,或回复 {}。
证书部署
deploy-block
lint error声明了 cert.deploy 能力却没有目标,或没有 cert.deploy 权限。参见证书部署。
deploy-code
lint error目标代码不匹配 ^[a-z0-9-]{2,32}$,或被声明了两次。
deploy-target
lint error目标没有名称,或其配置表单无效。
deploy-dry-run
conformance对一张临时证书的试运行推送能及时回复。测试从不进行真正的推送。
deploy-validate
conformancedeploy.validate 对空配置回复指出必填字段的 -32003,或回复 {}。
封禁列表
blocklist-block
lint error声明了 security.blocklist 能力却没有来源,或没有 network 权限。参见封禁列表。
blocklist-code
lint error来源代码不匹配 ^[a-z0-9-]{2,32}$,或被声明了两次。
blocklist-source
lint error来源没有名称、配置表单无效,或者 refresh_seconds 介于 1 到 59 之间或为负数。
blocklist-fetch
conformance使用空配置的 blocklist.fetch 能及时回复,且条目中的地址都能解析。
blocklist-errors
conformance需要配置的来源回复指出字段的 -32003,而不是空列表。
上游发现
discovery-block
lint error声明了 upstream.discovery 能力却没有提供方,或没有 network 权限。参见上游发现。
discovery-code
lint error提供方代码不匹配 ^[a-z0-9-]{2,32}$,或被声明了两次。
discovery-provider
lint error提供方没有名称,或其配置表单无效。
discovery-resolve
conformance使用空配置的 discovery.resolve 能及时回复,且目标的端口都在 1 到 65535 之间。
discovery-errors
conformance需要配置的提供方或未知的服务回复指出字段的 -32003。
访问日志推送
log-sink-permission
lint error声明了 log.sink 能力却没有 log.read 权限。参见访问日志推送。
log-sink-block
lint warning有 log_sink 块却没有 log.sink 能力,该块不起作用。
log-sink-batch
lint errorbatch_size 不在 0 到 4096 之间,或者 flush_interval_ms 介于 1 到 49 之间或为负数。
log-sink-formats
lint error格式不是 combined 或 raw,或被列出了两次。
log-sink-transport
conformance通过标准输入输出发送的 log.push 得到 -32601,并且插件提供 gRPC。
log-sink-push
conformance包含三个条目的流能及时得到 accepted 为 3 的回复。只测试标准输入输出时跳过。
模板与翻译
content-paths
lint errorcontent.templates 或 content.locales 不是安全的相对路径。参见模板与翻译。
content-without-server
lint error没有 server 的清单声明了 capabilities、cron 或 events,而它们都需要进程。
content-templates
lint error warning模板目录缺失、不是目录,或者 conf/ 和 block/ 中都没有模板时为错误;有不是模板的条目时为警告。参见模板。
content-template
lint error warning模板无法解析或无法用默认值渲染时为错误;没有 name 时为警告。
content-locales
lint error warning翻译目录缺失、没有 .po 文件,或者有文件名不是语言代码的文件时为错误;有运行检查工具的 Nginx UI 没有的语言的文件,或者有其他条目时为警告。参见翻译。
content-locale
lint error某个翻译文件无法解析。