Commit Graph

259 Commits

Author SHA1 Message Date
Erik Kundt bd4efee897
tui: Implement basic application
Signed-off-by: Erik Kundt <erik@zirkular.io>
2023-03-20 16:27:42 +01:00
Erik Kundt 62867d26bd
tui: Add basic framework
Signed-off-by: Erik Kundt <erik@zirkular.io>
2023-03-20 16:27:42 +01:00
Alexis Sellier 5ccf38079c
cli: Make `patch checkout` fetch missing objects
Before this change, `rad patch checkout` would fail if the patch commits
were not in the working copy.
2023-03-18 12:24:17 +01:00
Alexis Sellier 40c58b45ed
node: Move `routing` to `radicle` crate 2023-03-15 12:59:49 +01:00
Alexis Sellier f7aac06a8f
cli: Polish `assign` and `unassign` commands 2023-03-13 12:27:47 +01:00
Alexis Sellier aacacf872f
cob: Use `EntryId` as the operation identifier
By introducing a small limitation: only allowing entries in the change
graph to be addressable, instead of individual operations; we
drastically simplify the CRDT implementation.

There are four advantages:

1. Op ids are just regular SHA-1s
2. There's no need for relative IDs, ops never refer to other ops within the
   same commit
3. There's no need for a nonce, since commits can't collide, and neither can op IDs
4. `OpId` can just be an alias of `EntryId`

The disadvantage of course, is that we have to be mindful of how we
create op transactions, since each transaction creates an addressable
unit. For example, we must not include multiple patch revisions in the
same transaction.
2023-03-09 17:08:56 +01:00
xphoniex 267b0ed312
httpd: Use `radicle-term` instead of `radicle-cli::terminal`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-07 14:49:18 +01:00
Alexis Sellier 94899f7be2
node: Update `localtime` crate 2023-03-07 10:47:12 +01:00
Alexis Sellier 5fb5df2e61
cli: Update `inquire` crate 2023-03-07 10:39:45 +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 02304875ce
Initialize `radicle-term` crate
We split out all non-radicle terminal functionality so that it can be
accessed by `radicle-node` without importing `radicle-cli`.
2023-03-06 10:22:50 +01:00
Alexis Sellier 06a92d52d9
cob: Use hashes for operation ids
It's fairly easy for a user to (by mistake or intentionally) create two
operations with the same OpId. This patch makes it much less likely,
and ensures that if the OpId is equal, it's because the operations
are identical.
2023-02-27 17:11:48 +01:00
Alexis Sellier 0a93fa833e
cli: Simplify & improve CLI output
Improvements to the CLI output as well as converging towards
`termion` as a backend.

The crates we were using for prompting and spinners were based on
a terminal backend called `console`, which is not really used
anywhere else. There were also limitations in terms of the output
of these crates.

Therefore, we switched to the `inquire` crate for prompting, using
the `termion` backend, which is very standard.

Additionally, we simplify the terminal output to use symbols:

! for Warning
✓ for Success
✗ for Error

... Instead of a mix of words and symbols.

We also include a modified version of the `yansi` crate which plays
well with our table formatting functions by automatically truncating
and padding output in a unicode-aware way.
2023-02-27 17:10:52 +01:00
Fintan Halpenny 5ea8505000
radicle: custom CanonicalFormatter
The olpc-json crate's CanonicalFormatter does not escape certain
control characters, including new lines. This means that when a COB
gets serialized that includes new lines, those new lines are
serialized verbatim. Upon deserialization `serde_json` -- and any
other JSON deserializer -- will fail due to the encounter of these
control characters.

This behaviour was prevented in radicle-link with the definition of
its own CanoncialFormatter that encodes the control characters
correctly.

Inline this definition of the formatter, under MIT license, to ensure
the correct and remove oplc-cjson.

The behaviour is checked using a multiline test in the issue COB.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-24 11:59:36 +01:00
xphoniex 6ca1c89610 httpd: Update `/git` test to use `test` helper fns
Update `axum` to 0.6.7 to be able to use fix in:
https://github.com/tokio-rs/axum/pull/1767

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
Dr Maxim Orlovsky 158f1ff7fa Update to fixed `io-reactor` timer 2023-02-22 16:21:25 +01:00
Alexis Sellier e584bd6c1c
crypto: Use `ssh-key` crate for signatures 2023-02-17 11:53:46 +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
Sebastian Martinez b04451a1bd
Use `Did` in a bunch more places
Instead of showing just public keys we need to show the fully qualified
spec for a NID which is prefixed by `did🔑` While we want to maintain
`Author` and `ActorId` for internal use.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-16 18:01:42 +01:00
xla feedf345a3
cli-test: Complete cargo metadata
Signed-off-by: xla <self@xla.is>
2023-02-16 14:55:33 +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
xla 97f7064094 cli: Extract crate for md based tests
To allow that functionality to be published for reuse.

Signed-off-by: xla <self@xla.is>
2023-02-15 15:25:38 +11: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
Sebastian Martinez 867eea5c38
httpd: Add delegates to project routes
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-14 14:50:42 +01:00
Fintan Halpenny b257f482cb
cli: rad id command
Introduces the `rad id` subcommand for interacting with the identity
proposal cob.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-13 13:50:52 +00:00
Alexis Sellier c673f5db68
node: Add some useful test utility functions 2023-02-12 21:03:28 +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
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
Sebastian Martinez af3ea6a11a
httpd: Add issue endpoints
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-06 14:14:06 +01:00
Slack Coder 1cb8986830
Add Op ID string formatting
To help users, create an Op ID string format of the form `<actor-id>/<lamport>`.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-02-04 12:29:50 +01:00
xphoniex a5811e43a7
Update `radicle-surf`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-28 20:19:23 +01:00
Sebastian Martinez f07a875ce1
Add web-based authentication
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-01-27 17:23:05 +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 0334064f52
Update `netservices` dependency 2023-01-25 17:51:15 +01:00
Alexis Sellier b4f44f39f2
Update `netservices` dependency 2023-01-25 15:35:24 +01:00
Alexis Sellier e6f56ff3bc
Update `io-reactor` dependency 2023-01-25 10:21:57 +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 723cdcf233
node: Update `io-reactor`
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 17:45:46 +01:00
xphoniex 7ec903d712
httpd: Update axum from 0.5.x to 0.6.x
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-18 14:09:48 +00:00
Han Xu 4ea67250ea
httpd: Dogfood the new radicle-surf API
Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-01-18 14:22:01 +01:00
Alexis Sellier 97d4729fa4
Switch to crates.io for `cyphernet` 2023-01-17 11:01:36 +01:00
Alexis Sellier 72cb2fd713
Remove unused dependencies
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 438ae84304
node: Implement E2E node test
There are few unrelated changes in this commit that I wasn't able to
split out, mostly due to laziness, so I'll list them here:

* The node startup logic is moved out of the main function, and into a
  dedicated functionin `client.rs`.
* There is a tentative worker implementation that is untested, and
  handles git replication both ways. It's likely lacking in various ways
  but I wanted to get it in there anyway.
* `Address` was moved from `radicle-node` to `radicle`, because it's
  needed to send `Connect` commands from the node handle.
* The `netservices` dependency was updated.
* Finally, there is a first end-to-end node test, which currently
  doesn't use NoiseXK, but uses the new reactor in `netservices`.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-12 20:34:31 +01:00
xphoniex 7962ac0a8e
httpd: Add api tests
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-12 20:30:53 +01:00
Dr Maxim Orlovsky cf0d55fb11
node: Update io-reactor
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2023-01-06 11:27:07 +01:00
Dr. Maxim Orlovsky a7b1c19746
node: Implement worker thread handover
Also implements listener behavior.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2023-01-05 15:16:38 +01:00
Alexis Sellier 2f07b76fcb
Switch to our own DAG representation for COBs
We're using petgraph to encode an operation based CRDT (each graph node
is an operation) as a DAG, and one of the important things to ensure
is that the final state is not influenced by the order of concurrent
operations. In this case a concurrent operation would mean two potential
graph traversal orders, as there's no direct edge between the two
concurrent ops. This is essential a "partial order" of operations.

To be able to test this, we'd want some kind of control over how
neighbors are iterated over I guess, when there's more than one possible
sort order. Say we have a graph like this:

             ┌────────b◄─────┐
             ▼               │
             a               d
             ▲               │
             └────────c◄─────┘

There are two possible topological traverse orders: [a, b, c, d] and [a,
c, b, d]. Having a way to go through these different orders would
be super handy.

One option would be to allow random order traversal. This would allow us
to test all orders by running the test enough times to likely test all
permutations.

Since petgraph doesn't support this, we implement our own simple DAG in
`radicle-dag`, which implements random-order topological orders.

For now, we don't make explicit use of these improvements, we simply
replace the underlying graph with our own.
2022-12-28 13:34:17 +01:00
xphoniex 1f55d7a327
Update `radicle-git` to `79a94721366490053e2d8ac1c1afa14fb0c25f09`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-12-23 13:22:55 +01:00
Dr Maxim Orlovsky aa02c52a2f
node: Integrate new Noise_XK transport
This is a large change that introduces transport encryption via
a Noise_XK handshake. The inner `Service` now works directly
with `NodeId` and doesn't need to interact with socket addresses.

The transport logic takes place in `wire::transport`, and the
established sessions are passed down to `Service`.

Note that the i/o implementation in the `poll-reactor` crate still
needs testing, and there is still work to be done to integrate the
Git transport as part of this architecture.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-13 14:59:06 +01:00
Alexis Sellier 98c1566109
Make `Doc` type payload generic 2022-12-09 22:05:38 +01:00
Alexis Sellier b7c1f091fa
Fix issue with colliding doc files
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-09 14:37:36 +01:00
Dr Maxim Orlovsky 3ba7a02207
Use new cyphernet ECDH-related traits 2022-12-09 13:43:08 +01:00
Fintan Halpenny 5f80ee9671
cobs: allow for batched operations
Sometimes it is more efficient to perform multiple operations at once
and store those in the collaborative object graph together.

Change the contents to be a non-empty sequence of byte sequences,
i.e. NonEmpty<Vec<u8>>. These are stored as blobs in a git tree in
order by their index in the non-empty sequence. They are, in turn,
retrieved in order of their original index.

Change the conversion of an `EntryWithClock` to return a non-empty
sequence of `Op`s, which are in turn used to apply many changes in
each `from_history` implementation.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-12-07 17:11:40 +01:00
Alexis Sellier db3568db2f
Update `sqlite` dependency to 0.30.3
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-07 15:41:56 +01:00
Alexis Sellier e63f334890
cli: Replace `trycmd` with our own test runner
This will allow us to run commands other than `rad`
and to have tests that switch between different users.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-06 10:01:38 +01:00
Alexis Sellier f9c81ab382
Replace `quickcheck` with `qcheck`
The latter is a fork of the former, which adds const generics
and a bunch of other quality of life improvements that aren't
in the original crate due to it being unmaintained.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-04 20:40:54 +01:00
Alexis Sellier e8a2432f9d
Move `Change` from `radicle-crdt` to `radicle`
Where it belongs.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-02 14:21:50 +01:00
Alexis Sellier b3faba715b
patch: Correctly merge review edits
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-01 12:05:44 +01:00
Alexis Sellier 0dc34dc15d
Implement patches with radicle CRDTs
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-01 12:05:44 +01:00
Alexis Sellier be789a487f
Move `hash` module to `radicle-crypto`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-01 12:05:44 +01: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 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
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 681a8c9374
Test CRDT storage, simplify `Thread`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 35f061746c
Add `radicle-crdt` crate
Explorations with CRDTs.
2022-11-23 19:52:18 +01: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
Dr Maxim Orlovsky 3ec460056d
Add cyphernet dependency 2022-11-22 10:34:49 +01:00
Dr Maxim Orlovsky 2a6f3c4f55
Update ed25519-compact dependency 2022-11-21 16:07:43 +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
xphoniex 89bdf59e8e
Add `rad-issue` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-16 16:28:31 +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 12988da089
Add `Patch`, `Issue`, `Label` COBs
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
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
Fintan Halpenny cb2d83daae
radicle: wire up radicle-cob
To wire up radicle-cob, it is necessary to implement the traits for
the following types:
* `Repository`: `change::Storage`, `object::Storage`, and `Store`
* `project::Identity`: `identity::Identity`

For `Repository`, the `change::Storage` implementation is trivial, as
it uses the underlying `git2::Repository` implementation. Then
`object::Storage` simply defines the required references names and
does lookups or updates.

The aforementioned reference naming scheme is:

  refs/namespaces/<ns>/refs/cobs/<typename>/<object_id>

For `project::Identity`, the `identity::Identity` implementation is
straight-forward.

To finalise the work, a simplified API is exposed as `radicle::cob`
where the `create`, `update`, `get`, and `list` functions are
redefined in terms of `radicle` specific types.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-08 18:13:54 +00:00
Alexis Sellier 609d05fff2
Update `sqlite` dependency
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-08 09:39:23 +01:00
Alexis Sellier 32cd94dd23
Add `rad-init` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-07 22:01:49 +01:00
Alexis Sellier 223d36086e
Add `radicle-cli` crate's `terminal` module
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
Co-authored-by: xphoniex <dj.2dixx@gmail.com>
2022-11-07 14:48:01 +01:00
Fintan Halpenny f3c4a53e1e
radicle-cob: port collaborative objects
This is a minimal port of the collaborative objects code from
radicle-link[0].

A `CollaborativeObject` is made up of a `History` of `Change`s that
are expected to be stored in a `git` backend.

The library exposes a CRU series of functions `create`, `get`, `list`,
and `update`.

This implementation differs, to previous one, in that it does not
assume any kind of identity system -- its only assumption is that
identities have an identifier and can be addressed in the `git`
database. This means that it does not require an `author` to be passed
in and it only uses the `resource` (previously `authorizing_identity`)
to store its content-address in the `Change`.

It also foregoes any caching to simplify the port and not make any
early optimisation assumptions.

[0]: https://github.com/radicle-dev/radicle-link/tree/master/cob

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-11-04 16:11:18 +00:00
Alexis Sellier 6e8e1e0972
Zeroize secret key in signer
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-03 16:49:29 +01:00
Slack Coder c7706156c6
node: fix test dependency error
Enable Radicle Crypto's test feature.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-11-03 16:02:50 +01:00
Alexis Sellier 5494490c40
crypto: implement an OpenSSH keystore
This will become the primary keystore.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-02 14:11:07 +01:00
Alexis Sellier 6f3a598cc1
Remove `git-url` dependency
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-31 18:14:54 +01:00
Alexis Sellier 7b7e83fbc7
node: implement node announcement sybil resistance
We implement a small proof-of-work on the node announcement message
to prevent the routing table from being filled by fake entries.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-31 18:13:14 +01:00
Fintan Halpenny c0b0d29e19
radicle-crypto: split out from radicle
The crypto types are useful to use in other components that are
separate from the radicle crate, e.g. the incoming radicle-cobs
crate.

Separate out the types into a radicle-crypto crate. This crate defines
the usual PublicKey, SecretKey, and Signature types. It also provides
the ssh functionality, under the `ssh` feature. It is also necessary
to provide the `From` impl for `Component` here, which again is
guarded by the `git-ref-format` feature.

The `Arbitrary` implementation are moved. The arbitrary decision of
redefining `ByteArray` in both radicle-crypto and radicle was made.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-10-27 20:40:39 +01:00
Alexis Sellier 2f6cf9c7a5
httpd: implement `git` fetch-only server
Introduces a new `radicle-httpd` crate which will serve as the basis
for heartwood's HTTP backend.

The first part of this is a git server which allows projects to be
fetched from storage using plain `git`.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-19 11:36:16 +02:00
Alexis Sellier a2fc976ed6
remote-helper: Initialize
Implement a `git-remote-rad` helper for `rad://` remotes.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-17 16:23:16 +02:00
Fintan Halpenny a56d9008e6
radicle: depend on radicle-git published crates
The `git-ref-format`[0] and `radicle-git-ext`[1] crates are now
published to crates.io.

Switch the dependency to rely on them. This also required to update
the `git2` dependency to `0.15.0` as well as using the
`vendored-libgit2` feature -- avoiding the openssl dependency too.

[0]: https://crates.io/crates/git-ref-format
[1]: https://crates.io/crates/radicle-git-ext

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-10-14 13:16:11 +02:00
Alexis Sellier a06ed9f6de
Statically link sqlite3 2022-10-12 13:27:45 +02:00
Fintan Halpenny df15b497ab
radicle: namespace peers
The previous iteration of the storage layout for projects organised
peer's subtrees by the `refs/remotes` category. This layout leads to
problems when linking a working copy to the storage project. The fetch
refspec would look something like:

  fetch = +refs/remotes/abc/heads/*:refs/remotes/rad/*

This works perfectly fine when running:

  git fetch rad

but will fail when one tries to specify:

  git fetch rad main

Instead, the command would need to be:

  git fetch remotes/abc/heads/main

This patch proposes to move the use of `refs/namespaces` for each
peer. The layout looks similar in that each peer has a subtree, but
instead it is under `refs/namespaces/<peer>/refs/...`.

The previous refspec would look more familiar in its new form:

  fetch = +refs/heads/*:refs/remotes/rad/*

With this in place running:

  git --namespace=abc rad main

Will work as expected and place the reference under
`refs/remotes/rad/main`. Similary, `git --namespace=abc push` will
work as expected.

Another benefit of this approach is that the use of namespacing means
that a tag is pushed it will be placed under the respective namespace
rather than in the global `refs/tags` category.

The actual implementation needed to work around the fact that
`git2`/`libgit2` does not have any options for fetching or pushing
using namespaces. The working copy code uses processes to shell out to
`git` for namespacing needs.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-10-12 12:30:05 +02:00
Alexis Sellier b8c2ab5316
Switch to a lighter sqlite dependency
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-08 12:13:59 +02:00
Alexis Sellier 85ac8a1d4d
Implement routing table persistence
Uses SQLite for persistence.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-05 12:13:12 +02:00
Alexis Sellier 2acd999c16
Add SSH functionality with new `radicle-ssh`
We borrow code from `thrussh`, refactored to be runtime-less.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-03 10:34:59 +02:00
Slack Coder f9ad3ac155 git: Use RefString types for git::refs
Lean on rust's type system to improve safety.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-09-28 16:11:03 -05:00
Alexis Sellier 1da38708fc
Flesh out custom git transport
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-09-28 13:36:57 +02:00
Alexis Sellier 8605946703
node: Add CLI options 2022-09-26 11:25:20 +02:00
Alexis Sellier a3bf5ab7c3
Initialize `radicle-tools` crate
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-09-23 17:33:31 +02:00
Alexis Sellier 46501507be
Split repository into two creates
* `radicle`: core library
* `radicle-node`: node

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-09-21 15:11:17 +02:00
Alexis Sellier 518e625d55
node: Move to new ed25519 crate
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-09-21 10:01:36 +02:00
Alexis Sellier de8dcc5022
node: Start implementing gossip subscriptions
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-09-13 11:58:02 +02:00
Alexis Sellier a47463a664
node: Test fetch comes from right place
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2022-09-13 10:16:05 +02:00
Alexis Sellier c4c0e0413f
node: Start implementing fetch control
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2022-09-13 10:16:05 +02:00
Alexis Sellier 789c50ee35
Minimal radicle node implementation
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2022-09-13 10:16:03 +02:00
Alexis Sellier bad4dcf11e
Initial commit 2022-09-13 10:13:13 +02:00