Commit graph

548 commits

Author SHA1 Message Date
ppom
ba592c7bcc
Fix panic caused by previous commit
Connection still close as soon as they idle :/
2025-12-05 12:00:00 +01:00
ppom
eb0c3b760b
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-11-28 12:00:00 +01:00
ppom
1c629f9a23
Connections have ids, to fix simultaneous connections races 2025-11-28 12:00:00 +01:00
ppom
d7c17b8f9f
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-11-27 12:00:00 +01:00
ppom
048ee70841
Add time to Exec messages, so that plugin actions don't have to calc this 2025-11-27 12:00:00 +01:00
ppom
b292faa536
Provide a correct implementation of user-configured match line parsing 2025-11-27 12:00:00 +01:00
ppom
0608de41e7
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-11-26 12:00:00 +01:00
ppom
8e54e45409
cluster: add a lot of DEBUG msgs, Show trait to ease logging 2025-11-25 12:00:00 +01:00
ppom
cacaa8d639
cluster: First round of fixes and tests after first run
Still not working!
2025-11-22 12:00:00 +01:00
ppom
21ae731e4a
cluster: finish first draft
finish ConnectionManager main loop
handle local & remote messages, maintain local queue
2025-11-20 12:00:00 +01:00
ppom
41934070b9
shutdown: permit ShutdownController to be cloned
When multiple tasks can ask to quit
2025-11-20 12:00:00 +01:00
ppom
a47bc84dc3
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-11-15 12:00:00 +01:00
ppom
e176520d32
Move shutdown module to reaction-plugin and use in cluster 2025-11-15 12:00:00 +01:00
ppom
f5ca9099a8
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-11-15 12:00:00 +01:00
ppom
d913d43e38
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-11-15 12:00:00 +01:00
ppom
ca77e8114f
Fix reaction-plugin doctests 2025-11-15 12:00:00 +01:00
ppom
ee5b43851b
Move parse_duration to reaction-plugin and fix dependency tree 2025-11-15 12:00:00 +01:00
ppom
837973d779
WIP switch to one task per connection 2025-11-14 12:00:00 +01:00
ppom
4fa8f9edc9
Remove shared_secret option 2025-11-14 12:00:00 +01:00
ppom
54f912ae71
Expose parse_duration to the plugin
It may be better to put it in the reaction-plugin module instead
2025-11-14 12:00:00 +01:00
ppom
fcaffd8897
Remove insecure handshake and just check if we know this public key 2025-11-11 12:00:00 +01:00
ppom
bfb3fb05f2
Insecure hash-based handshake. I must find something else. 2025-11-11 12:00:00 +01:00
ppom
3121339985
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-11-06 12:00:00 +01:00
ppom
d3ed6addf2
cluster initialization
- Actions are connected to Cluster,
- Separate task to (re)initialize connections
2025-11-03 12:00:00 +01:00
ppom
61107e7b4e
show plugin stream exit error only when not quitting 2025-11-02 12:00:00 +01:00
ppom
20d62c8856
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-11-02 12:00:00 +01:00
ppom
26a87e0066
Better doc and errors 2025-10-30 12:00:00 +01:00
ppom
4562b423ee
Fix plugin build, one secret key per cluster, more work on cluster init 2025-10-30 12:00:00 +01:00
ppom
9608653917
fmt, clippy, tests, fix some tests after startup refacto 2025-10-30 12:00:00 +01:00
ppom
82e27c4abf
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-10-30 12:00:00 +01:00
ppom
45ccf1ea6b
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-10-30 12:00:00 +01:00
ppom
3671cd8af5
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-10-27 12:00:00 +01:00
ppom
f34e4ab9f2
cluster: retrieve, generate and store iroh SecretKey 2025-10-22 12:00:00 +02:00
ppom
4dcb35d116
plugin: add simple way to store small data for plugins 2025-10-22 12:00:00 +02:00
ppom
5975344451
Add cluster plugin skeleton 2025-10-20 12:00:00 +02:00
ppom
7c5c5ff757
Add PersistData to trait 2025-10-20 12:00:00 +02:00
ppom
b9550e3acb
plugin protocol: add manifest with version 2025-10-20 12:00:00 +02:00
ppom
a8c4fd12d4
plugins are now named
and fixed the virtual test
2025-10-21 12:00:00 +02:00
ppom
cafbc7f90b
fmt 2025-10-16 12:00:00 +02:00
ppom
fb202977c4
WIP systemd support
The logic seems to be fine.
Still need to think what security defaults are pertinent.
2025-10-11 12:00:00 +02:00
ppom
540005e901
Specify reaction as default bin 2025-10-11 12:00:00 +02:00
ppom
1aad99fdee
cargo build builds plugin
And benchmark for virtual plugin
2025-10-10 12:00:00 +02:00
ppom
635d1a052d
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-10-10 12:00:00 +02:00
ppom
550606801a
First shot of "virtual stream" plugin 2025-10-03 12:00:00 +02:00
ppom
b02b5f4b14
Fix tests 2025-10-05 12:00:00 +02:00
ppom
182633815b
First building version of reaction with plugins 2025-10-05 12:00:00 +02:00
ppom
ba65ea3879
Adapt Config and plugin loading
daemon::Stream integration TBD
2025-10-03 12:00:00 +02:00
ppom
47cbf79b5f
Adapt reaction-plugin to remoc 2025-10-01 12:00:00 +02:00
ppom
09108e33ed
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-09-29 12:00:00 +02:00
ppom
dc9e577fc8
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-09-27 12:00:00 +02:00