fix(adblock): resolve race condition on rapid DNS domain changes#1663
Closed
gsanchietti wants to merge 35 commits into
Closed
fix(adblock): resolve race condition on rapid DNS domain changes#1663gsanchietti wants to merge 35 commits into
gsanchietti wants to merge 35 commits into
Conversation
For the sake of god, avoid to loose the history at every reboot
Sync the local adblock fork to upstream 4.5.5-3 while keeping the NethSecurity-specific ts-dns hooks, bypass migration, and nft bypass rules intact. Assisted-by: Copilot:gpt-5.4
Normalize dns bypass values from UCI and restart adblock after dns settings, blocklist, and bypass API changes so nft rules follow the requested state immediately. Assisted-by: Copilot:gpt-5.4
Changes: - add a new `nft-reload` action inside adbblock.sh - trigger reload when the configuration has been updated - call nft-reload on reload The above changes will recreated the nft chain when the bypass configuration has been changed.
Store Threat Shield DNS local allow and block list edits in UCI so rapid API calls no longer rewrite adblock files or restart the service immediately. Write the physical adblock list files during the next reload, add a one-shot migration for existing list files, and document the staged workflow for the affected API methods. Refs NethServer#1572 Assisted-by: Copilot:gpt-5.4
Member
Author
|
Closing this draft so the same |
This was referenced May 15, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Store whitelist/blacklist in UCI instead of direct file writes. When multiple rapid API calls add/edit/delete domains, changes are staged to UCI (no restart). The init.d script reads UCI during start/reload and writes physical files.
procd's reload trigger (5s debounce) coalesces rapid UCI commits into a single reload_service call. Using reload (not restart) prevents file clearing that caused 'running with 0 blocked domains' broken state.
Related issue
#1572
How to test
ssh root@192.168.100.215api-cli ns.threatshield dns-add-allowed --data '{"address":"test1.com","description":""}' &api-cli ns.threatshield dns-list-alloweduci commit && reload_configfrom shell)Files changed