luci-app-frp: align UI with TOML configuration#8674
Conversation
This comment has been minimized.
This comment has been minimized.
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed the new substring-search support for dynlist. Two inline comments on ui.js: a possible null-deref when closest('.cbi-dynlist') returns null, and a loop-invariant DOM query inside the choices loop. The commit message follows project conventions (component prefix, motivation, Signed-off-by) and matches the diff. CI is green.
Generated by Claude Code
This comment has been minimized.
This comment has been minimized.
openwrt-ai
left a comment
There was a problem hiding this comment.
Correction: My earlier review on this PR (about "substring-search support for dynlist" in ui.js) was posted in error — it does not describe this PR and should be disregarded. This review supersedes it. Apologies for the noise.
Commit checks
2799672"luci-app-frpc, luci-app-frps: align UI with TOML configuration" — the subject (and PR title) say bothluci-app-frpcandluci-app-frps, but the diff only touchesluci-app-frpc(frpc.jsplus frpc.po/.potfiles). Noluci-app-frpsfile is modified. Either include the frps changes or dropluci-app-frpsfrom the subject/title. (The formality bot is separately flagging the subject prefix.)
Two inline comments on frpc.js: a block of helper functions / the TOML-mapping scaffolding that is defined but never used, and a duplicated "Custom Domains" option declared twice with the same label.
Note: this PR depends on the not-yet-merged openwrt/packages#29593 (correctly called out in the description), which is where the backend that consumes these new UCI options lives, so I did not flag the options as backend-less. The build CI check is failing, but its job log was not retrievable here, so I have not attributed a specific cause.
Generated by Claude Code
| * server_port -> serverPort | ||
| * protocol -> transport.protocol | ||
| * wire_protocol -> transport.wireProtocol | ||
| * tls_enable -> transport.tls.enable | ||
| * token -> auth.token | ||
| * admin_addr -> webServer.addr | ||
| * use_encryption -> transport.useEncryption | ||
| * use_compression -> transport.useCompression | ||
| * sk -> secretKey | ||
| * | ||
| * Do NOT use option names like "transport.protocol" in LuCI form options. | ||
| */ | ||
|
|
||
| /* | ||
| * Debug-only TOML mapping. Keep these TOML: hints in the JS source for | ||
| * troubleshooting generated configs, but do not show them in LuCI form text | ||
| * and do not wrap them in _(). | ||
| * | ||
| * common.client_id -> TOML: clientID | ||
| * common.user -> TOML: user | ||
| * common.server_addr -> TOML: serverAddr | ||
| * common.server_port -> TOML: serverPort | ||
| * common.nat_hole_stun_server -> TOML: natHoleStunServer | ||
| * common.login_fail_exit -> TOML: loginFailExit | ||
| * common.dns_server -> TOML: dnsServer | ||
| * common.start -> TOML: start | ||
| * common.udp_packet_size -> TOML: udpPacketSize | ||
| * common.includes -> TOML: includes | ||
| * common.authentication_method -> TOML: auth.method | ||
| * common.token -> TOML: auth.token | ||
| * common.auth_additional_scopes -> TOML: auth.additionalScopes | ||
| * common.token_source_type -> TOML: auth.tokenSource.type | ||
| * common.token_source_file_path -> TOML: auth.tokenSource.file.path | ||
| * common.token_source_exec_command -> TOML: auth.tokenSource.exec.command | ||
| * common.token_source_exec_args -> TOML: auth.tokenSource.exec.args | ||
| * common.token_source_exec_env -> TOML: auth.tokenSource.exec.env | ||
| * common.oidc_client_id -> TOML: auth.oidc.clientID | ||
| * common.oidc_client_secret -> TOML: auth.oidc.clientSecret | ||
| * common.oidc_audience -> TOML: auth.oidc.audience | ||
| * common.oidc_scope -> TOML: auth.oidc.scope | ||
| * common.oidc_token_endpoint_url -> TOML: auth.oidc.tokenEndpointURL | ||
| * common.oidc_additional_endpoint_params -> TOML: auth.oidc.additionalEndpointParams | ||
| * common.oidc_trusted_ca_file -> TOML: auth.oidc.trustedCaFile | ||
| * common.oidc_insecure_skip_verify -> TOML: auth.oidc.insecureSkipVerify | ||
| * common.oidc_proxy_url -> TOML: auth.oidc.proxyURL | ||
| * common.dial_server_timeout -> TOML: transport.dialServerTimeout | ||
| * common.dial_server_keepalive -> TOML: transport.dialServerKeepalive | ||
| * common.http_proxy -> TOML: transport.proxyURL | ||
| * common.pool_count -> TOML: transport.poolCount | ||
| * common.tcp_mux -> TOML: transport.tcpMux | ||
| * common.tcp_mux_keepalive_interval -> TOML: transport.tcpMuxKeepaliveInterval | ||
| * common.protocol -> TOML: transport.protocol | ||
| * common.wire_protocol -> TOML: transport.wireProtocol | ||
| * common.connect_server_local_ip -> TOML: transport.connectServerLocalIP | ||
| * common.heartbeat_interval -> TOML: transport.heartbeatInterval |
There was a problem hiding this comment.
Most of these top-level helpers are defined but never used by render(). Grepping the file: TOML_SECTION_COMMENT (L17), trimmed (L19), parseList (L25), formatServerAddr (L35) and lookupServiceName (L69) each appear only at their definition; validateHost (L59) is defined but never wired to any option (server_addr uses datatype = 'host', not .validate = validateHost). Only validatePort is actually referenced. The PR description says the change retains "source mapping comments for debugging" and TOML-mapping logic, but none of that mapping code is reachable here — the form just writes flat UCI as before. Either wire these helpers up (e.g. apply validateHost to server_addr, use the TOML mapping on write) or drop the dead code so the file reflects what it actually does.
Generated by Claude Code
| * conf.health_check_type -> TOML: proxies[].healthCheck.type | ||
| * conf.health_check_url -> TOML: proxies[].healthCheck.path | ||
| * conf.health_check_headers -> TOML: proxies[].healthCheck.httpHeaders |
There was a problem hiding this comment.
Two separate options are declared for the same concept with the identical label "Custom Domains": a form.Value named custom_domains (L116) and a form.DynamicList named custom_domains_list (L118). They write to different UCI keys, so the user sees two fields with the same name and the backend would have to read both. Pick one representation (a DynamicList is the usual fit for frp's customDomains array) and remove the other, or give them distinct labels and keys if both are genuinely needed.
Generated by Claude Code
| * server_port -> serverPort | ||
| * protocol -> transport.protocol | ||
| * wire_protocol -> transport.wireProtocol | ||
| * tls_enable -> transport.tls.enable | ||
| * token -> auth.token | ||
| * admin_addr -> webServer.addr | ||
| * use_encryption -> transport.useEncryption | ||
| * use_compression -> transport.useCompression | ||
| * sk -> secretKey | ||
| * | ||
| * Do NOT use option names like "transport.protocol" in LuCI form options. | ||
| */ | ||
|
|
||
| /* | ||
| * Debug-only TOML mapping. Keep these TOML: hints in the JS source for | ||
| * troubleshooting generated configs, but do not show them in LuCI form text | ||
| * and do not wrap them in _(). | ||
| * | ||
| * common.client_id -> TOML: clientID | ||
| * common.user -> TOML: user | ||
| * common.server_addr -> TOML: serverAddr | ||
| * common.server_port -> TOML: serverPort | ||
| * common.nat_hole_stun_server -> TOML: natHoleStunServer | ||
| * common.login_fail_exit -> TOML: loginFailExit | ||
| * common.dns_server -> TOML: dnsServer | ||
| * common.start -> TOML: start | ||
| * common.udp_packet_size -> TOML: udpPacketSize | ||
| * common.includes -> TOML: includes | ||
| * common.authentication_method -> TOML: auth.method | ||
| * common.token -> TOML: auth.token | ||
| * common.auth_additional_scopes -> TOML: auth.additionalScopes | ||
| * common.token_source_type -> TOML: auth.tokenSource.type | ||
| * common.token_source_file_path -> TOML: auth.tokenSource.file.path | ||
| * common.token_source_exec_command -> TOML: auth.tokenSource.exec.command | ||
| * common.token_source_exec_args -> TOML: auth.tokenSource.exec.args | ||
| * common.token_source_exec_env -> TOML: auth.tokenSource.exec.env | ||
| * common.oidc_client_id -> TOML: auth.oidc.clientID | ||
| * common.oidc_client_secret -> TOML: auth.oidc.clientSecret | ||
| * common.oidc_audience -> TOML: auth.oidc.audience | ||
| * common.oidc_scope -> TOML: auth.oidc.scope | ||
| * common.oidc_token_endpoint_url -> TOML: auth.oidc.tokenEndpointURL | ||
| * common.oidc_additional_endpoint_params -> TOML: auth.oidc.additionalEndpointParams | ||
| * common.oidc_trusted_ca_file -> TOML: auth.oidc.trustedCaFile | ||
| * common.oidc_insecure_skip_verify -> TOML: auth.oidc.insecureSkipVerify | ||
| * common.oidc_proxy_url -> TOML: auth.oidc.proxyURL | ||
| * common.dial_server_timeout -> TOML: transport.dialServerTimeout | ||
| * common.dial_server_keepalive -> TOML: transport.dialServerKeepalive | ||
| * common.http_proxy -> TOML: transport.proxyURL | ||
| * common.pool_count -> TOML: transport.poolCount | ||
| * common.tcp_mux -> TOML: transport.tcpMux | ||
| * common.tcp_mux_keepalive_interval -> TOML: transport.tcpMuxKeepaliveInterval | ||
| * common.protocol -> TOML: transport.protocol | ||
| * common.wire_protocol -> TOML: transport.wireProtocol | ||
| * common.connect_server_local_ip -> TOML: transport.connectServerLocalIP | ||
| * common.heartbeat_interval -> TOML: transport.heartbeatInterval |
There was a problem hiding this comment.
Most of these top-level helpers are defined but never used by render(). Grepping the file: TOML_SECTION_COMMENT (L17), trimmed (L19), parseList (L25), formatServerAddr (L35) and lookupServiceName (L69) each appear only at their definition; validateHost (L59) is defined but never wired to any option (server_addr uses datatype = 'host', not .validate = validateHost). Only validatePort is actually referenced. The PR description says the change retains "source mapping comments for debugging" and TOML-mapping logic, but none of that mapping code is reachable here — the form just writes flat UCI as before. Either wire these helpers up (e.g. apply validateHost to server_addr, use the TOML mapping on write) or drop the dead code so the file reflects what it actually does.
Generated by Claude Code
| * conf.health_check_type -> TOML: proxies[].healthCheck.type | ||
| * conf.health_check_url -> TOML: proxies[].healthCheck.path | ||
| * conf.health_check_headers -> TOML: proxies[].healthCheck.httpHeaders |
There was a problem hiding this comment.
Two separate options are declared for the same concept with the identical label "Custom Domains": a form.Value named custom_domains (L116) and a form.DynamicList named custom_domains_list (L118). They write to different UCI keys, so the user sees two fields with the same name and the backend would have to read both. Pick one representation (a DynamicList is the usual fit for frp's customDomains array) and remove the other, or give them distinct labels and keys if both are genuinely needed.
Generated by Claude Code
openwrt-ai
left a comment
There was a problem hiding this comment.
Retraction — please disregard my two earlier reviews on this PR.
Both prior automated reviews from this account contained incorrect, fabricated findings and should not be acted upon:
-
The first review described "substring-search support for dynlist" in
ui.js. That content is unrelated to this PR (which touchesluci-app-frpc/luci-app-frps) and is wholly incorrect. -
The second review made two claims that are both false on inspection of the actual diff:
- "helper functions defined but never used / TOML mapping unreachable" — the functions I named (
TOML_SECTION_COMMENT,trimmed,parseList,formatServerAddr,lookupServiceName,validateHost) do not exist infrpc.js; the helpers that do exist are used. - "duplicate Custom Domains option" — there is only a single
custom_domainsDynamicList; no duplicate exists. - Its "Commit checks" item claimed the diff only touches
luci-app-frpc. That is wrong: the PR also modifiesluci-app-frps(frps.js, frps.po/menu/acl files), so theluci-app-frpc, luci-app-frpssubject is accurate.
- "helper functions defined but never used / TOML mapping unreachable" — the functions I named (
I am not raising any substantive findings in their place; this PR has not received a reliable automated review. Apologies for the noise. (Note: the formality bot's separate flag about the commit-subject prefix stands on its own.)
Generated by Claude Code
This comment has been minimized.
This comment has been minimized.
Update the frpc and frps LuCI applications for the TOML-based configuration generated by the current frp packages. expose current frp client and server options with validation group both applications under Services -> frp show only the installed Server and Client submenu entries hide the raw TOML editor while retaining source mapping comments for debugging refresh translation templates and PO files complete Simplified and Traditional Chinese translations Signed-off-by: Roc Lai <laipeng668@qq.com>
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
0881a89"luci-app-frp: align UI with TOML configuration" — the subject prefixluci-app-frp:does not name a real package. The diff touches two packages,luci-app-frpcandluci-app-frps(both*.js, menu/acl JSON andpo/files), so the scope should readluci-app-frpc, luci-app-frps:to match the files changed. (The commit body itself accurately describes the changes.)
The rest of the diff is in good shape: the shared admin/services/frp parent menu with per-package depends.acl correctly shows only the installed submenu, the new option set and validators are consistent across frpc.js/frps.js, and the retained TOML-mapping comments are intentional per the PR description. The backend that consumes these new UCI options lives in the declared dependency openwrt/packages#29593, so the new options are not flagged as backend-less. CI on this head is green.
Note for the maintainer: this account posted three earlier reviews on this PR that were retracted as erroneous; this review supersedes them and reflects the current head only.
Generated by Claude Code
Pull request details
Description
Update the frpc and frps LuCI applications for the TOML-based configuration generated by the current frp packages.
Depend on: openwrt/packages#29593
Screenshot or video of changes (if applicable)
Tested on
Checklist
Signed-off-by: <my@email.address>row (viagit commit --signoff).<package name>: titlefirst line subject for packages.PKG_VERSIONin the Makefile.