Occasionally I work on a project that I want in version control, duplicated in a central location, but don’t want to throw it into the public eye. I don’t need much to accomplish this – a Raspberry Pi sitting headless on my home network works perfectly.
Basically, I use git+ssh to do operations on my repos remotely, and klaus + gunicorn to browse and dig through my repos when I want to.
It’s a pretty smooth setup!
The most complicated parts of this setup are:
- I use a
virtualenvto wrap gunicorn, klaus, and dependencies in their own python environment
- I use this gunicorn command (which uses
klaus.contrib.wsgi_autoreloadpointed at a single directory containing only git repo subdirectories):
exec /path/to/gunicorn -w 1 -b 0.0.0.0:80 \ --env KLAUS_SITE_NAME="You Have The GITS" \ --env KLAUS_REPOS="/path/to/git/repo/parent/dir" \ --log-level error --log-file /var/log/klaus.log \ klaus.contrib.wsgi_autoreload
Combined with some basic ssh configuration (setting up a Host ‘shortcut’ in my
~/.ssh/config file and authorizing my public key for a user on my raspberry pi), this method is very low-friction to work with and I get a nice UI to browse my source with, if I want!