
BugSink on FreeBSD
A friend of mine recently came across a Sentry-compatible bug tracking server called BugSink. I have been wanting to host something like Sentry for a while, but I struggled finding a good fit. So I was excited when he shared BugSink with me, and I realized I should be able to launch this using FreeBSD.
I decided to go with the Virtual Environment installation instructions, as (found here)[https://www.bugsink.com/docs/local-install-using-virtualenv/].
But, first things first, I want to host this thing a jail. So I first set that up.
## Jail Creation
# zfs create zfs/jails/bugsink
# cd /jaijls/busink
# fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.3-RELEASE/base.txz
# tar xJf base.txz
# rm base.txz
# echo 'nameserver 9.9.9.9' > etc/resolv.conf
That gets me the base files, but then I want to manage this using my host's rc.conf
file. So I need to add an entry into my /etc/jail.conf
file for this:
bugsink {
$ip = 100;
persist;
}
This is a short entry, because I have a global config at the top of the file so I don't have to configure a bunch of stuff for each entry.
Then I start the jail:
# service jail onestart bugsink
Then I update and add some software:
# pkg -j bugsink update
# pkg -j bugsink install python311 rust py311-maturin py311-sqlite3
Now I want to enter the jail, and configure BugSink:
# jexec -l bugsink sh
# mkdir -p /opt/bugsink
# cd /opt/bugsink
# python3.11 -m venv env
# . env/bin/activate
# pip install bugsink
At this point, I should have the BugSink program. But we still need to configure it, and then setup a script to automatically start it when the jail starts.
(env) # ./env/bin/bugsink-show-version
1.7.1
(env) # ./env/bin/bugsink-create-conf --template=local --port=8000
Configuration file created at bugsink_conf.py
Edit this file to match your setup
(env) # ./env/bin/bugsink-manage migrate
You might have noticed that I haven't configured any other database, so this is going to use a SQLite file, which is fine for now, as I just want to get the basics up and running, and I don't have any critical data for the moment. But when I do have that requirement, I would definitely hook this into either my existing PostgreSQL server, or setup a new one just for this.
Next I need a superuser (this is based on Django, so you might see some similarities):
(env) # ./env/bin/bugsink-manage createsuperuser
That has a short couple steps to setup a user, then you should be ready to launch this thing.
Since I'm running this behind a proxy, I ended up adding this line to the bugsink_conf.py
file:
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
The last part is to setup a service file. I'll leave that as an excercize for the reader, as I need to work that part out myself still :-)