Commit Graph

278 Commits

Author SHA1 Message Date
Alexis Sellier 308112618f
Get around circular-dependency
This was causing an issue in rust-analyzer, and probably would fail
in other ways via cargo. In any case it wasn't a good idea.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 13:41:32 +01:00
Alexis Sellier e258c72eca
Implement some CLI tests using `trycmd`
I'm not entirely satisfied with `trycmd`, but it's a start.
If we choose to move to a different crate, or implement our own,
we can keep the example test cases.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier 093bb686a4
Fix dependency issue with "test" feature
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier d6a95e4d58
Support `RAD_PASSPHRASE` in `signer` method
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier 1d798a80b4
Fix issues with incorrect terminal width
For some reason, the terminal width isn't always valid, and
then ends up returning `80`.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier fd936becf1
Make `Profile::init` more flexible
Allow passing a custom home.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier 66d1f99a1e
Simplify key generation for tests and debugging
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier 03fd69f323
Configure CLI default bin
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier bdeebfb79a
Add `rad-path` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Dr Maxim Orlovsky 26fa16d2b2
Support ECDH 2022-11-22 10:35:04 +01:00
Dr Maxim Orlovsky 3ec460056d
Add cyphernet dependency 2022-11-22 10:34:49 +01:00
Dr Maxim Orlovsky 664898d8c8
Derive Hash for Signature 2022-11-21 16:40:29 +01:00
Dr Maxim Orlovsky ee17f35218
Implement Ord and PartialOrd for secret key type 2022-11-21 16:40:29 +01:00
Dr Maxim Orlovsky 2a6f3c4f55
Update ed25519-compact dependency 2022-11-21 16:07:43 +01:00
Dr. Maxim Orlovsky 3e48548745
Integrate framing and muxer into wire protocol 2022-11-21 16:05:53 +01:00
Dr. Maxim Orlovsky 13c9491e49
Implement framer and multiplexer 2022-11-21 16:05:53 +01:00
Dr. Maxim Orlovsky 983b2dc534
Two-stage connectivity with handshake 2022-11-21 16:05:53 +01:00
Dr. Maxim Orlovsky 008681a2ca
Complete transcoder documentation 2022-11-21 16:05:53 +01:00
Dr. Maxim Orlovsky 4d77f95c21
Disconnect peers on failed handshakes 2022-11-21 16:05:53 +01:00
Dr. Maxim Orlovsky e9ae5897f7
Complete transcoder
* Encode/encrypt data sent to the remote peer
* Remove unused Transport
* Rename Decoder -> Deserializer
2022-11-21 16:05:53 +01:00
Dr. Maxim Orlovsky 56fb4d67a9
Introduce transcoder parameter to Wire & Transport 2022-11-21 16:05:53 +01:00
Dr. Maxim Orlovsky 6b87eed670
Identify remote peers by full `SocketAddr`
Wire inboxes were kept per IP address. However, there could be multiple peers
connecting from the same IP (for instance, if it is an IP of a NAT).
2022-11-21 16:05:53 +01:00
Fintan Halpenny c620f873e5
radicle-cob: test parse_refstr
Add quickcheck tests for parse_refstr to ensure the correct
behaviour.

This required adding Arbitrary instances for TypeName and ObjectId, as
well as adding a mechanism for generating Invalid ObjectIds.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-17 17:42:22 +00:00
Fintan Halpenny a985e067a5
Add TypeName & ObjectId parser
Added the `parse_refname` function for parsing a reference into its
`TypeName` and `ObjectId`, if possible.

This replaces the `cob_suffix` function in `radicle`.

This change also fixes the `FromStr` instance of `ObjectId` to use
`from_str` instead of `TryFrom` for bytes.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-17 17:42:21 +00:00
Alexis Sellier b4bc032113
Add `rad-merge` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-17 09:25:17 +01:00
Alexis Sellier 01047a4942
Add `rad-review` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-16 16:38:51 +01:00
xphoniex 89bdf59e8e
Add `rad-issue` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-16 16:28:31 +01:00
Alexis Sellier dc21692ea3
Add licenses and contributor information
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-16 12:26:12 +01:00
Alexis Sellier 47d20003c0
Implement `rad-patch`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-16 12:07:19 +01:00
Alexis Sellier dea268c389
Implement `rad-push`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-16 11:36:23 +01:00
Slack Coder 5472931ff0 node: prune project routing table
Avoid wasting persistent memory by cleaning up stale routing entries
when the routing table is considered constrained.  Limit pruning to
improve resiliency in the face of long intervals between service
downtimes.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-15 12:26:34 -05:00
Slack Coder a74cb416c1 node: sync project routing for known nodes
Keep the node's understanding of project hosting location current by
updating how Inventory Announcement messages are processed.

The Inventory Announcements contain a node's entire listing of projects.
Replace the routing table information for the announcer with those from the
message.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-15 12:26:08 -05:00
Slack Coder 186eb42145 node: use announcer's timestamp in project inventory
Address a FIXME in service.process_inventory() by using the announcer's
time instead of the service's.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-15 12:26:08 -05:00
xphoniex a496eeb84d
Add `rad-rm` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-15 16:22:08 +01:00
Alexis Sellier 12988da089
Add `Patch`, `Issue`, `Label` COBs
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-14 12:40:00 +01:00
Alexis Sellier 08811b4b87
Various fixes to COBs
* Use the existing conventions for passing a signer to functions.
* Allow replacing git refs when updating cobs.
* Fix the parsing of a cob id.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-14 12:40:00 +01:00
xphoniex 80401f89ae
Add `rad-inspect` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-14 12:23:24 +01:00
Slack Coder 507bc2237a node: make tests in tests mod run
Fix a problem from a recent commit which caused tests in the tests
module not to run.

The list of modules in 'lib.rs' should use the 'tests' module's new
location.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-11 09:24:15 -05:00
xphoniex 72ec0775c7
Add `rad-edit` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-10 15:19:48 +00:00
xphoniex 4feb224b1a
Add `rad-ls` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-10 14:45:16 +01:00
Slack Coder 503a618743 node: announce node only when accessible
Avoid redundantly emitting Node Announcements about it's publicly
available addresses when it has none.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-09 09:49:21 -05:00
Slack Coder a9b38dc1ae node: let others know their address
Include the node's IP address in the Node's announcements.  Source it
from the service's configuration which can assumed to be populated with
default values when available.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-09 09:49:07 -05:00
Slack Coder f3d867af4d node: keep a healthy connection to the network
Try having a number of outbound connections to other Radicle nodes at any
given time.  The number has been defined earlier as TARGET_OUTBOUND_PEERS.
All network nodes are treated equally, there is no preference.

Attempts to keep connected happen at set intervals (IDLE_INTERVAL) or when
a node disconnects.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-09 09:49:07 -05:00
Slack Coder ff045e0813 node: use term 'session' over 'peer'
Keep up to date with recent changes of renaming service.peers to
service.sessions.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-09 09:49:07 -05:00
Slack Coder a91dcfb100 node: sync known sessions on disconnect
Make sure the service is current by removing disconnected peers.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-09 09:49:07 -05:00
xphoniex 1d51afad28
Add `rad-track`, `rad-untrack` commands
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-09 15:37:37 +01:00
Alexis Sellier f05a040be6
Make `track` functions return correctly
Previously we always returned `true`. Now we return
what the node actually returns.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-09 13:29:54 +01:00
Alexis Sellier eb666265be
Fix running `radicle-crypto` tests on its own
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-09 13:21:44 +01:00
Alexis Sellier b040098447
Add `rad-clone` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-09 09:33:02 +01:00
Alexis Sellier ca1b1f4453
Make some improvements to `rad-checkout`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-09 09:33:01 +01:00