Skip to content

luci-app-csshnpd: warn if manager atSign same as device atSign - #9005

Open
cpswan wants to merge 1 commit into
openwrt:masterfrom
atsign-foundation:cpswan-unique-atsigns
Open

cpswan wants to merge 1 commit into
openwrt:masterfrom
atsign-foundation:cpswan-unique-atsigns

Conversation

@cpswan

@cpswan cpswan commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Pull request details

Description

Adding check to ensure that device and manager atSigns are different

Screenshot of changes

image

Maintainer

@cpswan


Tested on

OpenWrt version: OpenWrt 25.12.5 (r33051-f5dae5ece4)
LuCI version: LuCI openwrt-25.12 branch (26.239.42882~e60322b)
Web browser(s): Chrome 152.0.7977.82, Edge 152.0.4191.62


Checklist

  • (Nice to have) Includes what Issue it closes (e.g. openwrt/luci#issue-number).
  • (Nice to have) Includes what it depends on (e.g. openwrt/packages#pr-number in sister repo).

Adding check to ensure that device and manager atSigns are different

Signed-off-by: Chris Swan <chris@atsign.com>

@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.

Commit checks

  • b74fbff "luci-app-csshnpd: warn if manager atSign same as device atSign" — the message covers only the equality check, but the diff also adds comma-separated multi-manager parsing (writeManager), rejects commas in the device atSign, and adds input trimming in firstAt. Mention those in the body, or split them out.

Generated by Claude Code

Comment on lines +105 to +109
let list = value.split(',')
.map(s => s.trim())
.filter(s => s.length > 0)
.map(s => s.startsWith('@') ? s : '@' + s);
value = list.join(',');

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.

Accepting a comma-separated manager list is new behaviour, and the backend passes the option through unquoted as -m ${manager} in csshnpd.init:67 while the shipped default documents a single atSign (csshnpd.config:3). Does sshnpd -m really take a list? If so, the field description at config.js:131`` should stop saying "The manager atSign e.g. @manager".


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the field always accepted comma separated managers lists, it just did nothing specific to validate them. It's not a thing that we particularly encourage, hence keeping the singular 'manager' rather than plural 'managers'

function normalizeAtsign(s) {
if (!s)
return '';
s = s.trim().toLowerCase();

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.

nit: the comparison lowercases, but neither firstAt nor writeManager lowercases what is written, so @Device vs @device is rejected as a duplicate while mixed case still reaches UCI (and the init script derives a case-sensitive key path from it). Lowercase in the two write handlers as well if atSigns are meant to be case-insensitive.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

doesn't really matter what's in UCI as everything is flattened in the daemon (and users may wish to place capitals in atSigns for their own purposes)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants