Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few API config issues #1672

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Fix a few API config issues #1672

merged 3 commits into from
Oct 18, 2023

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Oct 17, 2023

What does this implement/fix?

This PR fixes three connected issues with the API endpoint /api/config:

  • Fix detection of unchanged password. This fixes a forced invalidation of all currently active API session on every config change because every saving was misinterpreted as a password change.
  • Ensure we are using the same constants everywhere for our enums (this fixes the issue reported on Discourse)
  • Tweak misc.privacylevel to also accept numbers formatted as strings. This can happen when using a dropdown select as done, e.g., on the web interface in System-> Settings -> All Settings.

Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): N/A


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

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

DL6ER added 3 commits October 17, 2023 16:54
… of all currently active API session on every config change because every saving was misinterpreted as a password change.

Signed-off-by: DL6ER <[email protected]>
…n when using a drowdown select as done, e.g., on the web interface -> System-> Settings -> All settings

Signed-off-by: DL6ER <[email protected]>
@DL6ER DL6ER requested a review from a team October 17, 2023 15:07
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/dns-blocking-mode-does-not-apply/65674/3

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

There is an additional setting/change that required FTL restart I think

The privacy level may be increased at any time without having to restart the DNS resolver. However, note that the DNS resolver needs to be restarted when lowering the privacy level. This restarting is automatically done when saving.

Using this branch, I did not see a FTL restart but only

2023-10-18 13:40:06.691 [153674/T153681] INFO: Writing config file

@DL6ER
Copy link
Member Author

DL6ER commented Oct 18, 2023

PR #1677 addresses restarting when the privacy level is changed

@DL6ER DL6ER merged commit bd8a975 into development-v6 Oct 18, 2023
@DL6ER DL6ER deleted the fix/api_settings branch October 18, 2023 16:55
@PromoFaux PromoFaux mentioned this pull request Feb 18, 2025
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.

3 participants