Skip to content

luci-app-51ddns: add remote access agent interface - #8958

Open
21hkcloud wants to merge 1 commit into
openwrt:masterfrom
21hkcloud:codex/luci-app-51ddns
Open

luci-app-51ddns: add remote access agent interface#8958
21hkcloud wants to merge 1 commit into
openwrt:masterfrom
21hkcloud:codex/luci-app-51ddns

Conversation

@21hkcloud

Copy link
Copy Markdown

Description

Add a LuCI interface for the open-source 51DDNS OpenWrt agent.

The page is available under Services > 51DDNS Remote Access and provides:

  • account-token configuration with password masking;
  • service status and installed agent version;
  • current plan name, expiry and remaining time;
  • a direct link to the 51DDNS console.

The application depends on 51ddns-agent, which is submitted separately in openwrt/packages#30158. The LuCI application is intentionally not bundled in the agent source archive.

Documentation and trust model

English installation, operation, privacy, troubleshooting and removal documentation:
https://www.51ddns.com/openwrt

Agent source and client privacy notice:
https://github.com/21hkcloud/51ddns-openwrt

The UI explicitly identifies 51DDNS as a vendor-hosted remote-access service. The agent uses the feed-provided frpc package and runs as a dedicated unprivileged user in a procd/ujail sandbox.

Testing

  • The page and RPC helper use translatable English strings.
  • ACL access is limited to the 51DDNS UCI configuration, service status and the dedicated read-only RPC helper.
  • The app has been tested with the source-built agent on OpenWrt 24.10 and 25.12 snapshots.

@openwrt openwrt Bot added add package Introduces a new package Makefile build script not following guidelines Pull request does not follow formatting guidelines labels Aug 20, 2026
@21hkcloud
21hkcloud force-pushed the codex/luci-app-51ddns branch 2 times, most recently from 1b84021 to 746fff9 Compare August 20, 2026 14:10
@openwrt openwrt Bot removed the not following guidelines Pull request does not follow formatting guidelines label Aug 20, 2026

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; see inline comments. The commit message matches its changes, and the backend dependency on 51ddns-agent (openwrt/packages#30158) is already called out in the PR description, so I did not flag it as a missing consumer.


Generated by Claude Code

Comment thread applications/luci-app-51ddns/root/usr/libexec/rpcd/luci.51ddns
Comment thread applications/luci-app-51ddns/root/usr/libexec/rpcd/luci.51ddns
Comment thread applications/luci-app-51ddns/htdocs/luci-static/resources/view/51ddns/overview.js Outdated
Comment thread applications/luci-app-51ddns/po/templates/51ddns.pot Outdated
@openwrt openwrt Bot added the not following guidelines Pull request does not follow formatting guidelines label Aug 21, 2026
@21hkcloud
21hkcloud force-pushed the codex/luci-app-51ddns branch 2 times, most recently from 0050dd1 to c46c3c1 Compare August 21, 2026 00:44
@openwrt openwrt Bot removed the not following guidelines Pull request does not follow formatting guidelines label Aug 21, 2026
@21hkcloud

Copy link
Copy Markdown
Author

Addressed all five review findings in c46c3c1: jshn-based RPC serialization, validated and whitelisted status output, plural-aware expiry labels, the NamedSection cleanup with backend config confirmation, and a scanner-generated POT. Local ESLint, shell syntax, ShellCheck, git diff checks, and RPC whitelist/fallback tests pass. All three OpenWrt Formality checks are green on the current head.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit (c46c3c1); see inline comments.

The jshn conversion, the N_() plural labels and the removal of the ineffective section.anonymous all look right — N_(n, singular, plural) matches cbi.js:167 and the scanner keyword spec N_:2,3 in build/i18n-scan.pl:16. I re-checked the regenerated 51ddns.pot by hand: msgids are now in strict byte order, the wrapping and msgid_plural/msgstr[0..1] shape match other in-tree templates, and every #: line reference resolves to the right line of overview.js at this head. The commit message matches its changes.

One functional regression remains in the new whitelist, plus two smaller points inline.


Generated by Claude Code

Comment thread applications/luci-app-51ddns/root/usr/libexec/rpcd/luci.51ddns Outdated
Comment thread applications/luci-app-51ddns/root/usr/libexec/rpcd/luci.51ddns Outdated
Comment thread applications/luci-app-51ddns/root/usr/libexec/rpcd/luci.51ddns
@21hkcloud
21hkcloud force-pushed the codex/luci-app-51ddns branch from c46c3c1 to 500603d Compare August 21, 2026 07:48

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the squash into 500603d (diff since c46c3c1 is the plan tracking in the rpcd helper).

The status_has_plan flag does fix the "plan present but not yet synced" regression, and squashing the introduce-then-fix pair addressed the history nit — the single commit's message now matches its contents, so no commit checks.

One remaining problem in the same hunk: json_select's failure diagnostic goes to stdout, so 2>/dev/null doesn't keep it out of the ubus reply. Details inline, plus one nit about the unused online field.


Generated by Claude Code

Comment thread applications/luci-app-51ddns/root/usr/libexec/rpcd/luci.51ddns Outdated
Comment thread applications/luci-app-51ddns/root/usr/libexec/rpcd/luci.51ddns Outdated
Add an English LuCI page for configuring the 51DDNS account token.

Report the agent service state, version, plan and expiry while serializing
RPC responses with jshn and exposing only validated status fields.

Signed-off-by: Jinshuan Wang <21hkcloud@gmail.com>
@21hkcloud
21hkcloud force-pushed the codex/luci-app-51ddns branch from 500603d to e780f2c Compare August 22, 2026 01:19
@21hkcloud

21hkcloud commented Aug 22, 2026

Copy link
Copy Markdown
Author

Addressed the latest review in e780f2c:

  • suppress both stdout and stderr from failed json_select plan calls, preserving valid ubus JSON output
  • remove the unused online RPC field and normalization
  • keep the PR as a single signed-off commit

Validation: ShellCheck, Bash syntax check, and git diff --check all pass.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit (e780f2c); no new issues found.

The diff since 500603d is confined to the rpcd helper and resolves both of the previous round's findings:

  • json_select plan >/dev/null 2>&1 now suppresses stdout as well, so the WARNING: Variable 'plan' does not exist... line can no longer be prepended to the json_dump output on the two normal paths (no plan key, or a failed json_load). json_get_var is silent on a missing key, so no other call in print_status can leak into the reply.
  • online and its normalisation block are gone; git grep online over applications/luci-app-51ddns/ at this head returns nothing, so no leftover reader, ACL entry or .pot msgid dangles. With no plan the helper now emits a bare {}, which data[2] || {} / local.plan || null`` already handles as "No active plan".

Squash preserved — still a single luci-app-51ddns: add remote access agent interface commit, and its message body ("serializing RPC responses with jshn and exposing only validated status fields") matches the file contents, so no commit checks. The helper keeps mode 100755. All three FormalityCheck runs are green on this head.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add package Introduces a new package Makefile build script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants