Commit Graph

1892 Commits

Author SHA1 Message Date
cloudhead eff40166c9
cli: Add `rad unseed` command
This replaces the `-d` flag of `rad seed`, making it more like `rad
unfollow`.
2024-02-22 16:02:40 +01:00
cloudhead 6b4f055c36
cli: Don't allow missing config file
It's best to just error if the user is missing the config file, since we
create it on profile init. This also gets rid of the privacy leak.
2024-02-22 16:02:40 +01:00
cloudhead 0d18a8fd9e
cli: Better error message in `rad id` 2024-02-22 16:02:40 +01:00
cloudhead e06dd208f4
cli: `rad seed` output improvement
Better colors, and re-order fields to have policy before scope.
2024-02-22 16:02:38 +01:00
Michael Raitza 0908c65f50 httpd: Filter-out private-but-pinned repos
They should only be visible to localhost.
2024-02-16 15:27:08 +01:00
cloudhead 9767b485c2
cli: Improve `rad inbox` output
* Add change authors
* Add object status
* Add colors
2024-02-12 14:03:14 +01:00
cloudhead b477864b83
cli: Stabilize sort order of inbox repos
Sort repositories before displaying them.
2024-02-12 12:01:54 +01:00
cloudhead 9576a6496b
node: Various small fixes 2024-02-12 11:37:31 +01:00
cloudhead 4307bdaae4
sim: Change a few things in the simulator
1. Simplify latency calculation to be more predictable, otherwise,
   setting a latency is not super useful.
2. Turn a hard error into a log. It's not worth fixing it now though, as
   it isn't a problem for the tests.
2024-02-12 11:37:31 +01:00
cloudhead d1f4161ee9
sim: Track messages received in simulator
This is going to be useful for testing message amplification in the
network protocol.

We also reset the state of a few things everytime the simulator is run.
2024-02-12 11:37:31 +01:00
cloudhead 286c639e26
node: Make sure node is "active" when connected
This ensures `last_active` is never `0` for connected peers.
2024-02-12 11:37:31 +01:00
cloudhead d6d90c6fdc
node: Track peer latency
This is useful for a bunch of different network optimizations we're
going to be working on.
2024-02-12 11:36:35 +01:00
cloudhead 664cf20c92
Change default seeding scope to 'all'
This makes the default policy `block` with scope `all`. The good thing
about this is that you don't have to manage individual nodes in the
beginning. You simply seed the repos you want, and everything is
followed within those repos. This matches user expectations, as `rad
seed` does what you expect it to do.

For open-policy seed nodes, it also means that simply changing `block`
to `allow` from the default config is all you need.

This leaves the non-default `followed` scope as a more "advanced"
setting, since it is much more cumbersome: it forces you to follow a
user before you can see their issues/patches, which is not something
most users expect coming from old-shcool forges.
2024-02-12 10:56:21 +01:00
cloudhead 292ff01923
systemd: Update for system install
While these unit files were good for a user install, they were not
appropriate for running *system* services. Since most users nowadays
use `rad node` to manage their node, it makes more sense for the unit
files to be oriented towards server use.
2024-02-08 12:34:26 +01:00
cloudhead 137961c1f7
cli: Add `rad config get`
Gets a specific config value.
2024-02-07 17:12:45 +01:00
cloudhead e5fcbba4c0
cli: Implement `rad block` command
Blocks repos & nodes from beeing seeded/followed.
2024-02-07 15:51:05 +01:00
cloudhead d37c52aade
cli: Allow `rad inspect` without repo existing
To check the seeding policy of a repo without it being in storage.
2024-02-07 15:51:00 +01:00
cloudhead 565e3b889c
cli: Fix output of `rad seed` when empty 2024-02-07 15:45:50 +01:00
cloudhead f46d396e12
clippy: Fix lint 2024-02-07 14:56:26 +01:00
cloudhead d901b911c6
node: Drop self-connections
Also try to avoid initiating a self-connection even if the NID of our
node has changed.
2024-02-07 14:30:42 +01:00
cloudhead 1130608331
cli: Document `rad init --no-seed` 2024-02-07 13:57:08 +01:00
cloudhead fe55de181d
cli: Add new `rad inbox` command
Shows you updates on local repositories.

Included here is a basic implementation of a notification system. A new
database is created and updated after every fetch, with refs that have
changed.

The `rad inbox` command can then list items in the database and delete
them.
2024-02-06 11:40:58 +01:00
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