ipfs-gui icon indicating copy to clipboard operation
ipfs-gui copied to clipboard

Publishing websites to IPFS as a service and github app

Open olizilla opened this issue 5 years ago • 13 comments

ETA April 2020:

Valuable discussion on this topic has also been gathered in https://github.com/ipfs/ipfs-gui/issues/69, which was closed in favor of this issue. Please consider discussion in that issue when proceeding with this one.

Original issue text

The problem: I want to publish a website to IPFS and also my domain, with https, and not have it rely (just) on my machine for uptime. We want shareable preview urls, and a simple mechanism for promoting a preview to the live verison.

Prior art:

  • surge.sh - set the bar for simple website publishing... just run surge from the directory you want to publish
  • now.sh - introduced us to the idea of immutable deploys, but publishing each

How about "pin sites to an ipfs cluster, as a service, and github app"

Example usage

ipfsify ./build
Adding to IPFS...
Pinning on cluster.ipfs.dev...
Preview ready https://bafywoowoo.ipfs.dev

The command would add a site locally, and pin the CID to the remote cluster. You get an immutable deploy style url like https://bafywoowoo.ipfs.dev that loads fast as the content is already on more than one machine, and one of them is an always available cluster that we look after.

...some preview builds later...

me: Ok that CID is hot! I wish to publish it!

bot: OK, as this a new site, let me create a IPNS keypair for you. Here it is, dont lose it. I'm going to host it for you and point it to that new CID you gave me, and reliably reannounce it every few hours for you... do you have a legacy dns name you'd like to map it to?

me: sure do, it's oli.zilla.org.uk, what of it?

bot: ok, go set this txt record on your dns provider dnslink=/ipns/Quink...

me: done!

bot: ok, performing the lets encrypt dance... done. https://oli.zilla.org.uk is go, dweb style.


This need has come up multiple times, from mutliple folks. Right now there are a bunch of PL sites that need this service. We've got a reasonable service in place via circleci, but the drawbacks are

  • using the main gateway for hosting. we dont want to add load to them for every site we host
  • using the main cluster for pinning. This use-case can use its own cluster.
  • https config is manual
  • we have to update an ipfs dnslink via a dnsimple token for every build we want to promote to live... why not just use ipns.
  • we can't enable the circleci builds for PRs from forks as we'd risk exposing our dns token. This sucks as we want to enable this process for everyone.

An extension to this idea is to have a github action that builds, pins and updates the status on your PR with the preview url (done, here: https://github.com/ipfs-shipyard/ipfs-github-action) and a github app that is notified when your master branch changes, and triggers the ipns update automagically.

olizilla avatar Mar 21 '19 15:03 olizilla