Skip to content

Instantly share code, notes, and snippets.

@finngreig
Last active November 14, 2022 10:34
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 finngreig/5991cd26defb1d41ca22e949c6d5d77e to your computer and use it in GitHub Desktop.
Save finngreig/5991cd26defb1d41ca22e949c6d5d77e to your computer and use it in GitHub Desktop.
Honk installation on Alpine Linux
# install the required dependencies
doas apk update
doas apk add build-base mercurial go sqlite sqlite-libs sqlite-dev
# build honk
cd ~
hg clone https://humungus.tedunangst.com/r/honk && cd honk && make
# create dir to store honk and its data in
doas mkdir /var/honk
doas chown -R alpine:nobody /var/honk # we'll take temporary ownership to make setup easier
# move honk in to its new home :)
cp ~/honk/honk /var/honk/honk && cp -r ~/honk/views/ /var/honk/views/
# init honk
# follow the prompts:
# username: (the username you want)
# password: (the password you want)
# listenaddr: (tcp or unix: 127.0.0.1:31337, /var/www/honk.sock, etc.) - I used 127.0.0.1:8080
# servername: (public DNS name: honk.example.com)
cp /var/honk
./honk init
# install caddy
doas apk add caddy
# edit caddyfile and replace with my caddyfile
# (i use nano but you can use whatever)
doas nano /etc/caddy/Caddyfile
# create an openrc unit for honk
# paste in my openrc unit
doas nano /etc/init.d/honk
doas chmod +x /etc/init.d/honk
# set permissions on /var/honk accordingly
doas chown -R nobody:nobody /var/honk
# start everything and check it works
doas rc-service honk start && doas rc-service caddy start
# navigate to your domain and check that you get a very purple page :)
# persist honk and caddy across reboots
doas rc-update add caddy && doas rc-update add honk
# Insert your domain below
example.com
reverse_proxy :8080
#!/sbin/openrc-run
honk_dir="/var/honk" # or wherever
command="/var/honk/honk" # full path to honk binary, should be chmod +x by the go compiler
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"
command_user="nobody:nobody"
command_args="-datadir ${honk_dir} -viewdir ${honk_dir}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment