How I tried putting this blog up on IPFS, and my thoughts on IPFS.

So, on a whim, I decided to put my blog up on IPFS. Because I had the daemon installed, running and configured since couple days now, and it was doing nothing since then.

So, I host my blog on git, and I deploy it via Drone CI. I thought of integrating IPFS into my CI pipeline, but since my IPFS daemon runs on another Docker container, it would be very hard to combine both. Or at least that’s what I’m thinking right now. (I’m writing this as I go)

Trying to get the blog on IPFS

admicos@server:~/ipfs/export$ alias ipfs
alias ipfs='docker exec ipfs ipfs'
admicos@server:~/ipfs/export$ sudo cp ~/static-sites/ blog -r
admicos@server:~/ipfs/export$ ipfs add -r /export/blog/

Is that it, really? Let me try visiting the link…

…and no CSS, no links. Awesome!

Searching around, I found this piece of code. And it worked on localhost. Would it work on IPFS?

admicos@server:~/ipfs/export$ yes|sudo rm -r blog/
admicos@server:~/ipfs/export$ sudo cp ~/static-sites/ blog -r
admicos@server:~/ipfs/export$ ipfs add -r /export/blog/

Checking… And it works!

Now, the problem is that every time I update the blog, I’ll need to share a new URL, and that’s kind of bad.

And that’s where DNSLink comes in. You set up a TXT record, and everything will work just well as long as you update that TXT record with each update.

But that can’t be automated.

Well, technically it can be, but I don’t really want to mess with Namecheap’s (my DNS provider) API for a small thing most likely no one will care about.

So that’s out of the question.

IPNS? I heard that it’s slow, and it’s not as readable as DNSLink. I really wouldn’t prefer going to an IPNS address rather than an HTTPS address. And since I’m not using DNSLink, it wouldn’t auto-redirect for people who want to see IPFS content.

So, that’s it for the blog thing. I never expected to be able to finish this properly, but it was sure fun.

My thoughts on IPFS

Ultimately, I don’t think IPFS is the right tool to use for this. It’s a tool for things that need more “distribution”, and I don’t think it’s useful for small sites like mine. Maybe if you suddenly get a lot of traffic, it could help ease the load on your server, (assuming you gave out IPFS links in the first place) but I don’t expect anyone to read these at all.

I’m not entirely sure if I’ll keep my IPFS daemon running, but this was surely a good experiment. If nothing, I learned how to work with IPFS a little better, for a possible future where I might need it.