[Feature] Blocklist subscriptions plugin with auto scheduled downloads and management UI#1561
[Feature] Blocklist subscriptions plugin with auto scheduled downloads and management UI#1561nvandamme wants to merge 16 commits intoevilsocket:masterfrom
Conversation
e7ad06d to
fca8c07
Compare
|
hi @nvandamme ! This looks impressive! I think the protobuffer files are not needed, correct me if I'm wrong please. Otherwise, delete them. And on the other hand, the dialog was refactored not long ago, it's not called it fails with latest master branch. |
|
Thanks for the quick review. I've been live testing the plugin against an older branch (opensnitch package from AUR), I'll test against the latest branch for sure! I'll also remove the proto files : I've just rebuild them to have a pyi annotation file on my side to check types with ruff. I've forgot to delete them in my commits. Anyway, are the new code paths for |
|
@gustavo-iniguez-goya seems that Also regarding protobuf generated files, is it possible to add |
7f77fff to
3811a37
Compare
3811a37 to
89708b6
Compare
|
Perfect @nvandamme ! now it works. Some notes before merging it:
Minor things:
Future idea:
|
Done, set defaults to forever and enable
Done, migrated the url test op to an underlying QThread with a message listener, thus not blocking the main ui thread.
Agreed and done.
Done, keeping short messages in the error status field and stetted up a tooltip that can show the whole error. |
It entails to maintain a well curated list of available (and vetted) blocklists, some other projects are already doing that (AdGuard Home, PiHole, Portmaster...). On thing for future updates that seems interesting, mostly for the capability of handling other lists formats: the Adblock format seems interesting because it can leverage wildcard domain without using regexps. |
…ault rule creation options + hide node to foce local node
a176131 to
e15221d
Compare
|
For distant nodes handling and for hardening the plugin runtime (timers schedules, download, lists managing/deployment on distant nodes...), one future update might involve rewriting the runtime inside opensnitch daemon (tough i'm not fluent in go) and mapping the plugin UI with the daemon API/IPC (grpc via new protobuf handlers/defs ?). |
|
I've rewritten most of the plugin by adopting a kind of MVC pattern involving underneath QT signals and QT threads to avoid blocking ui/runtime calls. Some big UI additions:
One big note tough, using directly the underlying opensnitch DB (e.g for rule enumeration or hooking to RulesEditorDialog) is very dangerous because reads are not guarded by any RWLock/mutex and the other core opensnicth calls are fighting to access it (some of my drafts/tests had completely locked the ui and the daemon gRPC side too), hence a careful usage of some differed calls via QtCore.QTimer.singleShot(0,...). |
02851de to
96b71b0
Compare
7c58d2a to
3cb7d12
Compare
…st existing attached list subs
3cb7d12 to
8a3be74
Compare







This PR proposes a new
list_subscriptionsplugin for OpenSnitch.The idea is inspired by the existing
downloaderplugin, but aimed at a more specific use case: managing subscription-based domain lists and integrating them with OpenSnitch rules. The goal is to provide a more complete workflow than a generic periodic downloader, while still fitting into OpenSnitch’s action/plugin model.Scope
This proposal adds a new plugin with:
Warning
This plugin is intended to operate on the local node only.
In short, it is meant to cover the full lifecycle of list subscriptions: configure, download, refresh, expose state, and integrate with rules.
Differences from downloader
The
downloaderplugin is the starting point of this proposal. It builds on the same general idea while adding a more opinionated workflow around blocklist-style subscriptions:Current limitations
This proposal intentionally stays conservative in a few areas:
These constraints are deliberate for now, to keep the plugin predictable and avoid unintended remote or system-wide side effects.
File storage and linking strategy
The plugin uses a split layout under
~/.config/opensnitch/list_subscriptions:~/.config/opensnitch/list_subscriptions/sources.list.d/~/.config/opensnitch/list_subscriptions/rules.list.d/Each subscription downloads its actual list file into:
~/.config/opensnitch/list_subscriptions/sources.list.d/<filename>and stores its metadata file alongside it:
~/.config/opensnitch/list_subscriptions/sources.list.d/<filename>.meta.jsonThese source files are the canonical downloaded artifacts managed by the runtime.
Rules do not consume files directly from
sources.list.d. Instead, the plugin builds rule-facing directories in:~/.config/opensnitch/list_subscriptions/rules.list.d/<subscription-dir>~/.config/opensnitch/list_subscriptions/rules.list.d/<group>~/.config/opensnitch/list_subscriptions/rules.list.d/allThose directories contain symlinks pointing back to the real files in
sources.list.d.This gives the plugin two clearly separated roles:
sources.list.dis the storage area for downloaded lists and metadata filesrules.list.dis the clean rule-facing view that OpenSnitch rules can targetUI Design
Main Opensnitch window
The plugin main window is invoked via opensnitch's top action bar (after the firewall icon) or if it failed to inject there it will be available in the application menu.
Plugin main window
Adding/Editing subscriptions
Creating rules from subscriptions
When a rule (either global for all subscribed lists, per user assigned groups, or individually per list if only one is selected) is created (via the available action buttons on the panel), a directory with symlinks to the ordered sources list files is created under
~/.config/opensnitch/rules.list.d/<group/per_list_dir>and directly passed to the new rule dialog.