Programming

Auto Publish Git Repos

Today, to both see if it could be done and to make dealing with all my source code easier, I setup a set of git repositories that automatically publish to IPFS when a “git push origin” is run. First, I setup the file structure to keep things organized. ./publish ./public/ ./public/ipfs-auto-repo.git ./public/ipfs-scanner.git # et cetera To initialize the repo being published, I did the following. git init cd public/ipfs-auto-repo.git git init --bare vim hooks/post-update This was then entered into post-update:

IPFS Scanner Post 3

I found why the scanner was only producing two pages: HTTP 301 Redirect. If you look at the Release Notes for v0.5.0 of IPFS, you will find a section labeled Subdomain Gateway that details a feature where the HTTP gateway will generate a redirect to a subdomain when accessing /ipfs/$HASH and /ipns/$HASH using localhost, but not when using 127.0.0.1. My code was checking for a status code of 202 and treating everything else as a failure.