Skip to content

Django application for the mongoose backend & board interface

License

Notifications You must be signed in to change notification settings

svsticky/undead-mongoose

Repository files navigation

Undead Mongoose

Django application for the mongoose backend & board interface.

Prerequisites

Install uv and then let uv install the correct python version and the dependencies.

git clone https://github.com/svsticky/undead-mongoose.git
cd undead-mongoose
uv sync

Setting up

Copy sample.env to .env and make sure the database options are correct. By default the credentials are setup to use the docker database. Then run the following commands to setup the database:

docker compose up -d
uv run --env-file .env ./manage.py migrate

In development, create an admin superuser

uv run --env-file .env ./manage.py createsuperuser

Then depending on whether you want to use a local version of koala, you need to do some additional setup:

  • If you have a locally running version of koala: (In development) Change KOALA_DB_NAME to koala-development

    Create the undead_mongoose user in Koala's database:

    CREATE USER undead_mongoose WITH PASSWORD 'mongoose123';

    Configure privileges for the undead_mongoose user in Koala's database (Replace koala with koala-development in development):

    \c "koala"
    GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO undead_mongoose;

    To enable oauth, you should go to koala.rails.local:3000/api/oauth/applications and create a new application with {{ canonical_hostname }}/oidc/callback/ as the callback url.

    It's also possible to generate the client through your CLI in the constipiated-koala project by running the command below

    bundle exec rake "doorkeeper:create[undead Mongoose, http://localhost:8000/oidc/callback/, openid profile email member-read]"

    Ensure scopes 'openid member-read email profile' are present. Also ensure to copy the application_id and secret and put them in your .env file.

    API_TOKEN=koala
    
    OIDC_RP_CLIENT_ID=example_id
    OIDC_RP_CLIENT_SECRET=example_secret
    
    ALLOWED_HOSTS=localhost

    Make sure that the OIDC_OP_*_ENDPOINT endpoints are correct. The ones in sample.env should suffice.

    Alter Koala's .env file such that the following keys have the following values:

    CHECKOUT_TOKEN=koala
  • Alternatively, use the staging version of koala: create an oauth application for your mongoose installation via https://koala.dev.svsticky.nl/api/oauth/applications. Make sure you log in with the [email protected] account to access the page. Create a new application with the following information:

    • Confidential: true
    • Callback url: http://localhost:8000/oidc/callback/
    • Scopes: openid profile email member-read

    Copy the application id and secret into the .env file and make sure you update the oauth urls to point to koala.dev.svsticky.nl.

Running

# Database
docker compose up -d

# Server
uv run --env-file .env ./manage.py runserver

About

Django application for the mongoose backend & board interface

Topics

Resources

License

Stars

Watchers

Forks