-
Notifications
You must be signed in to change notification settings - Fork 241
Description
The rough idea:
- human friendly starting point: dedicate domain (for humans) and have it DNSLink-ed to a IPFS key
- IPFS key is used for publishing IPNS
- optionally: share the key in secure manner with publishers (or just have one publisher or automate it)
- Hint: in case of key being compromised, just generate a new key, and update domain DNSLink to point to the new key, republish repository with new key
- trust is established very similarly as in Maven Central: domain tells you (via DNSLink) which IPNS you need to resolve to get to the latest CID (repository root).
- repo is usable with Maven via plain HTTP transport as well fx
https://ipfs.io/ipns/maven.ipfs.io[/subpath]but we should discourage misuse of public gateways and herd users toward running local IPFS nodes instead.
The setup would look like DNS domain (via DNSlink) -> IPNS -> CID and is a double indirection.
Repository would be usable from Maven repository URL as fx ipfs:/maven.ipfs.io (maybe some subpath like ipfs:/maven.ipfs.io/releases. Given Maven release artifacts are immutable, repo leaves are usually unchanged, it is merely the merkle tree root that changes, as repository "grow". Publishers, consumers and interested parties would keep repository pinned in their nodes (see below, would happen automatically).
Consumers just need to add extension, declare IPFS repository in env/POM and consume artifacts "as usual".
Publishers just need to add extension, have the publishing private key added in their IPFS node, and would deploy as usual (just by invoking mvn deploy while running an IPFS node).
Requirements for consumers and publishers:
- added extension
- both consumers and publishers should run IPFS node locally (even a IPFS Desktop).
(Behind the scenes) Workflow for consumers (assume repository URL is ipfs:/maven.ipfs.io):
name resolve maven.ipfs.io(to make sure you are up to date)pin add $CIDpin resolved CID to local nodefiles cp /ipfs/$CID /somewhere(exposes $CID via UnixFS)- consume GAVs via UnixFS
For publishers:
- same as for consumers
- deploy files to repository structure
files write...and update/maintain metadata via UnixFS - publish new CID with $KEY on Maven session end
Ideally, publisher has to have private $KEY in IPFS Node named as $NAME, for example:
$ ipfs key list
self
ipfs.maveniverse.eu <- key used to publish ipfs.maveniverse.eu domain linked with this key
$
This story above is implemented in https://github.com/maveniverse/ipfs
The extension adds:
- Resolver transport for IPFS. With this extension loaded, one can consume repositories hosted on IPFS via UnixFS (repo URL becomes
ipfs:/name[/subpath]wherenameis CID, or any "resolvable" string like IPNS or DNSlinked domain, example https://ipfs.maveniverse.eu/) - Aside of transport, Maven extension helps in deployment publishing automation (on Maven session end performs IPNS publishing).
- the majority of things is done here https://github.com/maveniverse/ipfs/blob/950dc9193b4e0b3f2b0605c9747500d50d46108a/core/src/main/java/eu/maveniverse/maven/ipfs/core/internal/IpfsNamespacePublisherImpl.java while the rest just "ties in" things and calls publisher when appropriate.
This story above is exactly how https://ipfs.maveniverse.eu/ domain is implemented. Content is backed by two 24/7 running IPFS geographically distant nodes (but is still slow 😞 ).