- Perform the configuration steps outlined here
- Install Docker and docker-compose
- From your terminal, run
docker-compose build
followed bydocker-compose up
in the root OnTask directory - If this is the first time running, the following must be performed:
- Attach to the backend container by running
docker-compose exec backend sh
- Initialise the database by running
python3 manage.py makemigrations accounts
,python3 manage.py makemigrations
and lastlypython3 manage.py migrate
- Load data into user groups by running
python3 manage.py loaddata user_groups
- Create the first admin user by running
python manage.py createsuperuser
- Create a
term
Table in the ontask Database (you can use a Database client like MongoDB Compass) and importTerm Codes.csv
(or create your own Terms). This is to ensure that you have Terms to search and create containers via the UI.term
table should have fields: code (number), name (string), start (date), end (date)
- Attach to the backend container by running
- In order to work with LTI via localhost, the application runs in SSL mode with self-signed certs
- This will require adding an exception in your browser for both https://localhost:3000 and https://localhost:8000
- Complete steps 1-4 from above, however, instead run
docker-compose -f docker-compose.prod.yaml up
(in step 3) - Compile the frontend by running
npm run build
in the frontend directory - Serve the files in the
frontend/build/
directory as a static website (e.g. through S3 behind a CloudFront distribution) - Add a proxy pass in your webserver configuration from your backend domain (e.g. api.ontask.org) to http://localhost:8000 (not https)
- Create an environment file
env.py
in thebackend/ontask/
directory - Run
pip install cryptography
- From a Python shell, run the following command:
from cryptography.fernet import Fernet
# The following generated secret key will be used for encrypting sensitive data
# Loss or change of the secret key will result in the loss of all datasource passwords
# This is a breaking issue for dynamic data sources, as update attempts will fail
Fernet.generate_key().decode("utf-8")
- Configure the environment file as follows:
SECRET_KEY = "<SECRET_KEY_GENERATED_ABOVE>"
# List of admins that will recieve user signup notifications via email
ADMINS = ["<ADMIN_EMAIL_1>"]
FRONTEND_DOMAIN = "https://<YOUR_FRONTEND_DOMAIN>"
BACKEND_DOMAIN = "https://<YOUR_BACKEND_DOMAIN>"
ALLOWED_HOSTS = ["<YOUR_FRONTEND_DOMAIN>"] # Without the protocol specified
# If uncommented, use the given named profile from your AWS credentials
# file (usually ~/.aws/credentials). Otherwise, boto3 will assume the AWS role
# of the server itself
# AWS_PROFILE = "<YOUR_AWS_NAMED_PROFILE>"
AWS_REGION = "<YOUR_AWS_REGION>"
ENABLE_CLOUDWATCH_LOGGING = False
DEMO_BUCKET = "<YOUR_S3_BUCKET>"
# SMTP credentials to enable email sending from OnTask
EMAIL_HOST = "<YOUR_SMTP_HOST>"
EMAIL_PORT = 587
EMAIL_NAME = "OnTask" # Default name to appear in emails sent
EMAIL_ALIAS = "<YOUR_EMAIL_ALIAS>" # Default alias email to use in emails sent
EMAIL_HOST_USER = "<YOUR_SMTP_USER>" # SMTP login user
EMAIL_HOST_PASSWORD = "<YOUR_SMTP_PASSWORD>" # SMTP login password
EMAIL_USE_TLS = True
EMAIL_BATCH_SIZE = 50 # Maximum number of emails to send at a time (i.e. a batch)
EMAIL_BATCH_PAUSE = 300 # Minutes to wait between batches of emails
# Configuration for AAF Rapid Connect
AAF_CONFIG = {
"secret_key": "<YOUR_AAF_SECRET>",
"aaf.edu.au": {
"iss": "https://rapid.aaf.edu.au", # https://rapid.test.aaf.edu.au for dev
"aud": "https://<YOUR_DOMAIN>", # https://localhost:8000 for dev
"idp": "<YOUR_AAF_IDP>",
}
}
LTI_CONFIG = {
"staff_role": "Instructor", # Role that will be added to the instructor group when coming from LTI
"consumers": {
"ontask": { # App name registered in LTI
"secret": "<YOUR_LTI_SECRET>"
}
},
"url": "<YOUR_LTI_URL>",
"username_field": "<YOUR_LTI_USERNAME_FIELD>", # Specify which field in the LTI payload maps to your institution's user ID
"auto_create_share_containers": True # Allows for the auto creation and sharing of containers in lti context.
}
- Create environment files
.env.development
(for development) and/or.env.production
(for production) in thefrontend/
directory - Configure the environment file(s) created above:
REACT_APP_API_DOMAIN = "https://<YOUR_BACKEND_DOMAIN>";
REACT_APP_AWS_ID = "YOUR_AWS_ID";
REACT_APP_AAF_URL = "<YOUR_AAF_IDP>";
// If uncommented, show the Register Account interface
// REACT_APP_DEMO = True
Package Name | License |
---|---|
React.js | MIT |
create-react-app | MIT |
react-router | MIT |
Ant Design | MIT |
Slate | MIT |
is-hotkey | MIT |
react-dnd | BSD |
react-draggable | MIT |
lodash | MIT |
moment | MIT |
query-string | MIT |
sanitize-html | MIT |
memoize-one | MIT |
highcharts | CC |
d3 | BSD |
Package Name | License |
---|---|
Django | BSD |
djangorestframework | BSD |
mongoengine | MIT |
django-rest-framework-mongoengine | MIT |
django-cors-headers | License |
uWSGI | GPL |
SQLAlchemy | MIT |
pyjwt | MIT |
boto3 | Apache |
celery | BSD |
django-celery-beat | BSD |
cryptography | Apache/BSD |
python-dateutil | Apache |
xlrd | License |
numexpr | MIT |
pandas | BSD |
djongo | AGPL |
PyLTI | BSD |