Commit Graph
1670 Commits
Author SHA1 Message Date
cloudhead 98c94de5e3 Various small improvements across crates
Most of these changes should be self-explanatory.

* Atomic fetch was no longer used
* The default policy when initializing should be 'all', as it is with
  `rad init`.
2024-02-06 10:37:44 +01:00
cloudhead bb06663d1c cli: Organize patch functions better
Move patch showing and timeline to a shared library so we can use it for
`rad inbox`.
2024-02-06 10:36:22 +01:00
cloudhead 8928c5ee26 cli: Fix node file rotation with rad node start
This was causing issues (error 22) on macOS and some Linux systems.
2024-02-05 16:26:55 +01:00
Lars Wirzenius 5abd7bf55a cli: fix formatting of warning of unconnected node
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-05 12:53:36 +01:00
cloudhead e12bff0871 cli: Update and remove some dependencies 2024-02-02 09:57:45 +01:00
Sebastian Martinez e799a7ccba httpd: Add --path param to rad-web
This passes a `path` variable to the `auth_url` so consumers can open
desired pages directly.
Also checks the cwd to start rad web with a path corresponding to it.
2024-02-01 17:33:21 +01:00
Sebastian Martinez 29cb5c085d httpd: Add /nodes/:nid and /nodes/:nid/inventory endpoints to get info on other nodes 2024-02-01 17:29:10 +01:00
Sebastian Martinez db6cb55d6c httpd: Add review ids to review json 2024-02-01 17:25:18 +01:00
cloudhead 0a3da17fad cli: Add --seeds option to ls
Small addition that is useful.
2024-01-31 17:24:59 +01:00
cloudhead 71bba29c9a cli: Add log rotation to node start
Very simple log rotation with two files.
2024-01-31 14:23:43 +01:00
cloudhead 1ece339eac cli: Hint to install ssh-agent 2024-01-31 14:07:28 +01:00
cloudhead 4e9e438f41 cli: Don't error if ssh-agent isn't running 2024-01-31 13:54:39 +01:00
cloudhead 15d1709831 node: Ensure dequeued fetches are correct
Dequeued fetches were always fetching all refs, instead of fetching the
specific refs that were initially requested. We fix that by storing the
refs to fetch in the fetch queue.
2024-01-31 13:40:13 +01:00
cloudhead f38d2b2ef8 Prevent multiple events per synced peer
We were not properly guarding against the fact that we could receive
multiple sync events from the same node. Normally though, this wouldn't
happen, as further announcements would be stale.
2024-01-31 13:40:13 +01:00
cloudhead 159944f7b5 node: Small log line correction 2024-01-31 13:40:13 +01:00
cloudhead b5b9a55306 cli: Add --path option to rad node start
Useful for debugging and running nodes from different locations.
2024-01-31 13:40:13 +01:00
Sebastian Martinez 921f9f2d76 cli: Display rad-web in rad --help
Only show `rad-web` in help, if we are able to run the binary.
2024-01-31 13:30:40 +01:00
cloudhead 1af505c5c3 Create databases on profile init
Ensures that the databases exist for commands like `rad ls`, even
before the node is started for the first time.
2024-01-31 13:16:09 +01:00
Sebastian Martinez 5333f8217a httpd: Add reactions to revisions, improve json for comment reactions
Instead of using tuples and lots of arrays, this commit tries to use
`BTreeMap`s to provide more context to review, issues, patch and other
comments.

Also the returned object by the httpd is more aligned with what is
needed by the consumer, so less recomputation is needed for display.
2024-01-31 12:14:05 +01:00
cloudhead 3560e0066d Fix preferred seeds configuration
When using `network: "test"`, we shouldn't default to any public seed
node. This change makes sure that the "preferredSeeds" configuration var
is only given a value when `network` is `main`.
2024-01-31 12:09:09 +01:00
cloudhead 8858cefc89 node: Make sure we properly disconnect outbounds
The previous change to the wire protocol introduced a bug: outbound
peers that failed to connect fully would not notify the service on
disconnect. This change fixes it.
2024-01-30 14:47:10 +01:00
cloudhead e58419a9b0 cli: Fix capitalization of "Radicle" 2024-01-29 11:30:30 +01:00
cloudhead 3ff1ddd5e3 cli: Improve rad config 2024-01-29 11:28:37 +01:00
cloudhead d7ca9ad3c0 cli: Fix help text in rad inspect 2024-01-29 11:22:48 +01:00
cloudhead b994c4a6ef cli: Rework rad sync
The command now works with both a replica target *and* a seeds target.
This is especially useful to eg. ensure that a preferred seed has been
synced, while still trying to hit a higher replica count.
2024-01-26 15:22:10 +01:00
cloudhead c13c658f4e cli: Add rad self --address command
Useful when running seed nodes.
2024-01-25 21:16:58 +01:00
cloudhead 131103cb53 Fix code around default policies
Make the code a little clearer and ensure that we are always calling the
`Config` and not the `Store`, so that we fallback on the default policy.
2024-01-25 21:11:08 +01:00
cloudhead 7a5e5ec865 httpd: Don't show unseeded repos 2024-01-25 16:31:28 +01:00
cloudhead aa9c6542ab node: Fixes to wire protocol logic
* Make sure we cleanup pending peer states when disconnecting before
  handshake.
* Make sure we don't panic if a peer disconnects before being fully
  connected.
2024-01-25 15:35:19 +01:00
Fintan Halpenny 49584f4e73 radicle: pinned repositories configuration
Introduce pinned repositories to the `profile::Config`, i.e.
`config.json`.

This is used for pinning repositories in the httpd `/projects` handle.

To allow returning all repositories, an `all` query parameter is also
included.

This is non-backwards compatible change, since we introduce the `show`
query parameter which, if not supplied, will default to `pinned`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-24 10:55:27 +01:00
cloudhead d722638905 systemd: Small improvements to unit files 2024-01-24 10:48:11 +01:00
cloudhead 47799cbab2 cob: Fix some clippy warnings 2024-01-23 15:50:37 +01:00
cloudhead ae981ded6e cli: Add rad stats command
Returns aggregate stats as JSON. Useful for tracking seed node metrics.
2024-01-23 15:50:32 +01:00
cloudhead a60afc8350 cli: Improve sync errors
In the case where we don't find any seeds, display a better error
message.

We also don't bail out on error, since the announcement step might still
be worth trying.
2024-01-22 21:23:13 +01:00
cloudhead 92d6fd4c7e cob: Re-introduce some of the ignored tests
This reverts commit d8f8d29605.
2024-01-22 21:20:01 +01:00
cloudhead eee304e0b7 cob: Expose operation concurrency
When evaluating a COB, expose to the `apply` function the operations
concurrent to the current one being applied. These are essentially
"related" nodes in the graph, that are neither ancestors or descendants.

This will let us for example have different failure modes depending on
whether there were conflicting operations, as well as expose conflicts
to the user.
2024-01-22 21:20:01 +01:00
cloudhead a46bcb2247 cob: Distinguish between commit parents
Previously, COB change commits would not distinguish between their
parents. This means that they would try to load source code commits
(eg. for patch COBs) and then fail since those commits wouldn't have a
manifest or `Rad-Resource`.

We introduce a backwards compatible change here which is that parent
oids that are not COB commits are accompanied by a commit trailer called
`Rad-Related`. This is for all related content that should be pulled in
but is not part of the change graph proper.

When building the change graph, we simply ignore commits that are marked
as "related".
2024-01-22 21:20:01 +01:00
cloudhead 7feb3e3b10 Use "repository" consistently over "project"
We were using the two pretty interchangeably. "Project" should only be
used to refer to the repository payload. "Repository" should be used
when referring to the resource that is fetched, synced, cloned, checked
out etc.
2024-01-22 21:18:54 +01:00
cloudhead f87dfba9cd Rename Id to RepoId
Rename the type to make it clearer and consistent with `NodeId`.
2024-01-22 15:51:44 +01:00
cloudhead 7208d89c31 radicle: Remove unused import 2024-01-22 10:51:44 +01:00
cloudhead dc8561847d cli: Small visual improvement when syncing 2024-01-19 17:09:07 +01:00
cloudhead 7b3d380ceb node: Fix connection attempt tracking
When a DNS error occured, the `dial` call failed and we didn't get a
connection attempt, just a disconnect. We fix that by always calling
back into the service when we attempt a connection.
2024-01-19 16:32:01 +01:00
cloudhead 0fbfbc5721 Make sure preferredSeeds has a default
If the user already has a config, the preferred seeds list is not
populated. We fix that here by giving it a default value.
2024-01-19 16:30:24 +01:00
Fintan Halpenny 5dbd9bb2a3 radicle: ensure clean up on rad::init error
It is possible that there can be errors while configuring a Radicle
`Repository` during `rad::init`, for example:
- configuring working copy remote fails
- signing references fails
- setting the identity head fails
- setting the project head fails

If any of these occur, a best effort is made to remove the
`Repository` and the working copy remote, so that the caller may fix
any issues and retry.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-19 11:35:14 +01:00
Lars Wirzenius f03c734e85 build: add config for Radicle native CI engine
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-19 11:29:23 +01:00
Sebastian Martinez c4afd897f9 web: Using connect address in auth_url
Due to only using the `options.listen` address in the creation of the
`auth_url` we aren't able to authenticate with an existing httpd instance
if the instance isn't the default value.
2024-01-19 11:27:16 +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 640d302345 Don't ever decrease rlimit
In case the rlimit is already higher than the desired number, we leave
it as-is.
2024-01-17 17:38:52 +01:00
cloudhead f4f479d68f cli: Add logging and file limit setting 2024-01-17 17:36:51 +01:00
cloudhead 44fc11dff8 cob: Don't panic on missing root
This can happen if the change was not able to be loaded due to open file
limit issues for example.
2024-01-17 17:34:30 +01:00