Skip to content

Commit f97ae96

Browse files
committed
Merge pull request #58 from iturgeon/issue/47-heroku-deployable
Issue/47 heroku deployable Please see the release notes before using.
2 parents 745fa85 + a292598 commit f97ae96

File tree

1,012 files changed

+719
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,012 files changed

+719
-397
lines changed

.bowerrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"directory": "assets/js/vendor"
2+
"directory": "public/assets/js/vendor"
33
}

.buildpacks

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://github.com/heroku/heroku-buildpack-nodejs
2+
https://github.com/heroku/heroku-buildpack-php

HEROKU.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Deploy on Heroku
2+
3+
1. `git clone git@github.com:ucfcdl/UDOIT.git` to grab a copy of the git repo
4+
2. `heroku create` will set up a Heroku project
5+
3. `heroku addons:create heroku-postgresql:hobby-dev` add a database addon
6+
4. `heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi` may be required
7+
5. `git push heroku master:master` will build build the server using our master branch
8+
6. set up the Heroku config variables below
9+
10+
## Configure
11+
Set Heroku config variables using `heroku config:set VAR=value1`
12+
13+
* `CONSUMER_KEY` - LTI consumer key entered when adding UDOIT LTI to Canvas
14+
* `SHARED_SECRET` - LTI secret entered when adding UDOIT LTI to Canvas
15+
* `OAUTH2_ID` - from the developer api key created by your admin
16+
* `OAUTH2_KEY` - from the developer api key created by your admin
17+
* `OAUTH2_URI` - full url to your oauth2responce.php - EX: `https://your.herokuapp.com/oauth2response.php`
18+
* `GOOGLE_API_KEY` - add a google api key for youtube video support
19+
* `USE_HEROKU_CONFIG` - set to `true` to enable the Heroku configuration
20+
21+
## Create Database Tables
22+
You'll need to have postgresql installed on your own system to connect to the Heroku postgresql database.
23+
24+
* `heroku pg:psql` will open a psql connection to the remote Heroku database
25+
* copy and paste the postgresql table schemeas for the users and reports table into the prompt
26+
* `\dt` will show you a list of the tables you just created
27+
* `\q` quits the psql terminal
28+
29+
```sql
30+
/* postgresql */
31+
CREATE TABLE reports (
32+
id SERIAL PRIMARY KEY,
33+
user_id integer,
34+
course_id integer,
35+
file_path text,
36+
date_run bigint,
37+
errors integer,
38+
suggestions integer
39+
);
40+
```
41+
42+
### Users Table
43+
44+
```sql
45+
/* postgresql */
46+
CREATE TABLE users (
47+
id integer CONSTRAINT users_pk PRIMARY KEY,
48+
api_key varchar(255),
49+
date_created integer
50+
);
51+
```

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: vendor/bin/heroku-php-apache2 -F phpfpm_custom.conf public/

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ UDOIT uses the [QUAIL PHP library](https://code.google.com/p/quail-lib/), which
2828

2929
## Installing
3030

31+
UDOIT uses php, apache or nginx, and mysql or postresql. For instructions on installing to Heroku, view [HEROKU.md](HEROKU.md). We also support instantly deploying UDOIT: [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
32+
3133
### System Requirements
3234
*PHP 5.4 is required* to run UDOIT without any modifications. We have not tested it on 5.5 or 5.6, but some users have been able to modify the code to work on 5.3.
3335

@@ -66,6 +68,7 @@ There are only two tables required to run UDOIT. They are:
6668
### Reports Table
6769

6870
```sql
71+
/* mysql */
6972
CREATE TABLE `reports` (
7073
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
7174
`user_id` int(10) unsigned NOT NULL,
@@ -76,20 +79,41 @@ CREATE TABLE `reports` (
7679
`suggestions` int(10) unsigned NOT NULL,
7780
PRIMARY KEY (`id`)
7881
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
82+
83+
/* postgresql */
84+
CREATE TABLE reports (
85+
id SERIAL PRIMARY KEY,
86+
user_id integer,
87+
course_id integer,
88+
file_path text,
89+
date_run bigint,
90+
errors integer,
91+
suggestions integer
92+
);
7993
```
8094

95+
8196
### Users Table
8297

8398
```sql
99+
/* mysql */
84100
CREATE TABLE `users` (
85101
`id` int(10) unsigned NOT NULL,
86102
`api_key` varchar(255) NOT NULL,
87103
`date_created` date NOT NULL,
88104
PRIMARY KEY (`id`),
89105
UNIQUE KEY `id` (`id`)
90106
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
107+
108+
/* postgresql */
109+
CREATE TABLE users (
110+
id integer CONSTRAINT users_pk PRIMARY KEY,
111+
api_key varchar(255),
112+
date_created integer
113+
);
91114
```
92115

116+
93117
## Configuration
94118
Make a copy of `config/localConfig.template.php`, rename it to `localConfig.php`.
95119

@@ -110,7 +134,7 @@ UDOIT uses Oauth2 to take actions on behalf of the user, you'll need to [sign up
110134
These value of these vars should be obvious:
111135

112136
* `$db_host`
113-
* `$db_user`
137+
* `$db_url`
114138
* `$db_password`
115139
* `$db_name`
116140
* `$db_user_table`

app.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "UDOIT",
3+
"description": "The Universal Design Online content Inspection Tool, or UDOIT identifies and fixes accessibility issues in Canvas by Instructure.",
4+
"keywords": [
5+
"education",
6+
"canvas",
7+
"CDL",
8+
"EDU",
9+
"UCF",
10+
"Instructure",
11+
"508"
12+
],
13+
"website": "http://online.ucf.edu/teach-online/resources/udoit/",
14+
"repository": "https://github.com/ucfcdl/UDOIT",
15+
"success_url": "/",
16+
"env": {
17+
"CONSUMER_KEY": {
18+
"description": "LTI consumer key entered when adding UDOIT LTI to Canvas",
19+
"generator": "secret"
20+
},
21+
"SHARED_SECRET": {
22+
"description": "LTI secret entered when adding UDOIT LTI to Canvas",
23+
"generator": "secret"
24+
},
25+
"OAUTH2_ID": {
26+
"description": "Oauth ID from the developer api key created by your admin",
27+
"generator": "secret"
28+
},
29+
"OAUTH2_KEY": {
30+
"description": "Oauth Key from the developer api key created by your admin",
31+
"generator": "secret"
32+
},
33+
"OAUTH2_URI": {
34+
"description": "Full url to your oauth2responce.php file",
35+
"value": "https://your.herokuapp.com/oauth2response.php"
36+
},
37+
"GOOGLE_API_KEY": {
38+
"description": "add a google api key for youtube video support",
39+
"required": false
40+
},
41+
"USE_HEROKU_CONFIG": {
42+
"description": "needed to use the Heroku configuration",
43+
"value": "true"
44+
}
45+
},
46+
"addons": [
47+
"heroku-postgresql:hobby-dev"
48+
],
49+
"buildpacks": [
50+
{
51+
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
52+
},
53+
{
54+
"url": "https://github.com/heroku/heroku-buildpack-php"
55+
}
56+
],
57+
"scripts": {
58+
"postdeploy": "php db_pg_setup.php"
59+
}
60+
}

composer.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@
66
"repositories": [
77
],
88
"require": {
9-
"php": ">=5.4.0",
9+
"php": "^5.4.0 || ^5.5.0 || ^5.6.0",
1010
"nategood/httpful": "*",
1111
"zaininnari/html-minifier": "dev-master",
1212
"mpdf/mpdf": "dev-master",
1313
"league/plates": "~3.1",
1414
"ext-pdo": "*"
1515
},
1616
"require-dev": {
17-
"symfony/var-dumper": "*"
17+
"symfony/var-dumper": "*",
18+
"heroku/heroku-buildpack-php": "*"
1819
},
1920
"scripts": {
20-
"post-install-cmd": [
21-
"bower install"
22-
],
23-
"post-update-cmd": [
21+
"compile": [
2422
"bower install"
2523
]
2624
}

composer.lock

100755100644
Lines changed: 114 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)