Commit graph

631 commits

Author SHA1 Message Date
ppom
9235873084
Expose parse_duration to the plugin
It may be better to put it in the reaction-plugin module instead
2025-12-07 12:00:00 +01:00
ppom
ba9ab4c319
Remove insecure handshake and just check if we know this public key 2025-12-07 12:00:00 +01:00
ppom
2e7fa016c6
Insecure hash-based handshake. I must find something else. 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
983eff13eb
cluster initialization
- Actions are connected to Cluster,
- Separate task to (re)initialize connections
2025-12-07 12:00:00 +01:00
ppom
db622eec53
show plugin stream exit error only when not quitting 2025-12-07 12:00:00 +01:00
ppom
cd2d337850
Fixed communication error: do not use serde_json::Value
So maybe serde_json's Value can't be serialized with postbag.
Recreated my own Value that can be converted from and to serde_json's.

removed one useless tokio::spawn.
2025-12-07 12:00:00 +01:00
ppom
ebf906ea51
Better doc and errors 2025-12-07 12:00:00 +01:00
ppom
310d3dbe99
Fix plugin build, one secret key per cluster, more work on cluster init 2025-12-07 12:00:00 +01:00
ppom
58180fe609
fmt, clippy, tests, fix some tests after startup refacto 2025-12-07 12:00:00 +01:00
ppom
20921be07d
Fix daemon startup: all subsystems will cleanly exit
Regardless of which startup error makes reaction exit.

Also made plugin stderr task exit when the ShutdownToken asks for it.
Also updated Rust edition to 2024.
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
e3060d0404
cluster: retrieve, generate and store iroh SecretKey 2025-12-07 12:00:00 +01:00
ppom
c918910453
plugin: add simple way to store small data for plugins 2025-12-07 12:00:00 +01:00
ppom
61fe405b85
Add cluster plugin skeleton 2025-12-07 12:00:00 +01:00
ppom
8d864b1fb9
Add PersistData to trait 2025-12-07 12:00:00 +01:00
ppom
fa350310fd
plugin protocol: add manifest with version 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
9f56e5d8d2
fmt 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
76bc551043
Specify reaction as default bin 2025-12-07 12:00:00 +01:00
ppom
b44800ed30
cargo build builds plugin
And benchmark for virtual plugin
2025-12-07 12:00:00 +01:00
ppom
7cbf482e4d
plugin improvements
- fix panic of channel(0)
- cleaner plugin interface with one level of Result
- standalone metadata for stream plugins
- new test for plugin virtual
2025-12-07 12:00:00 +01:00
ppom
f08762c3f3
First shot of "virtual stream" plugin 2025-12-07 12:00:00 +01:00
ppom
160d27f13a
Fix tests 2025-12-07 12:00:00 +01:00
ppom
147a4623b2
First building version of reaction with plugins 2025-12-07 12:00:00 +01:00
ppom
d887acf27e
Adapt Config and plugin loading
daemon::Stream integration TBD
2025-12-07 12:00:00 +01:00
ppom
a99dea4421
Adapt reaction-plugin to remoc 2025-12-07 12:00:00 +01:00
ppom
fc11234f12
Loading plugin not on config side, but stream/action manager side
Trying to implement this on the StreamManager first.
I get lifetime errors that make no sense to me, like futures should
hold any argument with 'static.

I wonder if I should try to convert everything stabby to abi_stable &
async_ffi. I'll try this and see if it solves anything.
2025-12-07 12:00:00 +01:00
ppom
05f30c3c57
First WIP iteration on the plugin system, reaction side.
Delaying the implementation of plugin Filters. I'm not sure it's useful,
(apart from JSON, what can be done?) and it's likely to be more painful
than the rest.
I'll probably just implement one custom JSON Filter like I did with
Pattern's IP support.
2025-12-07 12:00:00 +01:00
ppom
338aa8a8a2
Fix compilation error
The lifetime compilation error disappears when the filter methods are
async, so let's just do that for now
2025-12-07 12:00:00 +01:00
ppom
ae46932219
Fix workspace dependency 2025-12-07 12:00:00 +01:00
ppom
8229f01182
Dependency cleanup 2025-12-07 12:00:00 +01:00
ppom
22125dfd53
First plugin shot 2025-12-07 12:00:00 +01:00
ppom
d36e54c55b
README: add mail 2025-10-31 12:00:00 +01:00
ppom
fa63a9feb8
README: fix example YAML 2025-10-07 12:00:00 +02:00
ppom
7f0cf32666
v2.2.1 v2.2.1 2025-09-20 12:00:00 +02:00
Baptiste Careil
c6e4af96cd
Fix some triggers no longer triggering after being loaded from db 2025-09-19 12:00:00 +02:00
ppom
278baaa3e6
Shorter variant of the heavy load benchmark for quicker results 2025-09-19 12:00:00 +02:00
ppom
974139610f
async db
Fixing deadlock on start.
FilterManager send a lot of write operations on start.
Each of them spawned a new Task to send the log in a channel.
All those writes were unlocked when the Database started, shortly after.
Now that the channel sending is awaited, it made a deadlock.

Database's API and startup has been rewritten, so that open_tree is made
accross the same channel used to log write operations.

Database is started as soon as it is opened.
The Database struct is now just a Sender to the real Database, now
DatabaseManager.

This removes the constraint for Tree opening happening before any write
operation!
2025-09-19 12:00:00 +02:00
ppom
aec3bb54ed
async db 2025-09-07 12:00:00 +02:00
ppom
582889f71e
WIP async db
Fixes inherent problem on sync db, which spawns a new task for
persistance. This makes the log unordered, which can cause inconsistence
issues.
2025-09-07 12:00:00 +02:00
ppom
e37bd6ebbe
Add a mention on Azlux's third-party repository
Related to #134
2025-09-06 12:00:00 +02:00
Baptiste Careil
1f734a516d Fix test load_conf_directory
- Fixed concurrency to 1 not to be platform dependent
- Added fields introduced by recent changes
- Used builtin str comparator that produces a diff instead of the eq
  predicate
2025-08-17 18:33:09 +02:00
ppom
e45963dd4c
Debian: Add extended-description
Fix #134
2025-08-11 12:00:00 +02:00
ppom
0e75514db3
Debian: Add section information
Fix #134
2025-08-11 12:00:00 +02:00
ppom
fc6a385574
Add armhf-gnu build for Raspberry Pis 2025-08-11 12:00:00 +02:00
ppom
dcc2e1ec4c
v2.2.0 v2.2.0 2025-08-08 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