I got a second laptop recently, and need to sort out file syncronization. I’m evaluating using git on a common folder, with each laptop working off their own branch. This means I need a git server.

I’m not sure what I’ll end up needing for this, so I’ll set up a “standard” git web frontend. GOGS is supposed to be light-weight, so I’m starting with that.

Installation on SmartOS

My services are all hosted on SmartOS, in Joyent zones where possible. GOGS only requires go, which is available via pkgsrc, so we’ll start there. It turns out that this is not a common enough platform that there exists a pre-built package, so source code, here we come.

Building from Source

The directions are simple. I’ll be running it in a dedicated zone, but building it first:

in build zone:

pkgin in git go gcc12
git clone --depth 1 https://github.com/gogs/gogs.git gogs
cd gogs
GOTMPDIR=. go build -o gogs

in target zone:

Copy out the compiled binary into the target zone and test it out.

./gogs web

(Don’t forget to install git.)

Configuration

From this point, everything is exactly the same as the docs EXCEPT for svcconfig, attached to this post. You’ll need to edit the paths for your specific deployment, and then import the service file with svccfg import.