Commit Graph
231 Commits
Author SHA1 Message Date
cloudhead abf89438ea 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 b31fbde159 node: Add log to node config 2024-04-29 15:59:17 +02:00
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
Sebastian Martinez 7fc3b73e88 Update radicle-surf to 0.21 2024-04-24 11:51:25 +02:00
Sebastian Martinez 574ac3566b httpd: Remove diff and branches from history route 2024-04-10 11:44:00 +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 991505ec9d radicle: Switch error type for repository methods
This simplifies error handling for the next commit.
2024-04-03 14:25:02 +02:00
cloudhead 9cdf0aa1fd Update radicle crates to 0.9.0 2024-03-26 11:56:27 +01:00
cloudhead 77076af23c 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 dbf47fe4e9 Implement new versioning system
See `VERSIONING.md` for details.
2024-03-25 11:54:08 +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 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
Sebastian Martinez 98bb91680d 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 955c942c18 httpd: Improve alias use in tests 2024-03-11 12:31:28 +01:00
Sebastian Martinez 088549a333 httpd: Add support for submodules 2024-03-11 12:27:27 +01:00
cloudhead 3d7ae89a83 httpd: Fix tests 2024-03-11 12:24:30 +01:00
Sebastian Martinez 325289d28f 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 b6e1385e39 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 e52ce483a1 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 786ce40f95 node: Add connection limits
The limits are roughly modeled after the Bitcoin network.
2024-03-08 23:24:34 +01:00
Sebastian Martinez 5bdc2ad1fb httpd: Add author alias to reactions 2024-03-08 23:20:38 +01:00
Sebastian Martinez 501b6ba9eb httpd: Add author information to assignees 2024-03-08 23:15:34 +01:00
Fintan Halpenny 985b0af3f6 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 a1b41542b8 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 17744a03fd 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 0908c65f50 httpd: Filter-out private-but-pinned repos
They should only be visible to localhost.
2024-02-16 15:27:08 +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
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
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
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 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
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 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 f87dfba9cd 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 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 045b3e7175 node: Increase process ulimit on start
Users have been having issues with the process soft file limit.
We set that to a reasonably high value to avoid problems.
2024-01-17 17:34:25 +01:00
cloudhead 1e2776cb08 cli: Output explore URLs on push 2024-01-12 13:24:11 +01:00
Sebastian Martinez 14b90ffbf9 httpd: Change node id in / and add version to /node 2024-01-09 13:59:23 +01:00
Sebastian Martinez 9b98542692 httpd: Add /api/v1/profile route to get entire profile
That route is limited for requests that come from a loopback IP.
2024-01-09 13:59:23 +01:00
cloudhead 7d4ce8207d httpd: rad web --connect takes an argument
To be able to connect to any running httpd, have `--connect` take the
address of the running daemon.
2024-01-09 13:33:26 +01:00
Sebastian Martinez 1bb400c278 httpd: Add edits field to revision json 2023-12-22 15:17:25 +01:00
Sebastian Martinez ee3dcfacf0 httpd: Allow edit revision embeds 2023-12-22 15:09:20 +01:00
Sebastian Martinez 5331cf3bcf radicle: Move DataUri to common::DataUri 2023-12-22 15:09:20 +01:00
Fintan Halpenny 2dea54c6ee cob: mandatory Oid in CodeLocation
To make `CodeLocation` reusable across different components, require
that a commit's `Oid` is part of the struct.

An `Oid` is necessary since the `path` can refer to a path at any
point in time throughout the history of the repository. By pinning the
commit that is being referred to, the path will refer to the path
within the associated tree [of the commit].

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-12-22 15:00:42 +01:00
Sebastian Martinez 1f36879aa2 cob: improve Comment generics
`Infallible` is a more appropriate type in comparsion to `()` for
comments that do not require a `CodeLocation`.

That is because if the type for `location` is `Option<()>`, this means
that `Some(())` can be constructed, however, we never intend to
construct that variant. On the other hand, `Infallible` can never be
constructed, and so, only `None` can be used.

This requires updates to some functions to use the generic `T` and
also handle the different kinds of `Comment`s -- `Infallible` and
`CodeLocation`.

X-Co-Authored-By: Fintan Halpenny <fintan.halpenny@gmail.com>
2023-12-22 14:09:02 +01:00