Ride home

Currently riding on the max writing this update on my phone. Trying to find a decent markdown editor to write with. I’ve updated my setup. I’m using syncthing to sync my Hugo folder instead of nextcloud which is what I was using previously. This allows me to edit and publish on the move. I also have connectbot ssh client running so that I can run the Hugo build process on my server. I’m going to try and figure out how to do that from my phone.

Edit: I came up with a new deploy script that will publish my site directory to ipfs and then configure nginx with the new hash

# deploy.sh
hugo && echo "proxy_pass http://dweb.link/ipfs/$(ipfs add -r hsite/public|tail -n1|cut -d ' ' -f2)/;" > /root/ipfs_hash && service nginx reload

Let’s tear this down. First, the script runs hugo which builds the static site, then$(ipfs add -r hsite/public|tail -n1|cut -d ' ' -f2) tells the computer to run a sub script that runs the ipfs binary on the public folder of my static site, and then takes the second column of the last line which is the hash of the main directory. It then interpolates this into the proxy_pass directive of nginx which acts like a reverse proxy to dweb.link which is an IPFS gateway node. The entire string is piped to a config file which I include in my nginx config, then nginx is reloaded with new config.