Commit graph

23 commits

Author SHA1 Message Date
ppom
915e308015
Better plugin process management
following stderr: task doesn't use shutdown anymore. It will simply follow
stderr until the end of reaction, which at worst is a negligible
memory leak if reaction continues running.
I tried closing stderr on the plugin side with a raw syscall of the file
descriptor, but reaction side doesn't see that stderr is closed.
So I can't rely on that.
Quitting when shutdown.wait() returns is too early, because that's also
what makes reaction asking for the plugin to close(), and it can print
important logs during its shutdown.
The task ignoring all the shutdown part is dead simple and is most likely
correct everytime.

updated the wording of plugin-related errors.

also replaced futures::select! { future, sleep() } with more concise and
macro-less tokio::timeout.
2026-02-09 12:00:00 +01:00
ppom
1e082086e5
cluster: add tests
- on configuration
- on sending messages to its own cluster
2026-01-19 12:00:00 +01:00
ppom
79d85c1df1
Reduce usage of chrono
TODO: handle migrations
2025-12-07 12:00:00 +01:00
ppom
43fdd3a877
cluster: finish first draft
finish ConnectionManager main loop
handle local & remote messages, maintain local queue
2025-12-07 12:00:00 +01:00
ppom
3f6e74d096
Accept remote connections. Prepare work for shared_secret handshake
Renamed ConnectionInitializer to EndpointManager.
Endpoint isn't shared with Cluster anymore.

Moved big `match` in `loop` to own function, mainly to separate it from
the select macro and reduce LSP latency. But that's cleaner too.
2025-12-07 12:00:00 +01:00
ppom
a7604ca8d5
WIP allow plugin to print error to stderr and capture them
I have a race condition where reaction quits before printing process' stderr.
This will be the occasion to rework (again) reaction's daemon startup
2025-12-07 12:00:00 +01:00
ppom
124a2827d9
Cluster plugin init
- Remove PersistData utility
- Provide plugins a state directory instead, by starting them inside.
- Store the secret key as a file inside this directory.
- Use iroh's crate for base64 encoding, thus removing one dependency.
- Implement plugin's stream_impl and action_impl functions,
  creating all necessary data structures.
2025-12-07 12:00:00 +01:00
ppom
61fe405b85
Add cluster plugin skeleton 2025-12-07 12:00:00 +01:00
ppom
0c4d19a4d7
plugins are now named
and fixed the virtual test
2025-12-07 12:00:00 +01:00
ppom
a5c563d55f
WIP systemd support
The logic seems to be fine.
Still need to think what security defaults are pertinent.
2025-12-07 12:00:00 +01:00
ppom
7f0cf32666
v2.2.1 2025-09-20 12:00:00 +02:00
ppom
ca89c7f72a
Fix filter commands executing before start commands
Now creating the socket file before starting its manager.
So I can launch start commands after its creation, and before creating
the filter managers.
2025-08-08 12:00:00 +02:00
ppom
10bd0a1859
Tree::fetch_update: Do not remove and re-add entries.
Better cloning the value than writing another entry!
2025-08-08 12:00:00 +02:00
ppom
58f4793308
Fix triggers being forgotten on after actions with on_exit: true
decrement_trigger do not delete triggers anymore when exiting

test still failing because filters start before start commands
2025-08-08 12:00:00 +02:00
ppom
90ec56902a
Add tests for triggers tree migration 2025-08-06 12:00:00 +02:00
ppom
eaf40cb579
test Filter::regex conformity after setup 2025-08-06 12:00:00 +02:00
ppom
441d981a20
Duplicate::Ignore: do not show ignored matches
move match logging from concepts/filter to daemon/filter
2025-08-06 12:00:00 +02:00
ppom
f36464299a
Duplicate::Extend: reschedule correctly actions not already triggered
Before, it rescheduled all actions with an `after` directive,
which is wrong when some after actions have already been executed
(in case of different actions with different after durations)
2025-08-06 12:00:00 +02:00
ppom
0a9c7f97df
Split IP pattern code in 3 files 2025-08-04 12:00:00 +02:00
ppom
421002442e
Add ip tests on daemon::filter
Fix PatternType deserialization
Fix regex deserialization (now optional)
Tests currently failing
2025-08-04 12:00:00 +02:00
ppom
44e5757ae3
WIP pattern ip 2025-08-04 12:00:00 +02:00
ppom
d9842c2340
Duplicate::Extend: Re-Trigger only after actions
- implement schedule_exec's only_after
2025-07-14 12:00:00 +02:00
ppom
2cebb733b5
WIP duplicates
- change remove_trigger to remove all triggers for a Match
- schedule_exec will take only_after boolean
2025-07-14 12:00:00 +02:00