Commit Graph

316 Commits

Author SHA1 Message Date
Vincenzo Palazzo c7d5ffe51b
cli: fix ambiguity between mutually exclusive args
There are some cases where it is just safe to skip the `--x` flag
because it is already set to true by default, and other cases where we
need to use an option value.

Also, I may miss some team code conventions regarding the PartialEq and
Eq macros to enable the quality on the `Comment` type!

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-12-01 10:18:58 +01:00
xphoniex 1b00e8a413
httpd: implement `IntoResponse` for api error variants
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
xphoniex b96f357c2e
Migrate `/v1/stats` route
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
xphoniex e5e8a403fc
Migrate `/projects`: `issues`, `issue` handlers
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
xphoniex b4902d3408
Migrate `/projects`: `remotes`, `remote`, `blob`, `readme` handlers
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
xphoniex 84c3cf4cf1
Migrate `/projects`: `history` and `tree` handlers
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
xphoniex dea7082a6f
Migrate `/projects`: `root`, `project`, `commit`, `activity` handlers
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
xphoniex 77e0a176bd
Migrate `/v1/delegates` route
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
xphoniex 6f8511c360
Migrate `/v1/sessions` route
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
xphoniex acd7aeb9c9
Migrate `/v1/`, `/v1/node` routes to heartwood
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-30 13:06:03 +00:00
Dr Maxim Orlovsky da55e521a1
Use socket addr instead of Ip for the address book 2022-11-29 17:58:38 +01:00
xphoniex c597b6989e
cli: Change help descriptions for cmds
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-28 11:25:06 +01:00
xphoniex 5532d40aae
cli: Add rest of cmds to `rad`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-28 11:25:06 +01:00
Alexis Sellier 86e6fa22a1
cob: Rename default history type
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:52:31 +01:00
Alexis Sellier a79c95283b
Minor doc and instance changes
Signed-off-by: Alexis Sellier<alexis@radicle.xyz>
2022-11-26 17:51:07 +01:00
Alexis Sellier fee0296910
Rename `LClock` to `Lamport`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:48:50 +01:00
Alexis Sellier b79e2f5b56
crdt: Remove redundant `Author` type
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:44:18 +01:00
Alexis Sellier d18b67ba21
crdt: Remove redundant `merge` function
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:41:46 +01:00
Alexis Sellier d1360bbec0
crdt: Remove `Copy` bound on `LWWMap`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:41:40 +01:00
Alexis Sellier 171b5a45f7
Implement issues using radicle CRDTs
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:41:37 +01:00
Alexis Sellier 36ccab2d7a
crdt: Make some improvements to the types
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier cc33d04a7b
crdt: Require `LWWReg` value to be `Semilattice`
* Also derive instances of `Semilattice` for built-in types.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier cc64c1d80b
cob: Use semilattice rules for commenting
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier fa9a89caa3
Start integrating new CRDTs into `radicle` crate
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 550ad2b558
Make `Thread` a semilattice
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 7e8af47f59
Implement `Change::decode`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 0448441418
Use `merge` as the `Semilattice` join method
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 01b7686659
Turn `Redactable` into a semilattice
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 681a8c9374
Test CRDT storage, simplify `Thread`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 01ad0fb31d
cob: Split generic code from automerge-specific 2022-11-26 17:13:18 +01:00
Alexis Sellier 5526eceea0
cob: Add new history type, simplify `Content`
Keep the history type in the manifest, but no need to specify it
for all individual changes.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-24 13:41:24 +01:00
Alexis Sellier 8dc655758e
Test ordering of timelines with concurrency
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-23 21:03:49 +01:00
Alexis Sellier 64862b3ab3
Add lamport clock
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-23 19:52:20 +01:00
Alexis Sellier 0482757ce9
Implement `LWWReg` in terms of `Max`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-23 19:52:20 +01:00
Alexis Sellier b11826b113
Add `LWWMap` and implement `LWWSet` with it
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-23 19:52:20 +01:00
Alexis Sellier 35f061746c
Add `radicle-crdt` crate
Explorations with CRDTs.
2022-11-23 19:52:18 +01:00
xphoniex 21e47c7a34
cli: Use the build.rs at root
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-23 19:48:15 +01:00
Slack Coder f5d06f6138 node: Fix addresses sent to peers on conn.
Send the node's configured external addresses instead of its listenning
addresses.  External addresses are ones which the service is reachable
from the outside world, the listening addresses can be the wrong context
(local area network, or 0.0.0.0).

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-23 13:13:56 -05:00
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