Commit Graph
256 Commits
Author SHA1 Message Date
cloudhead 0632b2419b node: Further increase the rate-limit defaults
The rate-limitter gets hit on connect, due to historical gossip messages
being exchanged. This results in a high initial burst that needs to be
accounted for.
2024-05-02 13:43:09 +02:00
Sebastian Martinez 26b4ee064c httpd: Add apiVersion to root handler and node information
This will help consumers of the httpd to check if they are on the right
version of the API
2024-05-02 13:09:00 +02:00
Sebastian Martinez a2189cabe4 httpd: Add threshold to project info 2024-05-02 14:43:12 +02:00
Sebastian Martinez a736c5975f httpd: Add alias to project delegates 2024-05-02 14:43:12 +02:00
Sebastian Martinez 54636b448c httpd: Decouple repo stats from tree endpoint 2024-05-02 14:41:27 +02:00
cloudhead bddfaeec80 node: New relay configuration for nodes
Relay now has three values: "always", "never" and "auto".

The first two operate like the previous `true`/`false`. The
new (default) value turns relaying on for nodes with public (external)
addresses and off for nodes without. This should reduce redundant traffic on
the network, that was causing the rate limiters to trigger.
2024-05-02 11:45:29 +02:00
cloudhead 2c64b36291 node: Increase default rate-limiter config
With the increase in traffic on the network after launch, the old
defaults don't make sense anymore.

Longer term, we should look into throttling outgoing messages as well,
prioritizing original messages over relayed messages.
2024-05-01 11:06:28 +02:00
cloudhead f9bdd3bce2 Remove outdated Dockerfiles 2024-04-29 18:02:07 +02:00
cloudhead 24c02f8811 node: Add log to node config 2024-04-29 15:59:17 +02:00
cloudhead 3460da65c1 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 9495414adb 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
Sebastian Martinez 3d38d79c77 Update radicle-surf to 0.21 2024-04-24 11:51:25 +02:00
Sebastian Martinez 152b7fa179 httpd: Remove diff and branches from history route 2024-04-10 11:44:00 +02:00
cloudhead 712b53d6a8 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 3a0571c285 radicle: Switch error type for repository methods
This simplifies error handling for the next commit.
2024-04-03 14:25:02 +02:00
cloudhead df435ef70d Update radicle crates to 0.9.0 2024-03-26 11:56:27 +01:00
cloudhead 736a3deb29 radicle: Add new ash.radicle.garden seed node
Add the new `ash` node as a preferred seed, to load balance.
2024-03-26 10:36:31 +01:00
cloudhead 1b8fee265a Implement new versioning system
See `VERSIONING.md` for details.
2024-03-25 11:54:08 +01:00
Sebastian Martinez 22c83c556f httpd: Only return cache header on success 2024-03-21 12:45:13 +01:00
cloudhead 3fb08329ab httpd: Fix broken test 2024-03-21 12:43:35 +01:00
cloudhead e668fb6cd2 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
Sebastian Martinez 8dbd46e51c httpd: Update stats to count all repos
Instead of filtering private repos for a total count, we should count
all repos.
2024-03-11 12:38:00 +01:00
Sebastian Martinez ca9c4a68ac httpd: Improve alias use in tests 2024-03-11 12:31:28 +01:00
Sebastian Martinez f8743dc67e httpd: Add support for submodules 2024-03-11 12:27:27 +01:00
Sebastian Martinez 8375baf169 Bump radicle-surf to 0.19.0 2024-03-11 12:27:27 +01:00
cloudhead c273b60d8e httpd: Fix tests 2024-03-11 12:24:30 +01:00
Sebastian Martinez cb174ff44d httpd: Insert test node into node db in test::profile fn
To allow the `AliasStore` to retrieve an alias from the node db, we need
to insert it manually into the database in the `profile` function, else
we won't find any Aliases there.
2024-03-11 11:52:46 +01:00
Fintan Halpenny 17a39d2582 httpd: improve error message for missing browser
If `open` or `xdg-open` fail the error is:

    No such file or directory (os error 2)

This generally means that the command could not open the browser on
the OS. To provide better help, improve the error message by informing
the user what went wrong and that they can run `rad web --no-open`
instead, while still printing the URL to visit.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-08 23:58:34 +01:00
Thomas Scholtes 0f6026e126 httpd: Mark immutable response as such with Cache-Control header
For responses to requests for content that is content-addressed with Git
object IDs and consequently immutable, we add a Cache-Control HTTP
header that marks the responses as public, immutable and instructs
clients to cache the response for up to 7 days.
2024-03-08 23:31:43 +01:00
Alexis Sellier ee95b90999 node: Add connection limits
The limits are roughly modeled after the Bitcoin network.
2024-03-08 23:24:34 +01:00
Sebastian Martinez 3834213ca0 httpd: Add author alias to reactions 2024-03-08 23:20:38 +01:00
Fintan Halpenny c21c36049c nix: add radicle-full
To allow Nix users to install radicle with all tools and helpers.
2024-03-08 23:19:15 +01:00
Sebastian Martinez 5329d45d72 httpd: Add author information to assignees 2024-03-08 23:15:34 +01:00
Fintan Halpenny 02fb9397e8 radicle: implement caching for issues and patches
Implement caching for the `Issue` and `Patch` COB. This is achieved by
having the `Transaction::initial` and `Transaction::commit` methods
take a cache which can update the newly created/updated object. The
`Store::remove` method also takes the cache for removing the object
from the cache, as well as the repository.

This meant that the `*Mut` types for the respective COBs are required
to carry a cache alongside the repository store. Identities will not
be cached, and so this is always set to `NoCache` -- which performs no
caching, and always succeeds.

To perform cache reading for issues and patches, the `cache::Issues`
and `cache::Patches` traits are introduced. They capture the minimal
amount of methods that are needed for the `rad issue` and `rad patch`
CLI commands.

The implementor for each of these traits is there respective `Cache`
types, which combines their backing repository store and the SQLite
database. They both provide convenience methods:
- `create` (and `draft` for patches)
- `get_mut`
- `remove`
which can be used instead of their repository store counterparts.

All uses of the repository stores (where needed) are replaced with
`Cache` types.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-02-23 16:03:21 +01:00
Fintan Halpenny 67e46952b6 radicle: rename resolved to is_resolved
The standard in the codebase for boolean methods is to prefix them
with `is_`.

Change `resolved` to `is_resolved`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-02-23 13:56:19 +01:00
cloudhead 87077d5155 cob: Properly authorize root actions
Previously, authorization was only checked for ops after the root op.
We also avoid creating empty actions for `assign` and `label`, which
was needed for non-authorized users to be able to create issues/patches.
2024-02-23 12:31:13 +01:00
Michael Raitza f2be1b2601 httpd: Filter-out private-but-pinned repos
They should only be visible to localhost.
2024-02-16 15:27:08 +01:00
cloudhead fbfac4a6dc 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
Sebastian Martinez 31c0eb37bf 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 f576028bfb 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 9abad78582 httpd: Add review ids to review json 2024-02-01 17:25:18 +01:00
Sebastian Martinez 4496b80b3e 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
Sebastian Martinez 7b9350e154 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 e9be685edf 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 646fb7a24b httpd: Don't show unseeded repos 2024-01-25 16:31:28 +01:00
Fintan Halpenny 5b3d7b7652 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 92182a879b 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 9a36d11ccf Rename Id to RepoId
Rename the type to make it clearer and consistent with `NodeId`.
2024-01-22 15:51:44 +01:00
Sebastian Martinez 60efd13ff3 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 bd65b57503 General dependency update
Left out some of the `gix-*` dependencies to be done separately after
review.
2024-01-18 13:30:26 +01:00