Commit Graph

192 Commits

Author SHA1 Message Date
cloudhead 2d241e5f7d
Update `radicle-crypto` crate to 0.11.0 2024-08-28 13:01:35 +02:00
cloudhead c112f3fbc9
Update `radicle-cob` crate to 0.12.0 2024-08-28 12:55:30 +02:00
Sebastian Martinez beac367056
Update `radicle-surf` to 0.22.0 2024-08-20 16:35:04 +02:00
Fintan Halpenny e1470fccd7
fetch: update gix-pack and gix-odb
The `gix-fs` crate was flagged as vulnerable[^0]. To update it to `>=0.11.0`, it
was necessary to update the `gix-pack` and `gix-odb` crate versions to `0.51`
and `0.61`, respectively.

This in turn updated `fastrand` which changed its algorithm[^1], which meant
that some test outputs were reordered or matched new values.

[0]: https://rustsec.org/advisories/RUSTSEC-2024-0350
[1]: https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md#version-210
2024-08-09 12:41:01 +02:00
Lorenz Leutgeb 723e2741f5
node: Socket Activation with systemd 2024-07-22 10:44:22 +02:00
cloudhead 123f7eb6bb
Update `radicle` crate to 0.12.0 2024-07-18 16:22:14 +02:00
cloudhead 27eff8095d
node: Don't depend on `gix` directly
This avoids pulling in the same dependency twice.
2024-07-16 15:57:27 +02:00
Alexis Sellier e56a70b0d3
node: Update `io-reactor` dependency
The previous version contained a bug which caused disconnections
to not be forwarded to the service.
2024-07-06 11:12:13 +02:00
cloudhead 92c9e21873
Bump `radicle` crate to 0.11.1 2024-06-26 14:49:10 +02:00
cloudhead a4989b7ce7
Remove `radicle-httpd` crate
The HTTP daemon is moved to the `radicle-explorer` repository. Hence,
all traces of it are removed from this repository.
2024-06-06 11:14:00 +02:00
cloudhead ab532be033
Bump crate versions
We bump the versions of the crates required to publish a new version of
`radicle-httpd` in preparation of moving it out of the repo.
2024-06-05 16:51:55 +02:00
cloudhead a85e7f7442
node: Set TCP_KEEPALIVE on sockets
Ensures dead connections are not kept around longer than necessary.
Note that the ping/pong mechanism is more expensive and checks that the
session is active and healthy, while TCP_KEEPALIVE is lower level,
cheaper, and checks that the connection is still alive.
2024-05-22 14:46:08 +02:00
Lorenz Leutgeb a4e10f0344
fetch: upgrade gix crates
Upgrade the family of `gix` crates and resolve any breaking API changes.

Fixes RUSTEC-2024-0335[[0]].

[0]: https://rustsec.org/advisories/RUSTSEC-2024-0335.html

Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-05-17 13:27:18 +02:00
Fintan Halpenny c8a24d5584
node: report upload-pack progress
Emit the `UploadPack` events from the `upload_pack` method.

A wrapper type, `Reporter`, is introduced for implementing a `Write` instance
that will parse the given bytes as `gix_protocol::RemoteProgress`, if possible,
and emit it via the `Emitter`, and then write the bytes to the underlying
writer. This allows any subscribers to see the progress of an upload-pack, i.e.
`Compressing objects`, `Counting object`, `Enumerating objects`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-05-15 10:07:56 +01:00
Dr Maxim Orlovsky a3cce22f7a
node: Patch dependencies for Tor/socks5 support 2024-05-06 22:19:36 +02:00
cloudhead 40f4383bbc
term: Implement content-aware pager
This is a pager (like `less`) that takes an `Element`, and dynamically
re-renders the element when the terminal size changes. This ensures that
the content is always properly wrapped and rendered.
2024-05-03 14:31:05 +02:00
cloudhead 2801403182
signals: Move signal handling to its own crate
We're going to share this code with `radicle-term`.
2024-05-03 14:30:51 +02:00
cloudhead e5df616ead
node: Protect against non-monotonic clocks
Many (most?) system clocks are not monotonic, and even though we're
getting a `LocalTime`, which *is* monotonic when using `now()`, it is
constructed from a `SystemTime` which isn't.
2024-04-30 10:56:37 +02:00
Sebastian Martinez 7fc3b73e88
Update radicle-surf to 0.21 2024-04-24 11:51:25 +02:00
cloudhead c07522365a
cargo: Run `cargo update` on workspace 2024-04-23 17:43:21 +02:00
cloudhead f17df88229
term: Update `inquire` crate 2024-04-15 17:12:36 +02:00
cloudhead a5212a7a88
term: Fix editor command with args
We add support for `EDITOR` being set to a command with arguments, eg.
`code --wait`.

Fixes dd6861f.
2024-04-04 10:52:36 +02:00
cloudhead 9cdf0aa1fd
Update radicle crates to 0.9.0 2024-03-26 11:56:27 +01:00
cloudhead f1f1313b6d
node: Update `netservices` to 0.8.0
The previous version was relying on a broken method from `socket2` that
switched non-blocking sockets to blocking.
2024-03-21 12:40:58 +01:00
Sebastian Martinez bdd1b238fc
Bump `radicle-surf` to 0.19.0 2024-03-11 12:27:27 +01:00
cloudhead b0fbbeed6b
node: Upgrade dependencies
Fixes issue with improperly closed connections.
2024-02-26 11:47:03 +01:00
cloudhead e12bff0871
cli: Update and remove some dependencies 2024-02-02 09:57:45 +01:00
cloudhead ebdaf0edd9
General dependency update
Left out some of the `gix-*` dependencies to be done separately after
review.
2024-01-18 13:30:26 +01:00
cloudhead ccc675b304
cli: Have a way of enabling logging in helper
Log to stderr if RUST_LOG is enabled in the remote helper.
2024-01-17 17:34:30 +01:00
cloudhead 045b3e7175
node: Increase process ulimit on start
Users have been having issues with the process soft file limit.
We set that to a reasonably high value to avoid problems.
2024-01-17 17:34:25 +01:00
cloudhead 25ca4c8b92
node: Upgrade `netservices` and `io-reactor`
There was an issue with the old version due to the use of `RawFd` as
peer IDs, since they are not unique for the lifetime of a process.

With this change, we use the new `ResourceId` type, though these are not
immediately available, as they are generated when the resource is
registered.
2024-01-11 12:03:53 +01:00
Sebastian Martinez 5331cf3bcf
radicle: Move `DataUri` to `common::DataUri` 2023-12-22 15:09:20 +01:00
Fintan Halpenny 47a440a384
radicle: expose shared logger
To be able to use log setup across the different components of
heartwood, expose a `logger` module from `radicle`. This also includes
a `test` logger.

These modules are guarded behind a `logger` feature flag, so that
other crates are not bringing any uneeded dependencies.

This allows logging to be setup in `radicle-cli-test` so that when a
test fails, the log output is present for debugging purposes.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-12-20 15:11:10 +01:00
Thomas Scholtes 48dedc6e7e
`rad-web` runs HTTP API and connects web app
Instead of `rad-web` just creating a session for an already running HTTP
API the command now starts the HTTP API, creates a session and opens the
authentication link.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-12-19 13:14:07 +01:00
Sebastian Martinez bdcaa60474
httpd: Update axum and hyper dependency 2023-12-15 12:08:43 +01:00
Fintan Halpenny f4dc224b3a
crypto: update ssh-key
There are two vulnerabilities that were due to `ssh-key`'s
dependencies[[0]][[1]].

Updating to ssh-key-0.6.3 removes the vulnerability[[0]], however,
there is no existing patch for [[1]] but it is being worked on.

[0]: https://rustsec.org/advisories/RUSTSEC-2022-0093
[1]: https://rustsec.org/advisories/RUSTSEC-2023-0071

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-12-14 16:13:29 +00:00
Fintan Halpenny 924a2624a4
git: update git2-0.18.1
Update to git2-0.18.1, which also requires updating radicle-git-ext
and radicle-surf.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-12-04 11:11:36 +00:00
cloudhead ad7a3addb6
cli: Add `rad config` command
Displays the current configuration.

Also move to our tree-sitter highlighter for pretty-printing JSON and
remove the `json-color` dependency.
2023-11-30 10:46:32 +01:00
Sebastian Martinez 8277559ee0
Update radicle-surf to 0.17.1 2023-11-24 13:42:30 +01:00
Thomas Scholtes 3ccb6a5fac
Move `rad-web` binary to `radicle-httpd` package
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-11-22 11:27:11 +01:00
cloudhead 40303cd8e1
term: Fix unicode display width hack
We were skipping certain glyphs due to the width calculation being
wrong. This fixes it, and we're able to display emojis correctly inside
tables now.
2023-11-17 15:05:39 +01:00
Sebastian Thiel 20a521179c
fetch: update `gix` dependencies to the latest version
Signed-off-by: Sebastian Thiel <sebastian.thiel@icloud.com>
2023-11-17 12:24:10 +01:00
cloudhead 39f65e1b29
Update `netservices` and `cyphernet` dependencies 2023-11-17 12:23:47 +01:00
cloudhead f0754330c9
Update `sqlite` dependency to 0.32.0 2023-11-08 15:08:01 +01:00
Fintan Halpenny ea7f26dbdf
radicle: wire up radicle-fetch
Wire up the `radicle-fetch` crate to the fetch logic in the
`radicle-node` worker.

Any required traits for storage, identity, tracking, and transport
used by `radicle-fetch`.

The worker adds a new module to run the `git upload-pack` process and
pipes the `stdout`/`stdin` to the respective channels.

The `Worker` type required adding a `FetchConfig` to easily allow the
configuration of fetches and passing the signer and tracking store
location through to the fetch `Handle`.

The channels code is adapted to have a new writer that always flushes
when a call to `write_all` is made. This is necessary since the
Gitoxide code never calls `flush`, and so it will hang since no data
is sent until `flush` is called.

Since `UserInfo` is used to set up a newly cloned repository, this
changed some of the SHA1 hashes output in the CLI test examples. It
was also necessary to update the CLI's clone code to be deterministic
in its output for tests.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-11-06 12:06:13 +01:00
Fintan Halpenny 981172aa4f
radicle-fetch
The `radicle-fetch` crate introduces a method for fetching from a
server using Git protocol V2, which provides the implementation
control over performing a sequence of fetches and validation over
domain data.

The protocol is built on top of the suite of Gitoxide crates[[0]]. It
builds wrappers on top of Gitoxide's refdb, odb, and transport layers
-- as well as taking the ls-refs and fetch code straight from the code
base to simplify for the needs of this crate.

[0]: https://github.com/Byron/gitoxide

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-11-06 12:06:13 +01:00
cloudhead 84a95848b0
cli: Add pager to `rad diff`
Invokes a pager when the output doesn't fit on the screen.
2023-11-03 14:20:16 +01:00
cloudhead 1d167581f2
cob: Introduce `xyz.radicle.id` COB
Introduces a new COB type to store repository identity documents.

The reason for this change is to:

1. Simplify the code, as the identity document logic resembled a COB,
   yet it had custom logic. This allows existing COB code to be used for
   identities.
2. Make identity document update logic more flexible, since COB actions
   can be added in the future.
3. Re-purpose existing tools around COBs to work on identities, eg. `rad
   cob`.
4. Unify the concept of an identity change proposal, with regular identity
   changes. This means we can remove the `id.proposal` COB in favor of
   using the `id` COB itself.

Notes
-----

* Each repository has one Identity COB.
* The `Proposal` COB has been repurposed into the `Identity` COB.
* Identity documents are stored as *embeds* inside the Identity COB
  actions.
* The action that contains new document versions is called `revision`,
  just like the Patches COB.
* The namespaced `rad/id` ref is a symbolic reference to that Identity
  COB.
* The canonical `rad/id` ref is a direct reference to the commit in the
  Identity COB that contains the latest *accepted* revision of the
  document.
* All commands for managing identities have been folded into `rad id`.
  Hence `rad delegate` and `rad edit` are removed.
* The concept of "rebasing" an identity document is gone.
* The `rad id` output has been updated to match the style of other
  commands.
* When a revision has enough signatures, it is automatically adopted as
  the current identity, there is no longer the need for a "commit"
  action.
* When an identity revision is proposed, and the current identity has a
  threshold of `1`, that identity is automatically accepted due to the
  above point.
* The idea of "verifying a peer's identity branch" no longer applies, as
  COBs cannot be verified one history at a time.
* Since the root commit of the Identity COB does not have a "Resource"
  to point to (it would have to point to itself, which is impossible),
  we've made the resource id optional for COBs.
2023-10-12 17:32:33 +02:00
Sebastian Martinez 504a198cec
Update `radicle-surf` to v0.17
This commit introduces the `FileStats` struct, that adds the insertions
and deletions for each file to `DiffContent`.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-11 14:29:34 +02:00
cloudhead 154566f8ef
cli: Update to `radicle-surf` 0.16 2023-09-27 15:54:16 +02:00