Repository navigation
feat(infra): import the IPNS signing key in the aggregator IPFS node #3621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+129
−4
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
610259e
feat(infra): import the IPNS signing key in the aggregator IPFS node
jpraynaud 22cc85d
ci: pass the IPNS signing key to the infrastructure deployment
jpraynaud b26ac71
chore(infra): bump Kubo default version to 'v0.43.1'
jpraynaud 07d51ca
docs: add IPNS signing key runbook
jpraynaud 7a1f312
docs: update CHANGELOG
jpraynaud 772f3f1
chore: upgrade crate versions and `mithril-infra/assets/infra.version…
jpraynaud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # IPNS signing key | ||
|
|
||
| ## Introduction | ||
|
|
||
| When IPFS is enabled on a Mithril network, the aggregator publishes the IPFS directory of the immutable archives under an IPNS name. This IPNS name is derived from an Ed25519 signing key that the IPFS node of the aggregator imports at startup. | ||
|
|
||
| The signing key is provided to the deployment by the `IPFS_IPNS_SIGNING_KEY` secret of the GitHub environment of the network, in PEM PKCS#8 format. This secret is optional (e.g. for a follower aggregator): the aggregator does not publish to IPNS when it is empty. | ||
|
|
||
| > [!IMPORTANT] | ||
| > :fire: The IPNS signing key is a private key: anyone who holds it can publish content under the IPNS name of the network. It must not be stored anywhere other than the GitHub environment secret and the IPFS node of the aggregator. | ||
|
|
||
| All the commands below are run locally and require [Docker](https://docs.docker.com/get-docker/). | ||
|
|
||
| ## Pre-requisites | ||
|
|
||
| Export the environment variables: | ||
|
|
||
| ```bash | ||
| export IPFS_IMAGE=ipfs/kubo:v0.43.1 | ||
| export KEY_DIRECTORY=$(mktemp -d) | ||
| ``` | ||
|
|
||
| ## Create a signing key | ||
|
|
||
| Generate a new Ed25519 signing key and export it in PEM PKCS#8 format: | ||
|
|
||
| ```bash | ||
| docker run --rm -u $(id -u):$(id -g) -e IPFS_PATH=/tmp/ipfs -v $KEY_DIRECTORY:/keys --entrypoint sh $IPFS_IMAGE -c ' | ||
| ipfs init > /dev/null | ||
| ipfs key gen --type=ed25519 ipns-signing-key > /dev/null | ||
| ipfs key export ipns-signing-key --format=pem-pkcs8-cleartext -o /keys/ipns-signing-key.pem | ||
| ' | ||
| ``` | ||
|
|
||
| Display the signing key: | ||
|
|
||
| ```bash | ||
| cat $KEY_DIRECTORY/ipns-signing-key.pem | ||
| ``` | ||
|
|
||
| ## Compute the IPNS name | ||
|
|
||
| Compute the IPNS name associated to the signing key: | ||
|
|
||
| ```bash | ||
| docker run --rm -u $(id -u):$(id -g) -e IPFS_PATH=/tmp/ipfs -v $KEY_DIRECTORY:/keys:ro --entrypoint sh $IPFS_IMAGE -c ' | ||
| ipfs init > /dev/null | ||
| ipfs key import --format=pem-pkcs8-cleartext ipns-signing-key /keys/ipns-signing-key.pem | ||
| ' | ||
| ``` | ||
|
|
||
| The command outputs the IPNS name, and the immutable archives directory is then available at `/ipns/<IPNS_NAME>`. | ||
|
|
||
| > [!TIP] | ||
| > The same command computes the IPNS name of an existing signing key, provided it is first stored in `$KEY_DIRECTORY/ipns-signing-key.pem`. | ||
|
|
||
| ## Register the signing key | ||
|
|
||
| Copy the full content of `$KEY_DIRECTORY/ipns-signing-key.pem` (including the `BEGIN` and `END` lines) into the `IPFS_IPNS_SIGNING_KEY` secret of the GitHub environment of the network. | ||
|
|
||
| The key is imported by the IPFS node at the next deployment of the network. | ||
|
|
||
| Then delete the local copy of the signing key: | ||
|
|
||
| ```bash | ||
| rm -rf $KEY_DIRECTORY | ||
| ``` | ||
|
|
||
| ## Rotate the signing key | ||
|
|
||
| The IPFS node replaces its signing key with the one of the deployment at each start. | ||
|
|
||
| > [!WARNING] | ||
| > Rotating the signing key changes the IPNS name of the network. The third-party nodes that follow the previous IPNS name must be informed of the new one before the rotation is deployed. This coordination is planned to be handled with DNSLink, which is not implemented yet. | ||
|
|
||
| To rotate the signing key, create a new signing key, compute its IPNS name and register it as described above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| 0.5.28 | ||
| 0.5.29 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.