Skip to content

Mask write-only settings using the write_only API flag - #3877

Open
DL6ER wants to merge 3 commits into
developmentfrom
new/config_write_only_flag
Open

DL6ER wants to merge 3 commits into
developmentfrom
new/config_write_only_flag

Conversation

@DL6ER

@DL6ER DL6ER commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Thank you for your contribution to the Pi-hole Community!

Please read the comments below to help us consider your Pull Request.

We are all volunteers and completing the process outlined will help us review your commits quicker.

Please make sure you

  1. Base your code and PRs against the repositories developmental branch.
  2. Sign Off all commits as we enforce the DCO for all contributions
  3. Sign all your commits as they must have verified signatures
  4. File a pull request for any change that requires changes to our documentation at our documentation repo

What does this PR aim to accomplish?:

The masked input on the All settings page was so far inferred from the password (write-only string) type label, which only covers webserver.api.password. webserver.api.totp_secret is write-only by flag and typed as a plain string, so it rendered as a normal text field showing ********.

How does this PR accomplish the above?:

The page now uses the write_only flag that pi-hole/FTL#3154 (merged) adds to /api/config?detailed=true. Both settings are masked and carry an icon stating the value cannot be read back. Without the flag, nothing is masked, so this needs an FTL that includes #3154.

Link documentation PRs if any are needed to support this PR:

None


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

`/api/config?detailed=true` now reports a `write_only` flag, so the
masked input no longer has to be inferred from the `password
(write-only string)` type label. That label only ever covered
`webserver.api.password`, while `webserver.api.totp_secret` is
write-only by flag and typed as a plain string, so it rendered as a
normal text field showing `********`. Both are masked now and carry an
icon stating that the value cannot be read back.

Folding the dedicated password branch into the string case also routes
its value and key through `utils.escapeHtml()`, which that branch
skipped.

Requires pi-hole/FTL#3154.

Signed-off-by: DL6ER <dl6er@dl6er.de>
Copilot AI lite review requested due to automatic review settings September 28, 2026 18:44
@DL6ER
DL6ER requested a review from a team as a code owner September 28, 2026 18:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Two critical issues must be addressed before approval.

Review effort: Lite
Findings: 2 High severity

Open (2)
What changed in this PR

This PR updates the All settings page to mask API-marked write-only values.

Changes:

  • Adds a write-only indicator icon.
  • Renders flagged string settings as password inputs.
  • Preserves value and key escaping.
File Summary
scripts/​js/​settings-advanced.js Adds write-only indicators and masked inputs; critical issues remain around placeholder submission and legacy password-type fallback.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/js/settings-advanced.js Resolved
Comment thread scripts/js/settings-advanced.js Resolved
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Signed-off-by: DL6ER <dl6er@dl6er.de>
@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Signed-off-by: DL6ER <dl6er@dl6er.de>
@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved.

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.

3 participants