Commit Graph

1877 Commits

Author SHA1 Message Date
cloudhead fe5757d122
Tidy up environment variables
* Try to use constants instead of strings
* Move crypto seed override out of radicle-crypto
* Use GIT_COMMITTER_DATE for commit overrides
* Use RAD_LOCAL_TIME as general time override
* Allow variables to be used in release mode
2024-04-26 10:38:54 +02:00
cloudhead deeb39c558
node: Support "transparent" Tor
This allows for configuring your node such that `.onion` addresses
encountered are treated as regular DNS names.
2024-04-26 10:37:41 +02:00
cloudhead 70d2e1a0db
node: Improve `Timestamp` conversion safety
Remove `Timestamp::from(u64)` instance, since not all `u64`s are valid
Timestamps, and add `try_from` instead.
2024-04-26 10:33:34 +02:00
cloudhead cd2884a609
build: Adjust folder structure
This allows for simply extracting into $PATH.
2024-04-25 17:15:58 +02:00
cloudhead 85b321f943
cli: Use correct color for private repos 2024-04-24 21:11:26 +02:00
cloudhead c607619683
node: Don't relay old messages
Avoids spamming peers on startup.
2024-04-24 13:25:58 +02:00
cloudhead 2b771921d5
node: Type-safe timestamps
Use a struct to represent timestamps, to improve type safety.
2024-04-24 12:19:40 +02:00
cloudhead 0fcfbb3ecf
node: Don't re-use timestamps
There are rare cases where ref announcements may be sent in close
succession, and the current clock time is re-used. This will cause the
second (newer) announcement to be ignored by peers.

We add a `timestamp` method that checks if the timestamp is re-used, and
increments it if so, ensuring that we always use a fresh one.
2024-04-24 12:19:40 +02:00
Sebastian Martinez 7fc3b73e88
Update radicle-surf to 0.21 2024-04-24 11:51:25 +02:00
Lars Wirzenius 1a0221f726
radicle: fix tests to not leave temporary files behind
In radicle/src/test.rs, we have a helper type for a Node, which
creates a temporary directory using tempfile::tempdir, which creates a
TempDir. When the TempDir is dropped, it deletes its associated
directory. Before that happens, the Node has already stored the path.
Right after that the TempDir is dropped, and the directory deleted.
When the test code later opens the repository, using Storage::open,
it recreates the directory. As a result, there is nothing that would
delete the directory when the test finishes.

This means tests that use the helper Node type leave temporary files
behind.

Fix this by storing the TempDir in the helper Node, not just its path.
This means the TempDir is only dropped at the end of the test its used
in, and no temporary files are left behind.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-04-24 11:47:14 +02:00
cloudhead c07522365a
cargo: Run `cargo update` on workspace 2024-04-23 17:43:21 +02:00
cloudhead 9fe5a8922f
build: Update to zig 0.12.0, add `rad-web` 2024-04-23 10:59:33 +02:00
cloudhead cdebbe5bb7
node: Improved message logging 2024-04-23 10:41:43 +02:00
cloudhead d77b5d5abe
node: Add 'disconnect' command to handle 2024-04-23 09:52:25 +02:00
cloudhead 65aeebb2d1
docs: Update manual pages to 1.0.0 2024-04-22 14:37:19 +02:00
cloudhead 7a1ba7d4b1
node: Add support for `.onion` addresses in wire
Adds support for encoding and decoding onion addresses in the gossip
protocol.
2024-04-22 12:16:17 +02:00
cloudhead ae709b00ed
cli: Enable HTML syntax highlighting in diffs 2024-04-20 15:59:20 +02:00
cloudhead 95b5191533
Reproducible cross-compiled builds
Implement a new build pipeline using `podman` and `zig` that is
reproducible and can be run entirely on linux.

We also simplify the versioning system, defaulting to the output of `git
describe` when there are no exact tag matches.
2024-04-20 11:11:00 +02:00
cloudhead 0b5fa51a92
helper: Allow pushing a raw SHA-1 2024-04-18 17:09:45 +02:00
cloudhead 4276a70eb1
node: Event on local refs announcement
This allows us to listen on the socket for when the user announces new
refs.
2024-04-18 10:57:55 +02:00
cloudhead e5d8563cca
node: Update routing table on fetch
Since a user can force a fetch of a private repository without any
announcement being involved, we update the routing table if the fetch
completes successfully, with the remote node.
2024-04-18 10:51:23 +02:00
cloudhead f17df88229
term: Update `inquire` crate 2024-04-15 17:12:36 +02:00
Sebastian Martinez 574ac3566b
httpd: Remove diff and branches from history route 2024-04-10 11:44:00 +02:00
Fintan Halpenny 3556758386
cli: fix rad inbox clear output
If multiple ids are specified for `rad inbox clear`, it would report
that only 1 item was cleared, when in fact multiple were.

This was found to be due to the SQL code returning a change count of
`1`. This is likely due to the way the statement is being reset each
time. The `sqlite` library does not seem to easily support the usage
of `IN` in a `WHERE` clause. So instead, the `count` is aggregated in
the loop and returned instead.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-04-09 16:09:44 +02:00
Fintan Halpenny 8bf871903a
node: handle removal of cob from cache
When a `Patch` or `Issue` is entirely removed from the Git repository,
then there is no update to be made -- instead it should also be
removed from the cache.

This covers the case where the original author of the COB deletes the
COB.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-04-09 16:06:51 +02:00
cloudhead 53ecc88437
node: Always notify the service of a fetch result
Even if the peer is no longer connected.
2024-04-09 16:00:49 +02:00
cloudhead 395d317954
node: Keep track of data sent/received in fetch
Keep track and log the Git data sent/received.
2024-04-09 15:59:55 +02:00
cloudhead e3ecf4d7a0
cli: Add partial clone fail test
Ensure `rad clone` is successful as long as one fetch succeeds.
2024-04-09 15:54:08 +02:00
cloudhead 2eb665678e
cli: `rad sync` UX improvements
* Add `--force` flag to force a fetch even if the node is not a seed.
* Don't fail if we can't connect to a node during a fetch.
* More accurately exit when we hit our replica count.
2024-04-09 10:43:35 +02:00
cloudhead e9b79fb6d0
cli: Improve UX for cloning/fetching private repos
When `--private` is passed to `clone`, we force a fetch from nodes that
aren't known seeds.

When it isn't specified, we skip nodes that aren't known seeds, even if
they are in the preferred seeds list. Previously, we would still fetch
from them, which would cause errors.
2024-04-08 22:15:56 +02:00
cloudhead ef1ed621d7
node: Don't re-queue fetch that is already queued 2024-04-08 17:15:57 +02:00
cloudhead e19c773a86
fetch: Improve logging of clone 2024-04-08 17:06:38 +02:00
cloudhead 976b58ba7a
node: Simplify and fix fetch dequeueing
There was redundant code and a missing `break`.
2024-04-08 12:48:49 +02:00
cloudhead bd8e0ebcda
cli: Add tool in case `sqlite3` is unavailable
Adds the `rad node db exec <query>` command.

Easy way to run sqlite queries if the sqlite3 CLI is not available or
too old.
2024-04-06 17:55:59 +02:00
cloudhead ad7ba82e6a
node: Populate refs db on startup
If the refs database is empty, populate it on startup.
Also includes a script to clear it.
2024-04-05 21:59:58 +02:00
cloudhead 6be77ca9c3
radicle: Implement `remote_refs_at`
Implement this function on `RemoteRepository`, and move `repositories`
to the trait level.

This function will be used to quickly get the `RefsAt` of all repository
remotes.
2024-04-05 21:59:28 +02:00
cloudhead 7834dccd2c
node: Account for skipped refs when announcing 2024-04-05 17:40:53 +02:00
cloudhead bc247dff24
node: Skip fetch early if no refs in announcement 2024-04-05 12:17:17 +02:00
cloudhead e55c86f1ce
node: Improve fetch logging 2024-04-04 18:41:53 +02:00
cloudhead 6ff4efebed
node: Remove namespaces from fetch request
It was unused..
2024-04-04 18:22:19 +02:00
cloudhead f2fe0242e1
node: Always check refs status before fetching
We were only checking it on dequeue.

Also simplifies some of the logic by centralizing the check for fetching
our own refs.
2024-04-04 18:10:49 +02:00
cloudhead 36808234a6
cli: Don't allow announcing without a fork 2024-04-04 14:13:34 +02:00
cloudhead 51e64cfa8b
node: Fix logging for skipped refs
We were using the wrong condition.
2024-04-04 12:24:49 +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
Fintan Halpenny ea69168f44
cli: explain public to private changes
Add an example of changing a public repository to a private
repository, noting that any replicated data will be public, but any
new changes will not be replicated.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-04-03 15:41:48 +02:00
Lars Wirzenius a71289f720
docs: link to protocol guide
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-04-03 15:32:26 +02:00
Sebastian Martinez b16eb5c986
man: Add `rad patch archive` to man page 2024-04-03 15:25:31 +02:00
Sebastian Martinez d38846baae
cli: Display better errors in `patch ready`
Instead of doing nothing and going to sync no change, we should display
some error to the users that we haven't been able to apply the changes.
2024-04-03 15:19:31 +02:00
Sebastian Martinez 0a78b9cc5b
cli: Display correct merge author in rad patch show output 2024-04-03 15:11:34 +02:00
Richard Levitte b495358c5f
cli: Don't force bold output to be white
On terminals in light mode, it makes the bold stuff invisible.

Signed-off-by: Richard Levitte <richard@levitte.org>
2024-04-03 15:07:31 +02:00