Edit page in Livemark
(2022-10-10 17:29)

This document contains additional tips for working with dribdat.

Troubleshooting

Guidance to common errors is listed below. For more background references, see the README.

Add results to my own web page

There is an Embed button in the event page and in the admin which provides you with code for an IFRAME that just contains the hexagrid. If you would like to embed the entire application, and find it more intuitive to hide the navigation, add ?clean=1 to the URL. To also hide the top header, use ?minimal=1. You might also invoke the dribdat API to pull data from the platform.

Navigation is not visible

Dark Bootswatch themes do not play well with the navbar-light component used in our layout (nav.html). Override the styles by hand using the DRIBDAT_CSS_URL environment variable.

Need help setting up SSO

To get client keys, go to the Slack API, Azure portal, or add the GitHub App to your account or organization. You can also use custom OAuth 2 provider if you provide all external registration URLs.

Cannot determine SSO callback for app registration? Try this:

<my server url>/oauth/<my provider>/authorized

Where the provider is slack, mattermost, ..

Restore admin access

Create a user account if you do not already have one. From the console, run ./manage.py shell then to promote to admin and/or reset the password of a user called "admin":

u = User.query.filter(User.username=='admin').first()
u.is_admin = True
u.set_password('Ins@nEl*/c0mpl3x')
u.save()

Cannot upgrade database

In local deployment, you will need to upgrade the database using ./manage.py db upgrade.

On Heroku, a deployment process called Release runs automatically. Note also the Socialize process which is used for refreshing user profiles.

If you get errors like ERROR [alembic.env] Can't locate revision identified by 'aa969b4f9f51', your migration history is out of sync. You can set FORCE_MIGRATE to 1 when you run releases, however changes to the column sizes and other schema details will not be deployed. Instead, it is better to verify the latest schema specifications in the migrations folder, fix anything that is out of sync, and then update the alembic version, e.g.:

alter table projects alter column webpage_url type character varying(2048);
insert into alembic_version values ('7c3929047190')

A handy parameter is --sql which shows just the SQL code you can also apply manually to fix your database. See also further instructions in the force-migrate.sh script.

Invalid input value for enum activity_type error

There were issues in upgrading your instance that may require a manual SQL entry. Try running these commands in your psql console:

ALTER TYPE activity_type ADD VALUE 'boost';
ALTER TYPE activity_type ADD VALUE 'review';

Test locally using SSL

Some development scenarios and OAuth testing requires SSL. To use this in development with self-signed certificates (you will get a browser warning), start the server with ./manage.py run --cert=adhoc

You can test SSO providers in this way by adding OAUTHLIB_INSECURE_TRANSPORT=true to your environment (do not use in production!)

Installation on Alpine Linux

The project has so far mostly been developed on Fedora and Ubuntu Linux. Users on Alpine, BSD and other distributions are welcome to share their experience with us in the Issues. Some additional system packages are needed for a successful local (non-Docker) deployment.

E.g. for Alpine or Ubuntu (apt instead of apk):

apk add libxml2-dev libxslt-dev libffi-dev rust cargo

Error compiling misaka

You are missing development headers for Python. For example, in Fedora Linux run:

sudo dnf install libffi-devel python3-devel

No profile images after updating

Run manage.py socialize users to restore the profile images. This is due to a change in the way they are stored, to make the profile more flexible.