You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: HEROKU.md
+98-10Lines changed: 98 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,14 +15,15 @@ After clicking the Heroku button above:
15
15
16
16
1. Create an account (if you don't have one already).
17
17
2. Give the app a name.
18
-
3. Fill out the `OAUTH2_ID` and `OAUTH2_KEY` fields with dummy data. (We'll fix it later.)
19
-
4. Fill out the `OAUTH2_URI` field with `https://yourapp.herokuapp.com/oauth2response.php`. (Replace 'yourapp' with the name you gave in step 2.)
20
-
5. Fill out the `CANVAS_NAV_ITEM_NAME` field with the name you would like the app to appear as in the course navigation menu. This is useful if your instance will be use for a pilot. The normal value to use here is ***UDOIT***.
21
-
6. (optional) Copy and paste your Google/YouTube API key into the `GOOGLE_API_KEY` field.
22
-
7. (optional) Copy and paste your Vimeo API key into the `VIMEO_API_KEY` field.
23
-
8. (optional) If you have a Google Analytics account, you can paste your site tracking code into the `GA_TRACKING_CODE` field.
24
-
9. (optional) If you would like to enable the Admin Panel, change the `ADMIN_PANEL_ENABLED` field to `true`.
25
-
8. Click the Deploy button and wait for the process to complete.
18
+
3. Set `OAUTH2_ENFORCE_SCOPES` to true if you have a scoped developer key.
19
+
4. Fill out the `OAUTH2_ID` and `OAUTH2_KEY` fields with dummy data. (We'll fix it later.)
20
+
5. Fill out the `OAUTH2_URI` field with `https://yourapp.herokuapp.com/oauth2response.php`. (Replace 'yourapp' with the name you gave in step 2.)
21
+
6. Fill out the `CANVAS_NAV_ITEM_NAME` field with the name you would like the app to appear as in the course navigation menu. This is useful if your instance will be use for a pilot. The normal value to use here is ***UDOIT***.
22
+
7. (optional) Copy and paste your Google/YouTube API key into the `GOOGLE_API_KEY` field.
23
+
8. (optional) Copy and paste your Vimeo API key into the `VIMEO_API_KEY` field.
24
+
9. (optional) If you have a Google Analytics account, you can paste your site tracking code into the `GA_TRACKING_CODE` field.
25
+
10. (optional) If you would like to enable the Admin Panel, change the `ADMIN_PANEL_ENABLED` field to `true`.
26
+
11. Click the Deploy button and wait for the process to complete.
26
27
27
28
### Step 3: Request a Developer Key
28
29
UDOIT uses Oauth2 to take actions on behalf of the user, so you'll need to ask your Canvas administrator to generate a Developer Key for you. (If you are an admin, go to your institution's account administration page in Canvas and click on 'Developer Keys'.) Here is the information you need to provide them:
@@ -33,6 +34,35 @@ UDOIT uses Oauth2 to take actions on behalf of the user, so you'll need to ask y
33
34
* This should be `https://yourapp.herokuapp.com/oauth2response.php`. (Replace 'yourapp' with the name of your UDOIT instance on Heroku.)
34
35
****Icon URL:*** The URL of the UDOIT icon. This is `https://yourapp.herokuapp.com/assets/img/udoit_icon.png`. (Replace ***yourapp*** with the name of your UDOIT instance on Heroku.)
35
36
37
+
#### Scoped Developer Keys
38
+
If you'd like to use this option, you'll need set the following scopes for your developer key.
1. In Heroku, click the 'Manage App' button for your install of UDOIT.
38
68
2. Go to the 'Settings' tab.
@@ -43,7 +73,7 @@ UDOIT uses Oauth2 to take actions on behalf of the user, so you'll need to ask y
43
73
44
74
### Step 5: Install the UDOIT LTI
45
75
46
-
In Canvas, you can install UDOIT at the course or sub-account levels.
76
+
In Canvas, you can install UDOIT at the course or sub-account levels.
47
77
48
78
1. Click the **Settings** menu item from any course in Canvas.
49
79
2. Click the **Apps** tab.
@@ -60,6 +90,8 @@ UDOIT should now be available in the course navigation menu.
60
90
61
91
# Manual Deploy on Heroku
62
92
93
+
**Warning: Recommended for advanced users only**
94
+
63
95
You can use our configuration to launch a new Heroku app using [Heroku's app-setups api](https://devcenter.heroku.com/articles/setting-up-apps-using-the-heroku-platform-api).
64
96
65
97
You'll have to set some env settings. Peek at [app.json](app.json) for any env vars that don't have `"required": false` set. Our config vars are covered in [Configure section](#configure)
@@ -79,7 +111,7 @@ curl -n -X POST https://api.heroku.com/app-setups \
79
111
80
112
Read the result to make sure it returned an id, not an error.
81
113
82
-
Check your Heroku dashboard or run `heroku apps` to see if a new app shows up. If all goes well, it should be running.
114
+
Check your Heroku dashboard or install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) and run `heroku apps` to see if a new app shows up. If all goes well, it should be running.
83
115
84
116
85
117
## Configure
@@ -129,6 +161,62 @@ If needed, you can manually run the table creation script: `heroku run composer
129
161
## Table Schema
130
162
The table schema can be found in [migrations/](migrations/)
131
163
164
+
# Upgrade an Existing Heroku Installation
165
+
166
+
When it comes time to update UDOIT to the latest version, you probably don't want to have to start over from scratch using the Heroku Button (as explained above). Luckily, there's a procedure for upgrading an existing installation, which allows you to keep your existing database, settings, and URL.
167
+
168
+
## First Time Setup
169
+
170
+
This process takes a while to set up the first time, but is very fast after that. On your computer:
3. Install [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) and follow the instructions to get your account set up.
175
+
4. Clone the UDOIT Git repository. If you are using a command line interface, navigate to a directory where you would like the code to live and run this command: `git clone git@github.com:ucfopen/UDOIT.git`. This will create a folder called `UDOIT` that contains the latest version.
176
+
5. In your command line interface, navigate into the newly-created `UDOIT` folder.
177
+
6. Run `heroku git:remote --app your-heroku-instance`, replacing `your-heroku-instance` with your actual heroku instance name. For example, if your UDOIT instance resides at `https://udoit-pcu.herokuapp.com`, you would run `heroku git:remote --app udoit-pcu`. This adds your Heroku instance as a ***remote*** called `heroku` in the Git repository so that you can push updates to it in the future.
178
+
179
+
## Pushing Updates to Heroku
180
+
181
+
Now that your computer is set up, you only need to follow these steps each time you would like to update your instance of UDOIT:
182
+
183
+
1. In your command line interface, navigate to the `UDOIT` directory on your computer.
184
+
2. Run `git checkout master` to make sure we're on the master branch, which represents the latest version of UDOIT.
185
+
3. Run `git pull` to update your local copy of UDOIT from the official GitHub repository.
186
+
4. Run `git push heroku master:master` to deploy the new version to your UDOIT instance.
187
+
5. Run `heroku run --app your-heroku-instance "php composer.phar migrate"` to update the database structure for your UDOIT instance. (Remember to replace `your-heroku-instance` with your Heroku instance name.)
188
+
6. Log into the Heroku website and click on your UDOIT instance.
189
+
7. Click **Settings**
190
+
8. Under the **Config Vars** heading, click **Reveal Config Vars**.
191
+
9. Compare them to the `env` section of [app.json](app.json), and add any missing variables to Heroku.
192
+
193
+
UDOIT should now be up to date with the latest release!
194
+
195
+
## Dealing with Multiple Heroku Instances
196
+
197
+
### First Time Setup (Test Instance)
198
+
199
+
The sections above assume you only have a single Heroku instance. However, we recommend you always have two instances: one for testing and one for production. That way, you can test out the deploy on your test instance without risking any downtime on your production instance. If you don't have a test instance, just use the [Heroku Button](#heroku-button) to create one. Assuming you set everything up for your production instance in the [First Time Setup](#first-time-setup) section above, here's how to set up your testing instance (sometimes called "staging" or "QA"):
200
+
201
+
1. In your command line interface, navigate to the `UDOIT` directory on your computer.
202
+
2. Run `heroku git:remote --remote test --app your-heroku-test-instance`, replacing `your-heroku-test-instance` with your actual heroku test instance name. For example, if your UDOIT instance resides at `https://udoit-pcu-test.herokuapp.com`, you would run `heroku git:remote --remote test --app udoit-pcu-test`. This adds your Heroku test instance as a ***remote*** called `test` in the Git repository so that you can push updates to it in the future.
203
+
204
+
Feel free to name the remote anything you want. It doesn't have to be `test`; it could be `staging` or `qa` or `blah`. It's best to make it something descriptive, though.
205
+
206
+
### Pushing Updates to the Test Instance
207
+
208
+
Now that you have the connection to the test instance set up, here's how to push an update to it:
209
+
210
+
1. In your command line interface, navigate to the `UDOIT` directory on your computer.
211
+
2. Run `git checkout master` to make sure we're on the master branch, which represents the latest version of UDOIT.
212
+
3. Run `git pull` to update your local copy of UDOIT from the official GitHub repository.
213
+
4. Run `git push test master:master` to deploy the new version to your UDOIT test instance.
214
+
5. Run `heroku run --app your-heroku-test-instance "php composer.phar migrate"` to update the database structure for your UDOIT test instance. (Remember to replace `your-heroku-test-instance` with your Heroku test instance name.)
215
+
6. Log into the Heroku website and click on your UDOIT test instance.
216
+
7. Click **Settings**
217
+
8. Under the **Config Vars** heading, click **Reveal Config Vars**.
218
+
9. Compare them to the `env` section of [app.json](app.json), and add any missing variables to Heroku.
* Git (If you are using [The Git Method](#the-git-method) below) or if you plan on contributing to UDOIT
57
58
58
59
## Downloading the Source Code
59
60
There are two methods of obtaining the source code and maintaining your installation of UDOIT: Git Clone or Download ZIP.
@@ -81,7 +82,7 @@ If you'd like to add a little extra security to your installation, you can confi
81
82
UDOIT uses [Composer](https://getcomposer.org/) to install PHP dependencies. So `cd` into your UDOIT directory and run this command before anything else:
82
83
83
84
```
84
-
$ php composer.phar install
85
+
$ php composer.phar install --no-dev
85
86
```
86
87
87
88
The libraries (other then Quail) that we rely on can be found in `composer.json`.
@@ -150,11 +151,49 @@ UDOIT uses Oauth2 to take actions on behalf of the user, so you'll need to ask y
150
151
* If you did a normal install into the web root of your server, it would be `https://www.example.com/public/oauth2response.php`. (Replace 'www.example.com' with the url of your UDOIT server.)
151
152
****Icon URL:*** The URL of the UDOIT icon. This is `https://www.example.com/public/assets/img/udoit_icon.png`. (Replace 'www.example.com' with the url of your UDOIT server.)
152
153
154
+
Your Canvas administrator will perform the following tasks:
155
+
1. Navigate to your institution's ***Account Admin panel*** in Canvas.
156
+
2. Click on the ***Developer Keys*** menu option.
157
+
3. Click the ***+ Developer Key*** button and select the ***API Key*** option.
158
+
4. Enter the data provided above into the form, leaving the ***Redirect URI (Legacy)*** and ***Vendor Code (LTI 2)*** fields blank.
159
+
5. (Optional) If you would like to Enforce Scopes on this developer key, which limits this Developer Key to only allow access to the functions UDOIT requires, enable the option and check the boxes outlined in the [Scoped Developer Keys](#scoped-developer-keys) section below.
160
+
6. Click ***Save Key***
161
+
7. Find the new Developer Key in the list, and send the values from the ***Details*** column to the person requesting the key. The top value is the ***Oauth2 ID***, and the value revealed by clicking on the ***Show Key*** button is the ***Oauth2 Key***.
162
+
153
163
After you receive your Developer Key from your Canvas admin, edit the following variables in `config/localConfig.php`:
154
164
155
-
*`$oauth2_id`: The Client_ID yoru Canvas admin gives you
156
-
*`$oauth2_key`: The Secret your Canvas admin gives you
157
-
*`$oauth2_uri`: The Redirect URI you provided to your Canvas admin
165
+
*`$oauth2_id`: The ***Oauth2 ID*** your Canvas admin gives you
166
+
*`$oauth2_key`: The ***Oauth2 Key*** your Canvas admin gives you
167
+
*`$oauth2_uri`: The ***Redirect URI*** you provided to your Canvas admin
168
+
169
+
#### Scoped Developer Keys
170
+
If you'd like to use this option, you'll need set the following scopes for your developer key.
In order for UDOIT to scan YouTube videos for closed captioning, you will need to create a YouTube Data API key. Follow the instructions below:
@@ -273,6 +312,9 @@ The `Deploy to Heroku` button installs the latest release of UDOIT when clicked.
273
312
* Allow inbound traffic from world to UDOIT on 80 and 443
274
313
* Allow outbound traffic from UDOIT to Canvas on 443
275
314
315
+
### Why am I recieving a "Due to LMS limitations, UDOIT is unable to scan this section." error?
316
+
When an institution installs UDOIT and uses a scoped developer key, certain features of the Canvas API are unavailable to UDOIT, including retrieving content from the Syllabus tool. This limitation does not affect UDOIT installations that use a non-scoped developer key. For more information, refer to the "Canvas API Includes" section of the <ahref="https://canvas.instructure.com/doc/api/file.developer_keys.html">Canvas API Documentation</a>.
317
+
276
318
# Developing and Testing
277
319
278
320
For quick local development, set `$UDOIT_ENV = ENV_DEV;` in `config/localConfig.php`. This flag disables authentication and allows you to quickly see a sample test report for most template, js, and css development. Use this along with the quick dev server below.
0 commit comments