Skip to content

Commit

Permalink
Merge pull request #58 from iturgeon/issue/47-heroku-deployable
Browse files Browse the repository at this point in the history
Issue/47 heroku deployable  Please see the release notes before using.
  • Loading branch information
bagofarms committed Jan 29, 2016
2 parents 745fa85 + a292598 commit f97ae96
Show file tree
Hide file tree
Showing 1,012 changed files with 719 additions and 397 deletions.
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory": "assets/js/vendor"
"directory": "public/assets/js/vendor"
}
2 changes: 2 additions & 0 deletions .buildpacks
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/heroku/heroku-buildpack-php
51 changes: 51 additions & 0 deletions HEROKU.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Deploy on Heroku

1. `git clone [email protected]:ucfcdl/UDOIT.git` to grab a copy of the git repo
2. `heroku create` will set up a Heroku project
3. `heroku addons:create heroku-postgresql:hobby-dev` add a database addon
4. `heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi` may be required
5. `git push heroku master:master` will build build the server using our master branch
6. set up the Heroku config variables below

## Configure
Set Heroku config variables using `heroku config:set VAR=value1`

* `CONSUMER_KEY` - LTI consumer key entered when adding UDOIT LTI to Canvas
* `SHARED_SECRET` - LTI secret entered when adding UDOIT LTI to Canvas
* `OAUTH2_ID` - from the developer api key created by your admin
* `OAUTH2_KEY` - from the developer api key created by your admin
* `OAUTH2_URI` - full url to your oauth2responce.php - EX: `https://your.herokuapp.com/oauth2response.php`
* `GOOGLE_API_KEY` - add a google api key for youtube video support
* `USE_HEROKU_CONFIG` - set to `true` to enable the Heroku configuration

## Create Database Tables
You'll need to have postgresql installed on your own system to connect to the Heroku postgresql database.

* `heroku pg:psql` will open a psql connection to the remote Heroku database
* copy and paste the postgresql table schemeas for the users and reports table into the prompt
* `\dt` will show you a list of the tables you just created
* `\q` quits the psql terminal

```sql
/* postgresql */
CREATE TABLE reports (
id SERIAL PRIMARY KEY,
user_id integer,
course_id integer,
file_path text,
date_run bigint,
errors integer,
suggestions integer
);
```

### Users Table

```sql
/* postgresql */
CREATE TABLE users (
id integer CONSTRAINT users_pk PRIMARY KEY,
api_key varchar(255),
date_created integer
);
```
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: vendor/bin/heroku-php-apache2 -F phpfpm_custom.conf public/
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ UDOIT uses the [QUAIL PHP library](https://code.google.com/p/quail-lib/), which

## Installing

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)

### System Requirements
*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.

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

```sql
/* mysql */
CREATE TABLE `reports` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
Expand All @@ -76,20 +79,41 @@ CREATE TABLE `reports` (
`suggestions` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/* postgresql */
CREATE TABLE reports (
id SERIAL PRIMARY KEY,
user_id integer,
course_id integer,
file_path text,
date_run bigint,
errors integer,
suggestions integer
);
```


### Users Table

```sql
/* mysql */
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL,
`api_key` varchar(255) NOT NULL,
`date_created` date NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/* postgresql */
CREATE TABLE users (
id integer CONSTRAINT users_pk PRIMARY KEY,
api_key varchar(255),
date_created integer
);
```


## Configuration
Make a copy of `config/localConfig.template.php`, rename it to `localConfig.php`.

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

* `$db_host`
* `$db_user`
* `$db_url`
* `$db_password`
* `$db_name`
* `$db_user_table`
Expand Down
60 changes: 60 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "UDOIT",
"description": "The Universal Design Online content Inspection Tool, or UDOIT identifies and fixes accessibility issues in Canvas by Instructure.",
"keywords": [
"education",
"canvas",
"CDL",
"EDU",
"UCF",
"Instructure",
"508"
],
"website": "http://online.ucf.edu/teach-online/resources/udoit/",
"repository": "https://github.com/ucfcdl/UDOIT",
"success_url": "/",
"env": {
"CONSUMER_KEY": {
"description": "LTI consumer key entered when adding UDOIT LTI to Canvas",
"generator": "secret"
},
"SHARED_SECRET": {
"description": "LTI secret entered when adding UDOIT LTI to Canvas",
"generator": "secret"
},
"OAUTH2_ID": {
"description": "Oauth ID from the developer api key created by your admin",
"generator": "secret"
},
"OAUTH2_KEY": {
"description": "Oauth Key from the developer api key created by your admin",
"generator": "secret"
},
"OAUTH2_URI": {
"description": "Full url to your oauth2responce.php file",
"value": "https://your.herokuapp.com/oauth2response.php"
},
"GOOGLE_API_KEY": {
"description": "add a google api key for youtube video support",
"required": false
},
"USE_HEROKU_CONFIG": {
"description": "needed to use the Heroku configuration",
"value": "true"
}
},
"addons": [
"heroku-postgresql:hobby-dev"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
},
{
"url": "https://github.com/heroku/heroku-buildpack-php"
}
],
"scripts": {
"postdeploy": "php db_pg_setup.php"
}
}
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@
"repositories": [
],
"require": {
"php": ">=5.4.0",
"php": "^5.4.0 || ^5.5.0 || ^5.6.0",
"nategood/httpful": "*",
"zaininnari/html-minifier": "dev-master",
"mpdf/mpdf": "dev-master",
"league/plates": "~3.1",
"ext-pdo": "*"
},
"require-dev": {
"symfony/var-dumper": "*"
"symfony/var-dumper": "*",
"heroku/heroku-buildpack-php": "*"
},
"scripts": {
"post-install-cmd": [
"bower install"
],
"post-update-cmd": [
"compile": [
"bower install"
]
}
Expand Down
124 changes: 114 additions & 10 deletions composer.lock
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f97ae96

Please sign in to comment.