Adding ipfs ignore support to go-ipfs

The basics of our CLI tool works by communicating via our Web API. But, rather than using regular https connections to move files around, we use a locally installed go-ipfs node directly. This means that we use the ipfs protocol natively to do file operations, and then use our CLI to only have to send pin commands and other requests specific to our service. Our guide has more details on how all this works.

One of the things we wanted to support is ignoring files. If you ipfs add a folder, all the files inside of it, including traditionally “hidden” files like .env or a directory like .ssh, will get added to IPFS. And added immutably. Not great, and it’s why .gitignore exists.

We ended up implementing an ignore feature directly in our CLI tool since we thought this was a pretty important developer quality of life feature that we couldn’t wait to be implemented. There was an existing go-ipfs PR from 2017 that needed work.

Now, we’ve hired a freelance GoLang developer (sourced through Gun.io, which has been a good experience so far), to implement this feature in the go-ipfs codebase, to see if there is interest in having this part of core IPFS functionality. Yay open source!

The developer we’re working with, Cornelius @corntoole, built a version that added this functionality and we did some testing and feedback within the Fission team.

Since go-ipfs works with a bunch of sub-modules, Cornelius put together a little mini “mono-repo” for working across all the modules he needed to, which is a pretty great approach: https://github.com/corntoole/go-ipfs-stack

Now, we’ve submitted initial PRs and gotten some initial code reviews from @dirkmc – thank you!

Please have a look at the PRs and give your own feedback, or leave a comment to let us know what else you’d like to see out of an ipfs ignore feature: