Registry In A Box
NodeConf 2014 was fantastic! I love the format, and the location. It was my first NodeConf, and I enjoyed every bit of it.
Except the Internet connection.
While the WiFi itself was fine, with hundreds of us trying to download packages from the npm registry at the same time, the tiny Internet connection at Walker Creek Ranch left something to be desired. Some folks set up their own registry mirrors on the local network, which was great, but that meant finding their URLs on whiteboards here and there.
reginabox is a solution to this, providing discoverable npm registry mirrors for situations like NodeConf, where the network is great, but the Internet bandwidth is limited.
If you're going to NodeConf 2015 at Walker Creek Ranch, you should install reginabox on the machine that you'll be bringing:
$ [sudo] npm i -g reginabox
Then, once you're at the event, you can run this to discover local npm registry mirrors:
$ reginabox discover
This will list available mirrors and how up-to-date they are. Then, once you've chosen a suitable one, you can set it as your registry, and you're all set:
$ npm config set registry <url>
That's all there is to it! We'll be bringing at least one dedicated mirror machine, but if you'd like to provide your own, keep reading. The process is pretty simple.
You'll want to get this started a few days before the day you leave for NodeConf, as the mirroring process can take days. Get yourself a big hard drive (2TB should be sufficient to handle the registry for the foreseeable future), and a machine to host it, with WiFi. You'll need a case-sensitive filesystem on the drive. Once your OS installed and the hard drive is mounted, install node.js and reginabox as above.
Then, in a directory that's on the hard drive, do this:
$ reginabox mirror
This will kick off the mirroring process. It's running registry-static behind the scenes to download the entire registry to disk and keep up to date with changes as long as it's running. It also runs an HTTP server that serves up all the tarballs and metadata, and acts as a registry server, which is exposed on the network via mDNS, so that it's discoverable by reginabox discover.
Make sure you run this right up until the time you leave for the event, and then start running it again as soon as you get there, so that you minimize the amount of data that needs to be transferred using the event's Internet connection. It's probably best to wrap it up in some kind of process monitoring like upstart or monit, as you'll pretty much always want this to be running.
I hope this helps us use the Internet at NodeConf more efficiently this year. Everything is on github so feel free to open issues or pull-requests. See you all at Walker Creek Ranch!










