Commit Graph

1807 Commits

Author SHA1 Message Date
cloudhead f7737b73c9
Update CONTRIBUTING.md 2024-03-25 13:39:56 +01:00
cloudhead 0bcec941ee
node: Change behavior on conflicting connections
Instead of dropping the existing connection(s), we drop the same
connection on both sides, by using a simple rule that yields the same
result whether the node sees the connection as inbound or outbound.

The trick is to use something that both nodes agree on, for instance
whos public key is greater than the other, and use that information
to close the same connection on both sides.
2024-03-25 12:48:27 +01:00
cloudhead e695d06bbb
node: Logging improvements & other small things 2024-03-25 12:05:05 +01:00
cloudhead dbf47fe4e9
Implement new versioning system
See `VERSIONING.md` for details.
2024-03-25 11:54:08 +01:00
cloudhead ada492f699
node: Improve logging more 2024-03-22 18:00:48 +01:00
cloudhead a4928f50b6
node: Combine event with sync status change
Use the same logic to check whether the sync status was updated, to emit
the `RefsSynced` event. That way they are at least consistent.
2024-03-22 17:07:56 +01:00
cloudhead 474df7fc3c
node: Update logging config
Promote message logging to `debug` level, and change default level to
`info`.

This is because `trace` level often covers details at a different level
of detail than for eg. messages sent and received. This means we don't
have to use `trace` level just to see the gossip.
2024-03-22 16:42:35 +01:00
cloudhead 33be2a62da
cli: Improve error when `radicle-node` isn't found 2024-03-22 16:41:51 +01:00
cloudhead 25c7162760
man: Update `rad-patch` with new sync options 2024-03-22 16:35:06 +01:00
cloudhead 98b0d55fde
cli: Include all nodes we can announce to on sync
Previously, we only kept tracked of unsynced nodes we were connected to.
Now we track all unsynced nodes, since announcements are relayed.

We also cap the replicas to exit earlier in case of very low replica
count.
2024-03-22 16:35:06 +01:00
cloudhead 3535170f2d
cli: Improve errors and code for syncing
We distinguish between the cases:

a) There are no seeds at all.
b) There are no seeds to announce to despite the user wanting a higher
   replication factor, for example.
2024-03-22 16:35:06 +01:00
cloudhead ff79d15bb8
cli: Change syncing rule for configured seeds
Instead of waiting for *all* configured/preferred seeds to be synced,
we wait for at least one.

Note that the previous behavior can still be used by setting
`--replicas` appropriately.
2024-03-22 16:35:06 +01:00
cloudhead e6728db15a
cli: Unify all syncing code
We were using similar but slightly different syncing code in the
remote-helper, issues/patches and `rad sync`. This commit unifies them.
2024-03-22 16:35:06 +01:00
cloudhead 8f89f088c6
cli: Correctly honor sync timeout 2024-03-22 16:35:06 +01:00
cloudhead 38a76a42de
radicle: Don't update sync status redundantly
We were updating it even when the `head` was the same.
2024-03-22 16:35:06 +01:00
cloudhead 9f4227d378
term: Improve errors when editor can't be spawned 2024-03-22 14:09:27 +01:00
Sebastian Martinez 0581c017ae
cli: Add `rad patch archive --undo`
Allows archived patches to be reverted to open state.
2024-03-21 20:33:15 +01:00
Fintan Halpenny ea31040ec6
cli: do not require RID for sync inventory
The inventory operation of the `rad sync` command does not require an
RID. Localise resolving the RID in the match arms that require it.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-21 20:29:11 +01:00
Fintan Halpenny ca9d2b44df
node: fix clippy suggestion on borrowing
Remove the borrow of `rid` to fix the clippy warning.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-21 20:29:11 +01:00
cloudhead 6288dd0a24
radicle: Load inventory lazily
Instead of loading the inventory cache on storage open, load it
when the `inventory` function is called and the cache is `None`.
2024-03-21 18:03:18 +01:00
cloudhead 057af40ea3
radicle: Fix config loading with bad alias
Previously, a config would load fine with an invalid alias,
due to how serde is configured for the `Alias` type. This fixes it.
2024-03-21 14:44:04 +01:00
Alexis Sellier 8b1dc8f168
node: Connect to preferred seeds
Make sure we connect to and keep connected to preferred seeds.
2024-03-21 12:47:32 +01:00
Sebastian Martinez 3aca2a11b0
httpd: Only return cache header on success 2024-03-21 12:45:13 +01:00
cloudhead 04a4aa06c9
httpd: Fix broken test 2024-03-21 12:43:35 +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
cloudhead d771ce8522
node: Make `Storage::refresh` private 2024-03-21 12:40:58 +01:00
cloudhead 2bcb03b021
node: Re-think inventory update code
Instead of re-loading the full inventory on `rad init`, we simply add
the new repository to the in-memory cache.

We also keep track of whether a fetch was a full clone, to know when
to update our routing table.
2024-03-21 12:40:58 +01:00
cloudhead 0e880e12e6
node: Cache node inventory
For large seeds with many repos, it's expensive to traverse the
inventory everytime the node connects to a new peer, for example.

To improve the situation, we cache the inventory per `Storage` instance,
and add a `refresh` method to refresh the inventory.

This method is called when the node is told to synchronize its
inventory.
2024-03-21 12:40:58 +01:00
Alexis Sellier f15afa84be
cli: Add timing information to `rad-sync` 2024-03-19 17:27:18 +01:00
Alexis Sellier ddd4bde302
node: Make worker count configurable 2024-03-19 16:34:15 +01:00
Lars Wirzenius 6569449fff
cli: add PATH to env vars in rad-debug
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-18 13:14:50 +01:00
Lars Wirzenius 5fce714ba5
cli: include path to rad binary in rad-debug
This relies on /proc/self/exe being a symlink to the binary, so this
may only work on Linux.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-18 13:14:01 +01:00
Alexis Sellier 5ae617abf0
helper: Don't sync if we aren't seeding 2024-03-18 13:04:48 +01:00
Alexis Sellier 623ef278d0
helper: Add `-o hints` push option
Works even if you have hints disabled in config.
2024-03-18 12:57:32 +01:00
cloudhead 9cd1b0ec46
cli: Improve missing man page handling
Instead of saying "no manual entry", we output regular help.
2024-03-17 21:14:58 +01:00
cloudhead cf8f262cb2
man: Add `rad-id.1` man page 2024-03-17 21:14:58 +01:00
cloudhead 74abd789c7
httpd: Fix private repo visibility
Make private repos invisible on all routes, including /raw endpoints
and Git clones.
2024-03-17 21:13:25 +01:00
cloudhead 62fa8c25c8
scripts: Delete old install script 2024-03-15 16:53:09 +01:00
cloudhead 15efae2a74
docs: Use POSIX-compliant install command 2024-03-15 10:36:22 +01:00
cloudhead 752656fbfa
cli: Fix output of `rad auth`
The `rad help` command was not the right one.
2024-03-15 10:20:28 +01:00
cloudhead 54aacc9619
ci: Add version file to binary release
This commit also upgrades deprecated actions.
2024-03-13 12:36:03 +01:00
cloudhead d7c88f12ab
radicle: Fix some doc comment issues 2024-03-12 16:13:08 +01:00
cloudhead de0b9ae44d
cli: Don't highlight unknown languages
Previously, we'd show "Empty file".
2024-03-12 16:12:16 +01:00
cloudhead eb1ae13e68
cli: Use correct styling for revision id 2024-03-12 15:46:55 +01:00
Michael Raitza f0b8446515
cli: Handle message editor corner cases
1. Split on double newline fails when description is empty
2. Title must be a single line
2024-03-12 15:44:26 +01:00
Fintan Halpenny 3ad2b4431f
fetch: only send changed wants and haves
This change limits the amount of `wants` and `haves` data that is sent
to the serving side of a fetch.

When a `RefsAt` announcement is sent, the fetching peer can calculate
the difference between the `rad/sigrefs` they're aware of -- if it
exists -- and the newly advertised `rad/sigrefs`. This means they can
efficiently ask for the `wants` and `haves` of references that have
changed -- saving some data sent over to the serving side.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-12 13:01:03 +01:00
cloudhead 0f0f9ff9b4
helper: Check for missing canonical head
Without the canonical head in the working copy, the next check will fail
with a cryptic error.
2024-03-12 12:56:45 +01:00
cloudhead 93ff59ae25
cli: Add `rad version --json` flag
This will be used to automatically populated metadata around releases
for the homepage.
2024-03-11 17:36:31 +01:00
cloudhead fa4b929a06
ci: Remove old deploy script, cleanup build 2024-03-11 16:54:52 +01:00
Lars Wirzenius 570a7eb141
build.rs: fix formatting
.radicle/native.yaml runs "cargo fmt --check" and that fails without
this change.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-11 13:29:37 +01:00