Skip to content

Instantly share code, notes, and snippets.

@fawkesley
Last active September 23, 2018 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fawkesley/2c1978ee8ceff587fc980565179d6349 to your computer and use it in GitHub Desktop.
Save fawkesley/2c1978ee8ceff587fc980565179d6349 to your computer and use it in GitHub Desktop.
Installing Hockeypuck with PostgreSQL on
# /etc/supervisor/conf.d/hockeypuck-supervisor.conf
# Do `service supervisor reload` then start/stop with `supervisorctl start hockeypuck`
[program:hockeypuck]
user=hockeypuck
directory=/home/hockeypuck
command=/home/hockeypuck/bin/hockeypuck -config /home/hockeypuck/etc/hockeypuck/hockeypuck.conf
redirect_stderr=true
autorestart=true
startsecs=10

Commit: https://github.com/hockeypuck/server/commit/16d0faf8f5091cc0fe21f2af161098c3aeb7caac

Target server: Debian GNU/Linux 9.5 (stretch)

Create hockeypuck user

sudo useradd --create-home --shell /bin/bash hockeypuck

Cross compile Hockeypuck from Ubuntu 16.04

Using go1.10.3 linux/amd64

# GOPATH=~/go
git clone github.com/hockeypuck/server $GOPATH/src/github/hockeypuck/server
cd $GOPATH/github.com/hockeypuck/server
go get -t -v ./...

Copy hockeypuck binaries to server

scp $GOPATH/bin/hockeypuck* [server]:/home/hockeypuck/bin

Create postgres database

$ sudo su postgres
postgres@www:~$ createuser hockeypuck
postgres@www:~$ createdb --owner hockeypuck hockeypuck
exit

Load dump files

# as hockeypuck user

mkdir ~/keydump && cd ~/keydump
wget -crp -e robots=off -l1 --no-parent --cut-dirs=3 -nH -A pgp,txt http://stueve.us/keydump/
~/bin/hockeypuck-load -config ~/etc/hockeypuck/hockeypuck.conf ~/keydump/*.pgp

After some time you see messages like this:

INFO[0476] inserted 60000 keys from "/var/lib/sks/dump/sks-dump-0000.pgp" in 7m30.559565776s

Inspect postgresql

sudo su postgres
psql hockeypuck
\dt
select count(*) from keys;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment