Skip to content

feat(access-list): add optional note field to access list clients#5540

Open
TheMazeIsAmazing wants to merge 15 commits into
NginxProxyManager:developfrom
TheMazeIsAmazing:feat/notes
Open

feat(access-list): add optional note field to access list clients#5540
TheMazeIsAmazing wants to merge 15 commits into
NginxProxyManager:developfrom
TheMazeIsAmazing:feat/notes

Conversation

@TheMazeIsAmazing
Copy link
Copy Markdown

@TheMazeIsAmazing TheMazeIsAmazing commented May 14, 2026

Why

This PR introduces an optional “note” field for access list client rules to improve clarity when managing multiple IP entries. It allows users to annotate each rule (e.g. “Home” or “Office”) without affecting current behaviour.
(See feat-req: #5277)

Front-end change:
Screenshot 2026-05-14 at 14 03 49

Note added to the generated Nginx files (e.g. /data/nginx/proxy_host/X.conf):
image

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • API changes
  • Performance improvement
  • Test addition or update

AI Usage

  • AI was used to write this
  • AI was used to review this

Misc.

I'm sorry, this is a new version of #5333. Wanted to make sure it was up-to-date with current develop branch and resolve merge conflicts. Guess I did it wrong and accidentally removed my PR 🥲.

Mees Muller and others added 8 commits February 20, 2026 14:41
… widen modal

- Add optional note property to access list clients in backend model and schema
- Extend OpenAPI schemas (common + access-list endpoints) to support note
- Created necessary migration to add the note row to access_list_client table
- Persist note in access_list_client inserts/updates
- Render note in nginx config as inline comment for access rules (when present)
- Extend frontend AccessListClient model with optional note
- Add note input field to Access List modal (Rules tab)
- Only include note in payload when non-empty
- Add i18n placeholder for note field
- Increase Access List modal width for improved usability
@jc21
Copy link
Copy Markdown
Member

jc21 commented May 14, 2026

Code Review

Thanks for the PR and for keeping it up-to-date with develop. The feature is well-scoped and non-breaking — the nginx sanitization is correct and the localization coverage is thorough.

Blocking Issue

Global CSS override in frontend/src/App.css

.modal-dialog { 
    max-width: 700px !important; 
}

This widens every modal in the application, not just the Access List modal. Bootstrap's default is 500px. This needs to be scoped to only the Access List modal — e.g. via a dedicated CSS class applied through modalClassName or a wrapper class — to avoid a regression across all other dialogs.


Minor Issues

  1. Accessibility: The note <input> has no associated <label>, only a placeholder. Placeholders disappear on focus and are not a substitute for labels — a visually hidden label or aria-label would fix this.

  2. Note not visible in read view: The note only appears during edit. Users can't see annotations without opening the edit dialog or inspecting the nginx config file. Worth considering showing the note inline in the client list within the modal.

  3. Migration down is a no-op: The rollback function just logs a warning rather than dropping the column. This is an acceptable choice (dropping a column would destroy data), but it's worth a comment in the code marking it as intentional.

  4. Unrelated locale additions: Several locales (de, it, ja, pl, vi, zh) also add access-list.rule-source.placeholder (the IP address placeholder), which was previously missing from those files. Worth a quick sanity-check that those IP placeholder strings are correct since they weren't the original focus of the PR.


What's Good

  • client.note || null correctly coerces empty string to null before persisting
  • The nginx comment sanitization ([\r\n#;] → space) is correct — stripping newlines is the key safety measure
  • Frontend only includes note if non-empty after trimming (in AccessListModal.tsx)
  • Schema maxLength: 200 matches the DB column size

Fix the global CSS scope and this is good to go.

Comment thread frontend/src/modals/AccessListModal.tsx Outdated
@TheMazeIsAmazing
Copy link
Copy Markdown
Author

TheMazeIsAmazing commented May 28, 2026

Hey @jc21,

I implemented the feedback (6fadcd0), so with any luck it also could be included in v2.15 🤞?

Thanks for your time and effort 😁

@nginxproxymanagerci
Copy link
Copy Markdown

Docker Image for build 10 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-5540

Note

Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
This is a different docker image namespace than the official image.

Warning

Changes and additions to DNS Providers require verification by at least 2 members of the community!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants