-
Notifications
You must be signed in to change notification settings - Fork 3
Deployment
Disclaimer: this guide assumes that git & docker are installed.
All commands are relative to Infrastructure/docker-compose-prod.yml
Pull mp-access/Infrastructure repo
git clone https://github.com/mp-access/Infrastructure.git
Add .env
file with env variables inside cloned Infrastructure
repo
# Default environment variables
# Docker will inject these variables in the docker-compose file.
# These values will be overwritten if shell contains the same variables
# Database credentials
DB_USER=<postgres user>
DB_PASSWORD=<postgres password>
# Identity provider credentials
KEYCLOAK_USER=<keycloak admin user>
KEYCLOAK_PASSWORD=<keycloak admin password>
KEYCLOAK_REALM=access
AUTH_SERVER=https://info1-exercises.ifi.uzh.ch
JWK_URI=http://keycloak:8080/auth/realms/access/protocol/openid-connect/certs
# Mongo DB credentials
MONGO_DB_NAME=<mongodb DB name>
MONGO_DB_USER=<mongodb username>
MONGO_DB_PASSWORD=<mongodb password>
GITHUB_WEBHOOK_SECRET=<secret for github webhooks>
GITLAB_WEBHOOK_SECRET=<secret for gitlab webhooks>
NGINX_CONF=conf-prod.nginx
DOCKER_WORKER_HOST=<location of docker worker host>
mkdir backend-config && touch ./backend-config/repositories.json
Example contents
{
"repositories": [
"https://github.com/mp-access/Template-Course",
"https://github.com/mp-access/Mock-Course"
]
}
mkdir ./logs
Add TLS certificate chain + private key for frontend:
Check docker-compose-prod.yml
to see where to put them on the host.
chmod o+r frontend-config/*
Add the certificates that our backend needs to do mutual authentication with our docker worker.
Check docker-compose-prod.yml
to see where to put them on the host.
At the moment under ./docker-certs
ca.pem
cert.pem
key.pem
Add .ssh
folder with ssh keys and config for private repos (see Private repositories)
mkdir ./.ssh
mkdir -p ./volumes/mongodb
mkdir -p ./volumes/postgres
Start containers
docker-compose -f docker-compose-prod.yml up -d
Add custom themes (emails, login, etc.). Check the docker-compose file for the correct path. At the moment under:
./keycloak-themes/access:/opt/jboss/keycloak/themes/access
- Create realm, e.g.
access
. Make sure it is enabled. - Clients -> create -> Client ID:
course-service
. Use openid-connect; Access Typebearer-only
.
- Clients -> create -> Client ID:
access-frontend
. Use openid-connect.
- Mappers -> create ->
Course service audience
- Mappers -> create ->
Groups
- Set email limits
(6. Set realm role for analytics)
- Add a realm-wide role called
access_admin
. - For each group which should have access, add the realm role.
Frontend needs the correct keycloak.json
file. This can be exported from keycloak after setting up the frontend application.
- Home
- Configuration
- [Course Configuration]
- [Assignment Configuration]
- Exercise Configuration
- Concepts