Skip to content

feat: add adguard_export plugin#1649

Draft
natecj wants to merge 1 commit into
netalertx:mainfrom
natecj:feat/adguard-export-plugin
Draft

feat: add adguard_export plugin#1649
natecj wants to merge 1 commit into
netalertx:mainfrom
natecj:feat/adguard-export-plugin

Conversation

@natecj
Copy link
Copy Markdown

@natecj natecj commented May 20, 2026

Summary

  • Adds a new adguard_export plugin that syncs known devices from the NetAlertX database to AdGuard Home as persistent clients, keeping names, MAC addresses, IP addresses, and device-type tags in sync
  • Supports scheduled runs, optional offline/new-device filtering, MAC-or-IP identifier preference, and safe scoped deletion (only removes clients the plugin previously created, tracked via a local state file)
  • Fixes the adguard_import config.json description placeholder and a minor indentation inconsistency

New files

  • front/plugins/adguard_export/script.py — main sync script
  • front/plugins/adguard_export/config.json — plugin metadata and settings
  • front/plugins/adguard_export/README.md — documentation
  • test/plugins/test_adguard_export.py — 31 pytest tests covering device-type tag mapping, client building, state file round-trips, SQLite queries, and the full sync logic

Test plan

  • pytest test/plugins/test_adguard_export.py -v passes (31 tests)
  • Plugin appears in NetAlertX Settings → Plugins after container restart
  • Configure with a real AdGuard Home instance, run once, verify clients are created with correct names/MACs/tags
  • Rename a device in NetAlertX, re-run, verify AdGuard client name updates
  • Enable ADGUARDEXP_DELETE, remove a device from NetAlertX, re-run, verify only that client is removed
  • Verify manually-added AdGuard clients are never deleted

🤖 Generated with Claude Code

Adds a new NetAlertX plugin that syncs known devices from the NetAlertX
database to AdGuard Home as persistent clients, keeping names, MACs, IP
addresses, and device-type tags in sync.

Also fixes the adguard_import config.json description placeholder and a
minor indentation inconsistency in that file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a9d96a89-7b4b-4096-83bd-b3fa0ae3c9f4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant