Warning: There is a known issue with hosting UDOIT on Heroku. Courses with large amounts of content can cause UDOIT to scan for longer than Heroku allows, resulting in a failed scan appears to never complete. We do not recommend using Heroku for hosting your production instance of UDOIT at this time. The instructions below are left here for reference.
Installing UDOIT on Heroku requires some technical knowledge. We recommend that you have an IT staff member perform the steps below.
Click the Heroku button and follow the instructions below:
- Create an account (if you don't have one already).
- Give the app a name.
- Set
APP_ENV
toprod
for the production version of UDOIT. Please note: Thedev
environment is not available on Heroku. - Set
APP_LMS
to the name of your LMS.canvas
if you are using the Canvas LMS.d2l
if you are using the D2l Brightspace LMS.
- Fill out the
BASE_URL
field withhttps://yourapp.herokuapp.com
. (Replace 'yourapp' with the name you gave in step 1.2.) - Fill out the
JWK_BASE_URL
field with the URL to your LMS. The default value works for instructure hosted instances of Canvas, but will need to be modified if your JWK configuration is hosted at a different domain thaniss
. - Click the Deploy button and wait for the process to complete.
The above deploy uses the Heroku Postgres Mini plan by default. Please check https://elements.heroku.com/addons/heroku-postgresql
for Heroku Postgresql plan details. You can upgrade Postgresql plan inside Heroku UI later.
Next we need to set up the database and insert our institution in to the appropriate table.
- Click "Manage App" or go to
https://dashboard.heroku.com/apps/yourapp
. (Replace 'yourapp' with the name you gave in Step 1.2.) - In the top-right corner, click "More", then click "Run Console".
- In the
heroku run
field, typebash
and click Run. - Run the database migrations by running the following command in the Console:
php bin/console doctrine:migrations:migrate
- If
APP_ENV
is set toprod
you will need to generate the doctrine proxy classes by running the following command in the Console:
php bin/console cache:warmup --env=prod
- Set up developer keys according to the instructions in INSTALL_<LMS>.md.
- Access the Postgres database by running the following command in the Console:
psql <the DATABASE_URL located in your config vars under the Settings tab>
- Insert your institution in to the institution table as described in INSTALL_<LMS>.md. It may be something like:
INSERT INTO institution (id, title, lms_domain, lms_id, lms_account_id, created, status, vanity_url, metadata, api_client_id, api_client_secret) VALUES (0, 'Canvas', 'myinstitution.instructure.com', 'canvas', '1', '2021-10-21', true, 'vanity.example.com', '{"lang":"en"}', '123456', 'abcdefghijklmnopqrstuvwxyz');
(DO NOT copy that command and use it as-is!)
Install the app following the instructions described in INSTALL_<LMS>.md.
If you make changes to the source code of UDOIT, and you'd like to deploy those changes to your Heroku instance, follow these instructions.
- Follow the instructions under the 'Source Code' section of INSTALL.md.
- Install and log in to the Heroku CLI.
- Next, from within your UDOIT's root folder on your machine, connect your local repository to Heroku:
heroku git:remote -a your_app_name
- Finally, run the following to upload the source to Heroku:
git push heroku main:master -f
- Go to 'Settings' --> 'Buildpacks' --> 'Add Buildpack'.
- Add 'php' and 'nodejs'.
- Go to 'Settings' --> 'Config Vars' --> 'Reveal Config Vars'.
- Add the following:
- APP_ENV = prod
- APP_LMS = <LMS>
- BASE_URL = <Heroku app URL>
If you intend to use your own databse, set a DATABASE_URL config var to your database's url. To use Heroku Postgresql:
- Go to 'Resources' --> 'Add-ons' --> 'Find more add-ons'.
- Find 'Heroku Postgres' and then install.
Continue with the steps outlined in the previous section.