Commit Graph

2744 Commits

Author SHA1 Message Date
Lorenz Leutgeb e831aeb57b cli-test: Do not store `bins` 2026-02-16 08:39:55 +00:00
Lorenz Leutgeb 8fbdd46ce4 cli-test: Cheat to find coreutils on Windows 2026-02-16 08:39:55 +00:00
Lorenz Leutgeb 4894657bcb cli-test: Simplify cargo path handling 2026-02-16 08:39:55 +00:00
Lorenz Leutgeb 25d1974c60 cli-test: Deduplicate populating `bins` 2026-02-16 08:39:55 +00:00
Lorenz Leutgeb 44f52f4c18 cli-test: Fix uses of `PATH_SEPARATOR`
Some occurrences of ":" literals were missed earlier.
2026-02-16 08:39:55 +00:00
Lorenz Leutgeb dd122f10cf cli/test: Ignore `rad_diff` on Windows
The command is deprecated already.
2026-02-16 08:37:20 +00:00
Lorenz Leutgeb 5974fa32d0 windows: Add installer build
For distribution of Radicle on Windows machines, Windows Installer
provides a well-known solution, that comes built in to the operating
system. It also integrates with the Windows package manager WinGet.

Provide an initial version of an `*.msi` build, and integrate it into
GitHub actions to allow downloads via build artifacts.
2026-02-16 08:33:58 +00:00
Fintan Halpenny c06b00e330 CVE-2026-25727
Report: <https://www.cve.org/CVERecord?id=CVE-2026-25727>

The `time` crate was a transitivie dependency of `human-panic`.
Updating `human-panic` to 2.0.6 removes the `plist`, and in turn,
`time` dependencies.
2026-02-13 19:08:26 +01:00
Fintan Halpenny 31607cf7ad CVE-2026-25541
Report: <https://www.cve.org/CVERecord?id=CVE-2026-25541>

This vulnerability was introduced via the `bytes` crate.

Update to 1.11.1, as recommended.
2026-02-13 19:07:39 +01:00
Fintan Halpenny 2d0db3c6b2 CVE-2025-58160
Report: <https://www.cve.org/CVERecord?id=CVE-2025-58160>

This vulnerability was introduced via the `test-log` crate.

Updating to `0.2.19` in turn updates `tracing-subscriber` to `0.3.22`
which is in the acceptable upgrade range.
2026-02-13 17:26:50 +00:00
Lorenz Leutgeb 03bbe52417 signals: Add support for Windows 2026-02-13 15:38:02 +00:00
Lorenz Leutgeb 865abd35e2
protocol/fetcher: Intro `RefsToFetch`
Using empty `Vec`s to mean "all refs" can be confusing. Avoid the chance
of confusion by introduction of a new type that clearly describes which
refs should be fetched.
2026-02-13 15:27:21 +01:00
Lorenz Leutgeb 9081c11b98
protocol/fetcher: Remove `from` from `QueuedFetch` 2026-02-13 15:25:42 +01:00
Lorenz Leutgeb 53a1286901
protocol/service: Remove unnecessary arg 2026-02-13 15:25:42 +01:00
Lorenz Leutgeb 94d7799ffe
protocol/fetcher/state: Typo 2026-02-13 15:25:42 +01:00
Lorenz Leutgeb 56ee626a51
protocol/fetcher: Delete unused file 2026-02-13 15:25:42 +01:00
Fintan Halpenny 41f77a495b RELEASE: start at rc.1 2026-02-13 13:34:11 +01:00
Fintan Halpenny 613c4e83e0 protocol: separate subscribers by RefsAt
It was found that if a fetch was started for a specific `Vec<RefsAt>`
and a following general, i.e. empty, `Vec<RefsAt>` was queued, the
subscriber for the general one would be removed when the specific
fetch completed.

This behaviour is undesirable, since the general fetch could
potentially fetch more data.

To prevent this from happening, the `Vec<RefsAt>` is added to the
`FetchKey`, so that `subscribers` are matched with the set of
references they want to hear results for.

A test was added for the above scenario.
2026-02-13 12:49:37 +01:00
Fintan Halpenny 993428df56 node: donwgrade log error to trace for disconnection
This is would be a very noisy error since disconnections should be
expected to happen frequently for nodes.

Downgrade the log level to trace.
2026-02-12 14:35:13 +00:00
Fintan Halpenny aeba81f4d9 core: add documentation to `RepoId::from_canonical` 2026-02-12 13:52:28 +01:00
Fintan Halpenny 35a01898e6 core: guard on expected multibase
When decoding an input string for a `RepoId`, the base was never checked.
This change ensures that the base is checked and will error otherwise.

To allow for future base codes, the change introduces a sanctioned set
of base codes, which only contains `Base58Btc` for now.

Tests are added to ensure that parsing is correct and includes a valid
multibase code 'Z', which is not the expected 'z'.
2026-02-12 13:52:28 +01:00
Fintan Halpenny 8ee32168b3 radicle: remove file
The `mod id` statement was removed, but the file was not removed.
Remove the file since it is no longer needed.
2026-02-12 13:52:28 +01:00
Lorenz Leutgeb ebf7d876b4
node: Control via `uds_windows` not `winpipe`
Recent versions of Windows support Unix Domain Sockets natively, see
<https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/>.

By using that feature instead of Windows named pipes, the difference
for handling communication via the control socket comparing Unix-like
systems and Windows becomes smaller:

 1. No special paths like `\.\pipe\…` have to be handled.
 2. Not two I/O mechanisms are abstracted (named pipe and UDS) but
    just one.
 3. `winpipe` relies on background threads while `uds_windows` does
    not.

Once the feature `windows_unix_domain_sockets` (which is tracked at
https://github.com/rust-lang/rust/issues/150487) stabilizes, it will
likely be possible to just drop the dependency `uds_windows` and use
the implementation in `std::os::windows::net` directly.
2026-02-12 10:18:48 +01:00
Lorenz Leutgeb 90cf37c471
node: On Windows, use job for upload-pack child
Reports of zombie (grand)child processes were received. By associating
the `git upload-pack` process with a job, zombies are prevented.
2026-02-11 16:37:56 +01:00
Lorenz Leutgeb 990edbf055
windows: Introduce new crate
node: Use new windows crate to terminate job
2026-02-11 16:37:56 +01:00
Lorenz Leutgeb 50fb228ae4
term/editor: Implement `exists` for Windows
The paths checked by `fn exists` are well-known Unix locations, and not
meaningful to check on Windows.

Provide an implementation of `fn exists` for Windows, which uses
`which.exe` to look for binaries, and use that to provide sane defaults
for Windows.
2026-02-11 10:26:22 +01:00
Lorenz Leutgeb 450b664ad8
term/editor: Use `cfg`-attribute instead of macro
This might result in smaller binaries and is just as readable.
2026-02-11 10:26:22 +01:00
Lorenz Leutgeb 8fb2d96b5c
radicle/profile: No pager from Git on Windows
Git for Windows horribly mangles the configured binaries through a POSIX
`sh`-like environment even on Windows. We might be able to figure out
which `sh.exe` we would have to execute on Windows, but this is too
brittle. Windows users will have to use other mechanisms (like `$EDITOR`
and `$PAGER`) to configure their programs.
2026-02-11 10:26:22 +01:00
Lorenz Leutgeb 930ec175f1
term, cli: `winsplit` over `shlex` on Windows
Command line parsing differs on Windows vs. POSIX compliant operating
systems (just consider the differences in handling `\` for paths vs. as
a marker for escape sequences). Thus, on Windows use `winsplit` to
split command arguments instead of `shlex` for Unix-like OSes.

`winsplit` is a small crate with no other dependencies.
2026-02-11 10:26:22 +01:00
Aaron Würth 537eaba8d1 Use rust-analyzer from tool chain in devShell
The devShell now uses rust-analyzer from the tool chain. Previously,
using the nixpkgs rust-analyzer (from an older rust version) led to
inaccurate results.
2026-02-10 11:06:05 +00:00
srestegosaurio d7a4137e23 systemd: remove redundant lines from system unit
A section of this file got duplicated the last time it was edited.

Signed-off-by: srestegosaurio <lcdt@disroot.org>
2026-02-10 11:06:05 +00:00
Lorenz Leutgeb 27ee6e1038 ci: Enable debugging on Windows 2026-02-10 11:06:05 +00:00
Lorenz Leutgeb fefa28372d cli/init: Canonicalize path before comparison
On Windows, this comparison would fail otherwise.
2026-02-10 10:00:16 +00:00
Lorenz Leutgeb ffbbb374c1 cli-test: Path separation compatible with Windows
Running tests on Windows requires separating the path to executables by
`;`.
2026-02-10 09:55:46 +00:00
Lorenz Leutgeb faeee9f370 crypto: Optionally provide JSON Schema
Providing the schema in `radicle-crypto` saves a lot of repetition
in `radicle`, and can be done via an optional dependency.
2026-02-10 09:39:34 +00:00
Fintan Halpenny 82ad52b169 cob: further restrict TypeName
Domain Names have restrictions on their total length, and the length
of individual labels[^0].

Since `TypeName`s are expected to be reverse domain name strings, the
total length of the internal string should not exceed 255 and each
component should not exceed 63.

[^0]: https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4
2026-02-09 10:09:12 +01:00
Fintan Halpenny fe09cd4a00 cob: split up typename tests
The test name being used is `valid_typenames`, however it tests for
invalid `TypeName`s as well.

The invalid `TypeName` tests are now separated into another test
called `invalid_typenames`.
2026-02-09 10:08:30 +01:00
Fintan Halpenny 204db22bbe cob: enable sha1 feature
Enable the sha1 feature by default for `radicle-oid`.

Without this, the crate cannot be tested in isolation. It results in a
compile error, requiring the feature to be enabled.
2026-02-09 10:08:30 +01:00
Fintan Halpenny 1cab036c33 protocol/service: Wire up `FetcherService`
Wire up the new `FetcherService`. This reduces the `Service` fetch
methods down to:
- `fetch`
- `fetched`
- `dequeue_fetches`
- `fetch_refs_at`

This simplifies the code by off-loading the logic to the `fetcher`
family of types, rather than handling the intricacies in the `Service`
itself.

The `Service` now just performs the necessary I/O based on the
returned events from the `fetcher`.

This also removes the fetching state from the node sessions. This
follows the single responsibility, and sessions now only care about
their connectivity.

Breaking changes:
- The `Connected` state of a peer no longer contains fetching
  information, which was being returned as part of the JSON payload
  result.
- The `rad debug` information for ongoing fetches contained the number
  listeners awaiting for results, this was removed.
2026-02-05 20:04:28 +01:00
Fintan Halpenny 9e20890965 protocol: Introduce `FetcherService`
The `FetcherService` wraps the `FetcherState` alongside keeping track
of subscribers for a given fetch.

Typically, this is a channel for which the fetch result should be sent
to.

These subscribers are coalesced by maintaing a map from `(rid, node)`
pairs to the subscriber.

This continues the sans-IO approach where the type of subscribers are
not specified, but rather are kept as a type parameter – to be
specified by the caller.
2026-02-05 20:04:28 +01:00
Fintan Halpenny f0e3ca3403 protocol: Introduce `FetcherState`
This patch introduces the `FetcherState` which encapsulates the logic
and state for keeping track of fetches.

It uses a sans-IO approach, where the state of fetches transition
based on the current state and provided input.

Callers can then decide to perform I/O based on the returned event.
2026-02-05 20:04:28 +01:00
Fintan Halpenny 7cf73300f6 radicle/storage/refs: Derive `Hash` for `RefsAt` 2026-02-05 20:04:28 +01:00
Fintan Halpenny eccfd6baf3 cli: optional message for issue comments
The `From<String> for Message` implementation has an interesting
interaction between `clap` and how `Message` can be used from the
command line.

Note that `FromStr` is not implemented for `Message` – which usually
what is to be expected for use with `clap`, but in fact, `clap` also
allows `From<String>`.

This would make `Message` be a required option when using `rad issue comment`.

It is not possible to use `default_value_t` because that required an
implementation of `Display`, which in this case we do not want to
implement. Trying to use `default_value = "Message::Edit"` also would
not work – it uses that as the text.

So, the solution is to mark it as optional, and default to
`Message::Edit` when it is not specified.
2026-02-05 19:58:46 +01:00
Fintan Halpenny c33c26fa78 cli: fix casing for warning of preferred_seeds
While the field name will `preferred_seeds` in Rust, the casing for
the JSON file is `preferredSeeds`.
2026-01-28 10:17:36 +00:00
Fintan Halpenny 15adb16135 protocol: missed formatting
Formatting was missed in the `service.rs` file.
2026-01-28 10:16:50 +00:00
Fintan Halpenny 91eb6fc078 protocol: ensure `connect` supports connecting address
Be more defensive by preventing a node, that is not configured for
Tor, to not connect to `.onion` addresses via the `Service::connect`
method.

This means that an `Outbox::connect` should not be produced, and the
address table should not insert an entry.
2026-01-26 18:55:35 +01:00
Fintan Halpenny 36d5a4c8b0 protocol: use helper method
Use the `is_persistent` helper method rather than repeating the
`is_some` check.
2026-01-26 18:55:35 +01:00
Fintan Halpenny 73f9a35033 protocol: reuse session address for reconnect
When maintaining persistent connections, the config was consulted for
a peer address. Multiple addresses for a single `NodeId` can be
listed. This can result in a different address being used for
reconnecting if the `HashSet` returns in a different order.

The original address that was used for connection is in the `Session`,
so this should be used instead.
2026-01-26 18:55:35 +01:00
Defelo 589925e3a3 radicle/node: avoid unnecessary allocations in `Emitter::emit_all` 2026-01-26 17:40:02 +00:00
Defelo 8b1d475170 protocol: batch inventory removals and events in `sync_routing`
The previous implementation would remove routing entries one at a
time.
Improve the performance of this by batching the removal and events
emission.
2026-01-26 17:38:53 +00:00