Commit graph

549 commits

Author SHA1 Message Date
ppom
b667b1a373
Get rid of remoc for peer communications
I couldn't understand why all communications timed out as soon as all
messages are sent with a remoc RecvError::ChMux "multiplexer terminated".

So I'm getting rid of remoc (for now at least) and sending/receiving
raw data over the stream.

For now it panics, after the handshake complete, which is already good
after only one test O:D
2025-12-07 12:00:00 +01:00
ppom
83ac520d27
Connections have ids, to fix simultaneous connections races 2025-12-07 12:00:00 +01:00
ppom
81fa49aa5c
Add tests to virtual and use reaction-plugin's PatternLine
Those tests permitted to find the bug that led me to create PatternLine
Also add a serde option to deny extra keys in virtual action's config
2025-12-07 12:00:00 +01:00
ppom
e22429f92e
Add time to Exec messages, so that plugin actions don't have to calc this 2025-12-07 12:00:00 +01:00
ppom
da5c3afefb
Provide a correct implementation of user-configured match line parsing 2025-12-07 12:00:00 +01:00
ppom
3ed2ebd488
Two nodes succeeded to exchange messages 🎉
Separated try_connect to another task, to prevent interblocking

Send a byte to the new stream so that the other can see the stream
and accept it.
2025-12-07 12:00:00 +01:00
ppom
ff5200b0a0
cluster: add a lot of DEBUG msgs, Show trait to ease logging 2025-12-07 12:00:00 +01:00
ppom
a5d31f6c1a
cluster: First round of fixes and tests after first run
Still not working!
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
2216edfba0
shutdown: permit ShutdownController to be cloned
When multiple tasks can ask to quit
2025-12-07 12:00:00 +01:00
ppom
0635bae544
cluster: created ConnectionManager
Reorganized code.
Moved some functionnality from EndpointManager to ConnectionManager.
Still a lot to do there, but few in the rest of the code.
2025-12-07 12:00:00 +01:00
ppom
552b311ac4
Move shutdown module to reaction-plugin and use in cluster 2025-12-07 12:00:00 +01:00
ppom
71d26766f8
plugin: Stream plugins now pass time information along their lines
This will permit the cluster to accurately receive older-than-immediate
information, and it will permit potential log plugins (journald?) to go
back in time at startup.
2025-12-07 12:00:00 +01:00
ppom
bc0271b209
Fix test that did not pass when virtual was not previously built
This seems a bit hacky though because
the test needs to have `cargo` in `$PATH`
2025-12-07 12:00:00 +01:00
ppom
5782e3eb29
Fix reaction-plugin doctests 2025-12-07 12:00:00 +01:00
ppom
a70b45ba2d
Move parse_duration to reaction-plugin and fix dependency tree 2025-12-07 12:00:00 +01:00
ppom
40c6202cd4
WIP switch to one task per connection 2025-12-07 12:00:00 +01:00
ppom
7e680a3a66
Remove shared_secret option 2025-12-07 12:00:00 +01:00
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