Alexis Sellier
54dc34d4b9
node: Minor logging improvements
2023-03-06 15:39:07 +01:00
Alexis Sellier
c8c44c884c
cli: Allow `init` without running node
2023-03-06 15:38:42 +01:00
Alexis Sellier
e69be6051d
cli: Give more control over `init` announcement
...
Instead of always announcing the inventory, by default we don't.
Users can run `rad push` to trigger an announcement.
2023-03-06 15:38:42 +01:00
Alexis Sellier
793c085094
node: Don't force use of RAD_PASSPHRASE
...
If it isn't set, prompt the user.
2023-03-06 10:22:53 +01:00
Alexis Sellier
5f59493c70
cob: Don't require a local fork to exist
...
Before this change, the identity document would be loaded for the
COB signer. This meant that a fork would be needed for that signer.
After this change, it's no longer necessary, since the identity doc
head is computed from available remotes.
While making those changes, it was also apparent that some of the
identity-related functions had bad names and error types, this
was fixed as well.
2023-03-01 15:40:30 +01:00
Alexis Sellier
411c54a604
node: Use loopback address as git-daemon default
...
Prevents external connections to it.
2023-03-01 13:03:42 +01:00
Alexis Sellier
207030d2e1
cli: Don't fail clone if we have repo locally
2023-02-27 18:19:02 +01:00
Fintan Halpenny
c70dc71b18
node: improve seeds information
...
Previously, the seeds information would only consist of the connected
NodeIds.
Improve on this by adding any disconnected and fetching seeds as
well. A seed can either be disconnected, connected, or fetching --
where fetching implies connected.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-27 17:48:11 +01:00
Fintan Halpenny
c0b92d25fb
radicle: remove FetchResult associated type
...
The Handle trait defines a FetchResult associated type. This type is
always instantiated to be the FetchResult enum in radicle::node.
Remove the associated type to simplify the trait.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-27 17:17:00 +01:00
Alexis Sellier
11da344e3a
node: Add `--tracking-policy` flag
...
Sets the default tracking policy.
2023-02-27 13:46:40 +01:00
Dr Maxim Orlovsky
158f1ff7fa
Update to fixed `io-reactor` timer
2023-02-22 16:21:25 +01:00
Alexis Sellier
7e1b2b6222
crypto: Cleanup `hash` module
...
Remove `Digest` type and use `ssh-key` for formatting public ssh key.
2023-02-17 10:51:27 +01:00
Fintan Halpenny
8e26e4c046
radicle: canonicalize home path
...
If a path was passed to `Home` in non-canonical form it would not use
the right path for any initialisation or use.
The aim is to use the `canonicalize` function for paths. However, this
may return an error if none of the paths exist. To ensure that the
path exists the `new` constructor for `Home` creates the directory and
canonicalizes the path.
Since `new` now initialises the home directory, it would be useful if
it also initialised all the necessary subdirectories -- which removes
the need for the `init` method.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-16 16:35:59 +01:00
Alexis Sellier
a7d2fa95cd
node: Remove redundant handshake
...
With `NoiseXK` handshake implemented, there is no longer a need to
have an `Initialize` message and an extra state in the session.
2023-02-16 15:10:31 +01:00
Alexis Sellier
71561a8e12
node: Move state transition code to session
2023-02-16 15:09:53 +01:00
Alexis Sellier
011923f1df
node: Buffer gossips until fetch is completed
...
This change ensures that gossip messages are buffered if we try to
send them during a fetch, and sent after the fetch completes.
2023-02-16 15:09:53 +01:00
Alexis Sellier
0f81f8a7aa
node: Take session reference when writing messages
...
This ensures that we have an existing session when sending messages.
It also will allow us to check the session's state.
2023-02-16 15:09:53 +01:00
Alexis Sellier
950fae209d
Make `ReadStorage` more usable
...
Previously, we were not able to access a `ReadRepository` instance
through `ReadStorage`. With this change, we are able to.
2023-02-15 22:08:20 +01:00
Alexis Sellier
89fcc6de1c
node: Subscribe on track-repo
...
We re-subscribe after our tracking policy has been changed so that
peers are informed of our interests.
2023-02-15 22:07:51 +01:00
Alexis Sellier
8cbc3c2403
node: Move to NoiseXK
...
Move from NoiseNN with a custom authentication protocol, to NoiseXK.
Uses ECDH on the ed25519 curve via the `ec25519` library.
2023-02-15 22:05:04 +01:00
Slack Coder
76d23a3fa9
node: Add more command argument documentation
...
Document `--git-daemon` and describe the default values.
Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-02-15 15:17:07 +01:00
Alexis Sellier
b29ce1a222
node: Fix bug when socket file is deleted
...
If the socket file is deleted while the node is running, we can no
longer quit with Ctrl-C. This is the "fix".
2023-02-15 10:41:09 +01:00
Alexis Sellier
ee513ccf7e
node: Complete the "relay" seed test
...
These are the final changes to get the "relay" scenario passing.
There are still some issues left, though it's done as far as the
test is concerned.
2023-02-14 20:31:40 +01:00
Alexis Sellier
7919c7ea61
node: Use millisecond precision for timestamps
...
Previously we used seconds, which could result in false positives
when checking for stale announcements, if things happened too quickly.
2023-02-14 20:31:40 +01:00
Alexis Sellier
72c99b7939
node: Handle `SIGINT` and `SIGTERM` properly
...
This ensures that the socket file is cleaned up on exit.
2023-02-14 13:28:16 +01:00
Alexis Sellier
3ae826dee2
node: Add clone test with seed acting as relay
2023-02-13 10:30:04 +01:00
Alexis Sellier
3e7761740f
node: Rely on inventory announcement in `rad init`
2023-02-13 09:59:44 +01:00
Alexis Sellier
c673f5db68
node: Add some useful test utility functions
2023-02-12 21:03:28 +01:00
Alexis Sellier
7087288cfb
node: Implement inventory sync command
2023-02-12 20:57:33 +01:00
Alexis Sellier
2f1a18470e
node: Fix filter construction and policy code
2023-02-12 17:07:57 +01:00
Alexis Sellier
5f4c6edee4
node: Simulator logging improvements
2023-02-12 16:48:46 +01:00
Alexis Sellier
42b4d95f93
node: Improve output of `Session::fetch` function
2023-02-12 16:22:51 +01:00
Alexis Sellier
bd7c5a0daa
node: Add ability to have default tracking policy
...
When a specific tracking policy isn't found, we allow setting a default.
To preserve existing behavior, the default is `Block`, ie. if a node
isn't tracked explicitly, it is blocked.
However, this change allows for using `Track` as the default, which
is a way to track everything without having to know the entities in
advance.
2023-02-12 16:22:51 +01:00
xphoniex
bdc0ab9881
Update `radicle-git` and `radicle-surf`
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-10 22:14:50 +01:00
Alexis Sellier
488f043226
node: Properly reap git-daemon process
2023-02-10 12:57:04 +01:00
Slack Coder
02c07d7be1
cli: Test rad-clone is deterministic
...
The last commit of a newly cloned repository should remain untouched by
making `Node::project()` use a repository fixture instead of a randomly
generated one.
Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-02-09 16:49:52 +01:00
Alexis Sellier
69ac8be8fd
node: Update local routing table on announce
2023-02-08 21:28:49 +01:00
Alexis Sellier
f01735bef6
cli: Have `init` trigger routing table updates
...
Before this change, nodes had to be restarted to announce newly
initialized projects.
2023-02-08 16:29:42 +01:00
Alexis Sellier
c138cd062c
node: Give each peer its own inbox
...
Instead of a shared queue, each peer gets its own inbox.
2023-02-08 11:43:39 +01:00
Alexis Sellier
054655d79b
node: Log read buffer if not empty
2023-02-07 21:13:29 +01:00
Alexis Sellier
f66ecd4ece
node: Replication fixes
...
* Read git request line before starting daemon, so that we don't leave
git data in the socket read buffer in case of an error connecting to
the daemon.
* Send a response on the fetch channel even if we disconnect the remote.
* Don't send `done` packet if there's an error; it won't be expected.
2023-02-07 21:04:13 +01:00
Alexis Sellier
d59c422b9d
node: Send special `done` packet to end protocol
2023-02-07 10:47:35 +01:00
Alexis Sellier
f5f36191d9
node: Fix some connection-related logic
2023-02-07 10:47:35 +01:00
Alexis Sellier
7bdedd0ffd
node: Fix bug with persistent peer reconnect
...
We weren't updating the sessions map when a persistent peer
was re-attempted. It would then panic when `connected` was called,
because the state would be `Disconnected`.
2023-02-07 10:47:35 +01:00
Alexis Sellier
2ceb39553e
node: Remove redundant log
2023-02-07 10:47:35 +01:00
Alexis Sellier
037ff39894
node: Use JSON for control commands
2023-02-07 10:46:12 +01:00
Alexis Sellier
2649e9c6fe
cli: Add `rad-clone` test
2023-02-07 10:46:12 +01:00
Alexis Sellier
a8531eff36
node: Implement `seeds` control command
2023-02-07 10:46:12 +01:00
Alexis Sellier
b542ddcd6c
node: Create shared test environment
...
We move and combine some of the test code, so that the CLI tests and
node tests use shared code.
2023-02-07 10:46:12 +01:00
Alexis Sellier
45e31a5192
Communicate fetch results through control socket
...
This allows a CLI to report to the user what fetch requests were
fulfilled, and which ones failed.
2023-02-07 10:46:12 +01:00
Slack Coder
98f09130bb
node: Elaborate --help message
...
Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-02-04 20:03:31 +01:00
Fintan Halpenny
3f48c2c516
Rust 1.67
...
Rust 1.67 was announced[0]. Update the necessary files for running
1.67 and fix the clippy suggestions for string interpolation.
[0]: https://blog.rust-lang.org/2023/01/26/Rust-1.67.0.html
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-04 19:30:29 +01:00
Alexis Sellier
98f7fe1db8
node: Rename `GIT_RESET` env var
2023-01-30 18:23:24 +01:00
Alexis Sellier
c1a749e09e
node: Make git-daemon errors more apparent
2023-01-30 14:07:31 +01:00
Alexis Sellier
03b94c81a0
node: Make git daemon listen configurable
2023-01-30 13:47:09 +01:00
Alexis Sellier
498a5c4e4a
node: Handle `fetched` differently if initiated
2023-01-30 13:22:33 +01:00
Alexis Sellier
3aa105afda
node: Return error if remote errors
...
Instead of simply breaking out of the loop, log and return an error.
2023-01-30 13:15:33 +01:00
Alexis Sellier
0726c553da
node: Run git fetch without any user config
2023-01-30 12:35:08 +01:00
Alexis Sellier
a0910f7593
Cleanup old `fetch` code
...
We only use the old code in the simulator now.
2023-01-30 12:26:29 +01:00
Alexis Sellier
be77eebc3d
node: Only try to fetch from connected nodes
2023-01-30 11:20:33 +01:00
Alexis Sellier
ac23f45d9b
node: Cleanup working naming
2023-01-29 21:41:16 +01:00
Alexis Sellier
7d5347b74f
node: Document worker a little more
2023-01-29 21:34:40 +01:00
Alexis Sellier
b92dc59204
node: Turn off `--atomic` when not supported
2023-01-29 18:22:41 +01:00
Alexis Sellier
33d8c35189
node: Move some code to `Runtime::run`
2023-01-29 17:39:46 +01:00
Alexis Sellier
23cf44f4c7
node: Rename `client` module to `runtime`
2023-01-29 17:33:07 +01:00
Alexis Sellier
02be334144
node: Use `git-daemon` as backend
2023-01-29 17:26:01 +01:00
Alexis Sellier
d9e1055067
Improve logging
2023-01-28 23:58:16 +01:00
Alexis Sellier
deeb160c2d
node: Improve stderr logging for git process
2023-01-27 17:04:20 +01:00
Alexis Sellier
be95222fb5
node: Fix bug in upload-pack
...
We were not properly exiting one of the threads that was copying
data from the stream to the upload-pack process. This is a fix.
2023-01-27 15:09:17 +01:00
Alexis Sellier
026dfbde5d
node: Improve logging output
2023-01-26 18:15:27 +01:00
Alexis Sellier
405c00b91d
Update all dependencies
...
Also moves `netservices` to `crates.io`
2023-01-25 20:38:54 +01:00
Alexis Sellier
798485dfb1
Remove "log" feature from netservices
2023-01-25 20:12:13 +01:00
Alexis Sellier
30e9d6103c
Cleanup `clone` code
...
Remove a bunch of different instances of it.
2023-01-25 17:51:49 +01:00
Alexis Sellier
cdc3c8a265
node: Try to cleanup socket file on exit
...
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-25 17:51:49 +01:00
Alexis Sellier
b4f44f39f2
Update `netservices` dependency
2023-01-25 15:35:24 +01:00
Alexis Sellier
963ad3c3d7
Get `rad clone` working correctly
2023-01-25 11:35:20 +01:00
Alexis Sellier
c888f40660
node: Respond to `announce-refs` control
2023-01-25 10:21:57 +01:00
Alexis Sellier
d324eab377
node: Remove control socket at the end
2023-01-25 10:21:57 +01:00
Alexis Sellier
fea14ff7b3
Update `clone` functionality for new replication
2023-01-25 10:21:57 +01:00
Alexis Sellier
ef950d515a
node: Fully integrate worker fetch into service
2023-01-25 10:21:57 +01:00
Alexis Sellier
ec2e7d7ee1
node: Refactor fetch response code
...
Only user-requested fetches require a response.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-25 10:21:57 +01:00
Alexis Sellier
e6f56ff3bc
Update `io-reactor` dependency
2023-01-25 10:21:57 +01:00
Alexis Sellier
3aff91f9b7
Correctly initialize home in `Profile::init`
2023-01-22 13:39:48 +01:00
Alexis Sellier
8318b07d89
node: Fix spurious test failures
...
In some circumstances, the nodes are already offline when the objects
are dropped.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-19 10:20:23 +01:00
Alexis Sellier
3bc07195f5
Migrate to `localtime` from `nakamoto`
...
The only thing we needed nakamoto for was `LocalTime`.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 18:03:11 +01:00
Alexis Sellier
d25c47ad0e
node: Get rid of worker response channel
2023-01-18 17:45:46 +01:00
Alexis Sellier
7e55ed346a
node: Update log target to match type name
...
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 17:45:46 +01:00
Alexis Sellier
067b532154
node: Get replication test to pass
...
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 17:45:46 +01:00
Alexis Sellier
723cdcf233
node: Update `io-reactor`
...
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 17:45:46 +01:00
Alexis Sellier
b9484b6832
node: Implement graceful shutdown
...
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2023-01-18 17:44:16 +01:00
Alexis Sellier
f33e79f14b
node: Fix redundant announcements
...
This change makes sure that nodes don't gossip announcements back to
the announcers.
Since the tests were relying on this mechanism to populate the routing
table, we had to change a few more things, such as adding the inventory
to the node's routing table.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 08:48:33 +01:00
Alexis Sellier
3d04849b7b
node: Properly parse replication data
...
Fix all of the `FIXME` in the worker.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 12:59:00 +01:00
Alexis Sellier
df9346fefb
node: Fix E2E tests
...
The tests were flaky because the routes are sampled at a moment
when gossip could still be happening. Instead, we check the
local inventory directly to build the expected routing table.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 12:59:00 +01:00
Alexis Sellier
3bedb4438e
node: Fix a few logging-related things
...
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
Alexis Sellier
97d4729fa4
Switch to crates.io for `cyphernet`
2023-01-17 11:01:36 +01:00
Alexis Sellier
be9def8b11
Rename `profile::Paths` to `profile::Home`
...
This makes the intent clearer.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
Alexis Sellier
d31968509d
Speed up node E2E tests
...
By allowing the node to run using a `MockSigner`, we speed up tests
significantly, since PBKDF2 doesn't need to run.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
Alexis Sellier
741f7c9651
node: Rename `Transport` to `Wire`
...
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
Alexis Sellier
63e7248847
node: Complete Noise handshake integration
...
Co-authored-by: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
Alexis Sellier
1aba9812c7
node: Request recent messages on connection
...
Instead of only being interested in messages from "now", we request
messages from one hour in the past up to now. This lets nodes catch
up on state more quickly, without having to wait for new announcements.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00