Posting Markdown Blog Posts to IPFS

ipfs

#1

I would like to be able to post simple markdown documents to IPFS as “blog posts”. Additionally, I would like to run my own IPFS gateway so that I can reference / link to blog posts using a domain I can control.

So, something like ipfsDOTbmannconsultingDOTcom/long-ipfs-hash would work.

Additional considerations:

  • pinning IPFS content – even for simple Markdown text files, I need to ensure that the content is available. I think this means running a full IPFS daemon
  • embed / display images – I assume that using the img tag with a pointer to a gateway’d image should just work. Practically, this likely means keeping a blog posts folder with a sub folder per article where the markdown file and related images are kept
  • versioning – when a post is updated, a new file needs to be uploaded. The web permalink shouldn’t change, but can display pointers to old versions. This CAN be done manually. Some research on this lead me to some initial writing on IPNS

Research

My main machine is a Chromebook which is a bit of a wacky environment for local testing and development. You may have better luck with a more common Mac/Win/Linux setup, but the majority of the repos below are relatively old / outdated :slight_smile:

However, IPFS installs and runs on Chrome machines using chromebrew easily:

crew install ipfs

TO DO: probably want to have the datastore somewhere else so it doesn’t get blown away.

IPFS.ink

A Rust + Node system for having a web interface to write Markdown, with previews, and post to IPFS. It is up and running at https://ipfs.ink and can be used, but doesn’t solve my need to have my own IPFS gateway.

I did get this pushed to Heroku and built using a rust buildpack, but the web front end is a small Node server which all of a sudden means running two buildpacks and I couldn’t get the two running together on my local machine.

Github - https://github.com/kpcyrd/ipfs.ink

IPFS-markdown

A very simple project in Go where you can embed / display markdown files that are already hosted on IPFS. This would do for having my own domain / gateway. The project appears to be stale, I couldn’t get it to build.

Github - https://github.com/Luzifer/ipfs-markdown

IPFS-wiki

More of a proof of concept. Supports basic markdown and WikiNames linking. I like the concept of this very much and would love to get to something like this.

Github - https://github.com/jamescarlyle/ipfs-wiki

IPFS.pics

PHP + database server to display / host images on IPFS. Live at https://ipfs.pics/ (well, showing a maintenance error, so may not actually be up and running)

Github - https://github.com/ipfspics/ipfspics-server


#2

I’ve set up an IPFS gateway for my client project actually. We had the same issue- we wanted to pin files so that they would be permanent. The Infura IPFS gateway (https://ipfs.infura.io) is still in testing, but they plan on offering account soon so that people can pin files.

Anyway, I’m all about repeatable infrastructure. I like your attempt with Heroku; that would make it easy to spin up another node.

I used Docker to set up IPFS with an Nginx reverse proxy (for https) then deployed it using Ansible onto EC2. I’m super happy with the setup; I can run the production environment locally using Docker Compose, and easily update our production box with an Ansible playbook.

I’m planning on doing a write-up to help others set it up as well. It was a little tricky.

I think it’s interesting that you’re doing it on a Chromebook! You’re really pushing the limits with that little thing eh? :slight_smile:

If you’re comfortable on the command line I’d recommend spinning up an EC2 instance so you can run a full blown Linux distro. You can setup Docker, IPFS, and all the goodies.


#3

Awesome - yes, HOWTOs needed, do share the write up!

Ideally I’d like a serverless option, like Heroku. I need to write more about this, but I think Docker / containers is not the right direction for programmable infrastructure.

Getting my own stuff in a sort of blog where I connect to another IPFS node like Infura would be OK. Perhaps I’ll go back and spend time on that as the first goal. I can even use ipfs.ink as is to post files (except I can’t make a mistake!)

The Chromebook is a full Linux box (it’s Gentoo underneath), and if I was a better sysadmin I could probably get even more stuff up and running :wink:

I know I can follow instructions to get a full server / VM / container running. But that just proves once again that these things are too heavyweight for individuals to run and maintain. Maybe when an incentive system goes live I can pay a small bounty to keep the files pinned.