mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-15 15:50:38 +08:00
We ensure that a `rad/root` ref is included in the signed refs file under `rad/sigrefs` for all remotes. This prevents a certain kind of "grafting" attack where signed refs can be copied between repositories, by having the peer sign over the identity root together with the data refs. When verifying signed refs, we ensure that the ref is present and points to an identity branch root that matches the repository identity containing the signed refs. Alternatives: lots of alternatives were considered, but this one doesn't introduce any changes to the signing. The `rad/id/root` name was considered but is invalid due to `rad/id`.
68 lines
3.1 KiB
Markdown
68 lines
3.1 KiB
Markdown
We cannot delete a repository, since that can cause data integrity
|
|
issues. However, we can clean the storage of remotes that are not the
|
|
local peer or the repository delegates. To do this we can use the `rad
|
|
clean` command.
|
|
|
|
First let's look at what we have locally:
|
|
|
|
``` ~alice
|
|
$ rad ls
|
|
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
│ Name RID Visibility Head Description │
|
|
├───────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
│ heartwood rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji public f2de534 Radicle Heartwood Protocol & Stack │
|
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
```
|
|
|
|
Let's also inspect what remotes are in the repository:
|
|
|
|
``` ~alice
|
|
$ rad inspect --sigrefs
|
|
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi 99c549702e2bcfe02b0e68d4a2224fb7a1524529
|
|
z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk e9f48ef90fe8592e1b1c95f96c21a59ca1495300
|
|
```
|
|
|
|
Now let's clean the `heartwood` project:
|
|
|
|
``` ~alice
|
|
$ rad clean rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --no-confirm
|
|
Removed z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
|
|
✓ Successfully cleaned rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
|
|
```
|
|
|
|
Inspecting the remotes again, we see that Bob is now gone:
|
|
|
|
``` ~alice
|
|
$ rad inspect --sigrefs
|
|
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi 99c549702e2bcfe02b0e68d4a2224fb7a1524529
|
|
```
|
|
|
|
Note that Bob will be fetched again if we do not untrack his
|
|
node. Currently, there is no per repository tracking so it's not
|
|
possible to stop fetching Bob for this particular repository.
|
|
|
|
Cleaning a repository again will remove no remotes, since we're
|
|
already at the minimal set of remotes:
|
|
|
|
``` ~alice
|
|
$ rad clean rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --no-confirm
|
|
✓ Successfully cleaned rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
|
|
```
|
|
|
|
Since Eve did not fork the repository, and has no refs of their own,
|
|
when they run `rad clean` it will remove the project entirely:
|
|
|
|
``` ~eve
|
|
$ rad clean rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --no-confirm
|
|
Removed z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
|
|
✓ Successfully cleaned rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
|
|
```
|
|
|
|
And attempting to clean the repository again, or any non-existent
|
|
repository, has no effect on the storage at all:
|
|
|
|
``` ~eve (fail)
|
|
$ rad clean rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --no-confirm
|
|
✗ Error: repository rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji was not found
|
|
```
|