Application management for SAGW
Requirements
- docker
- docker-compose
After installing and configuring those, download docker-compose.yml and run the following command:
echo "UID=$(id -u)" > .env
touch ./caluma/.env
docker-compose up -d
NOTE: if you run into trouble with authorizing with caluma or the api client you might
need to override the credentials in the compose or override configs e. g. by setting
these env vars in ./caluma/.env
OIDC_ADMIN_CLIENT_ID=test_client
OIDC_ADMIN_CLIENT_SECRET=<SECRET>
Wait for the database migrations to complete for the API and Caluma.
Load the config data into Caluma:
make caluma-loadconfig
Import the Keycloak config:
make keycloak-import-config
Add mysagw.local
to /etc/hosts
:
echo "127.0.0.1 mysagw.local" | sudo tee -a /etc/hosts
You can now access the application under the following URIs:
- https://mysagw.local/ --> frontend
- https://mysagw.local/auth/ --> keycloak
- https://mysagw.local/api/ --> backend
- https://mysagw.local/graphql/ --> caluma
- https://mysagw.local:8025 --> mailhog
The default users are:
Username | Password | Used for |
---|---|---|
admin | keycloak | keycloak admin |
admin@example.com | mysagw | apps |
staff@example.com | mysagw | apps |
user@example.com | mysagw | apps |
mySAGW is a 12factor app which means that configuration is stored in environment variables. Different environment variable types are explained at django-environ.
If there are manual steps needed, you can find those in the wiki.
After deployment, rename Next deployment
to the date you deployed. If you have steps for the next deployment, just add them at
the top with Next deployment
again.
cp -r ./.envs/.production.example ./.envs/.production
Then edit the files under ./.envs/.production/
to your needs.
For the staging environment, copy to ./.envs/.staging/
.
echo -e "UID=$(id -u)\nCOMPOSE_FILE=docker-compose.yml:docker-compose.prod.yml" > .env
# on staging environments:
# echo -e "UID=$(id -u)\nCOMPOSE_FILE=docker-compose.yml:docker-compose.staging.yml" > .env
# Also in .env file, set OIDC_HOST variable
docker compose up -d
# Wait for the database migrations to complete for the API and Caluma.
make caluma-loadconfig
# upload the templates to DMS
docker compose run --rm api python manage.py upload_template identity-labels.docx \
accounting-cover.docx acknowledgement-de.docx acknowledgement-fr.docx \
acknowledgement-en.docx credit-approval-de.docx credit-approval-fr.docx \
credit-approval-en.docx application.docx
Look at our contributing guidelines to start with your first contribution.