Set up backend

Create environment variable file

cd /srv/server/glitchtip
nano env
DATABASE_URL="postgres://glitchtip@/glitchtip?host=/var/run/postgresql"
SECRET_KEY="some_randomly_generated_string"
REDIS_HOST=localhost
REDIS_DATABASE=13
EMAIL_URL="smtp://glitchtip@localhost"
DEFAULT_FROM_EMAIL="glitchtip@example.com"
GLITCHTIP_DOMAIN="https://bugs.example.com"

Don't forget to set the SECRET_KEY to a secret random string. This example assumes you have an SMTP server running on localhost and want to use Redis table 13.

Check glitchtip.com/documentation/install#configuration for more information about these options.

I know that always having to load the env file is not ideal, but I can't think of another way without code changes to glitchtip.

Database migration

All of the following commands assume they are run as glitchtip user, using the python binary from the virtualenv (/path/to/new/virtual/environment/bin/python) and have the above environment variables loaded.

One way to do this is to run

sudo -u glitchtip bash
export $(cat ../env | xargs) # repeat after editing env
/srv/venv/glitchtip/bin/python manage.py THECOMMAND`

For the database migration run

python manage.py migrate

If you get any connection errors, check the DATABASE_URL above and if your PostgreSQL user exists.


Revision #8
Created Fri, Jan 29, 2021 7:12 PM by Lukas
Updated Fri, Jan 29, 2021 7:39 PM by Lukas