Generate A New Heroku Api Key
Heroku create is a shorthand alias for heroku apps:create. You can see a list of all commands with heroku help. Typically, this command will only be used on an initialized git repository. In that case, the command creates the application as well as a git remote, that you can use to push your code to Heroku. Apr 10, 2020 On the Credentials page, click Create credentials API key. The API key created dialog displays your newly created API key. The new API key is listed on the Credentials page under API keys. (Remember to restrict the API key before using it in production.) Add the API key to your request.
Jun 11, 2018 Wrap-up. This tutorial demonstrates how to call the Heroku Platform API using curl, but you can transfer this approach to whatever language and environment you favor. The tutorial focused specifically on creating, updating and deleting apps. The API has many more resources available, including add-ons, config vars and domains. But this 'cannot generate publickeys' issue all started for me because I had an 'I don't have public keys to add' issue when I cloned my repo (from github) to a new computer and found that I could push to github but not heroku. Now that I have the keys - I have to add them. Generate a new client. Generate a new client from the Heroku Platform API JSON schema: rake build Remember to commit and push the changes to Github. Release a new gem. This project follows semver from version 1.0.0. Please be sure to keep this in mind if you're the project maintainer. Be sure to run the very basic acceptance rspecs.
If you wish to install Heroku using the one-click deployment process, please click the purple 'Deploy to Heroku' button in the repository home page.
Installation Instructions
Installing UDOIT using the Heroku button is very easy, but still requires some setup. If you prefer to watch a video demonstrating the process step-by-step, watch the UDOIT Installation CanvasLIVE video.
Below are the written directions if you prefer to follow along that way.
Step 1: Create a Google/YouTube and Vimeo API keys
- We thus need to head back to our.gitlab-ci.yml file and create a new job. (There are probably different ways to do this but here is how I did it). The Heroku API key is a key tight to your.
- Oct 18, 2019 Generate a new client. Generate a new client from the Heroku Platform API JSON schema: rake build Remember to commit and push the changes to Github. Release a new gem. This project follows semver from version 1.0.0. Please be sure to keep this in mind if you're the project maintainer. Be sure to run the very basic acceptance rspecs.
See the Google/YouTube API instructions and Vimeo API instructions in the README.
Step 2: Setting up Heroku
After clicking the Heroku button above:
- Create an account (if you don't have one already).
- Give the app a name.
- Set
OAUTH2_ENFORCE_SCOPES
to true if you have a scoped developer key. - Fill out the
OAUTH2_ID
andOAUTH2_KEY
fields with dummy data. (We'll fix it later.) - Fill out the
OAUTH2_URI
field withhttps://yourapp.herokuapp.com/oauth2response.php
. (Replace 'yourapp' with the name you gave in step 2.) - 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. - (optional) Copy and paste your Google/YouTube API key into the
GOOGLE_API_KEY
field. - (optional) Copy and paste your Vimeo API key into the
VIMEO_API_KEY
field. - (optional) If you have a Google Analytics account, you can paste your site tracking code into the
GA_TRACKING_CODE
field. - (optional) If you would like to enable the Admin Panel, change the
ADMIN_PANEL_ENABLED
field totrue
. - Click the Deploy button and wait for the process to complete.
Step 3: Request a Developer Key
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:
- Key Name: Probably UDOIT or UDOIT Test for your test instance
- Owner Email: The email address of whoever is responsible for UDOIT at your institution
- Redirect URI: This is the URI of the
oauth2response.php
file in the UDOIT directory. - This should be
https://yourapp.herokuapp.com/oauth2response.php
. (Replace 'yourapp' with the name of your UDOIT instance on Heroku.) - 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.)
Scoped Developer Keys
If you'd like to use this option, you'll need set the following scopes for your developer key.
- Assignments
- url:GET /api/v1/courses/:course_id/assignments
- url:GET /api/v1/courses/:course_id/assignments/:id
- url:PUT /api/v1/courses/:course_id/assignments/:id
- Courses
- url:PUT /api/v1/courses/:id
- url:GET /api/v1/courses/:id
- url:POST /api/v1/courses/:course_id/files
- Discussion Topics
- url:GET /api/v1/courses/:course_id/discussion_topics
- url:GET /api/v1/courses/:course_id/discussion_topics/:topic_id
- url:PUT /api/v1/courses/:course_id/discussion_topics/:topic_id
- Files
- url:GET /api/v1/courses/:course_id/files
- url:GET /api/v1/courses/:course_id/folders/:id
- url:GET /api/v1/folders/:id/folders
- url:GET /api/v1/folders/:id/files
- Modules
- url:GET /api/v1/courses/:course_id/modules
- url:GET /api/v1/courses/:course_id/modules/:module_id/items
- Pages
- url:GET /api/v1/courses/:course_id/pages
- url:GET /api/v1/courses/:course_id/pages/:url
- url:PUT /api/v1/courses/:course_id/pages/:url
- Users
- url:GET /api/v1/users/:user_id/profile
Step 4: Add your Developer Key to UDOIT
- In Heroku, click the 'Manage App' button for your install of UDOIT.
- Go to the 'Settings' tab.
- Copy and paste the following values from the Developer Key:
- ID into OAUTH2_ID
- Secret into OAUTH2_KEY
- Verify that your OAUTH2_URI is correct. (See above.)
Step 5: Install the UDOIT LTI
In Canvas, you can install UDOIT at the course or sub-account levels.
- Click the Settings menu item from any course in Canvas.
- Click the Apps tab.
- Click the View App Configurations button.
- Click the Add App button.
- Under Configuration Type, choose By URL.
- In the Name field, enter
UDOIT
. - In the Consumer Key field, copy the value from CONSUMER_KEY
- In the Shared Secret field, copy the value from SHARED_SECRET
- In the Config URL field, insert https://yourapp.herokuapp.com/udoit.xml.php (Replace yourapp with the name of your UDOIT instance on Heroku.)
- Finish by clicking Submit.
UDOIT should now be available in the course navigation menu.
Warning: Recommended for advanced users only
You can use our configuration to launch a new Heroku app using Heroku's app-setups api.
You'll have to set some env settings. Peek at app.json for any env vars that don't have 'required': false
set. Our config vars are covered in Configure section
Create The App: MAKE SURE you modify the env values
Read the result to make sure it returned an id, not an error.
Check your Heroku dashboard or install the Heroku CLI and run heroku apps
to see if a new app shows up. If all goes well, it should be running.
Configure
These variables can be set in the curl post above. You can also set them later using heroku config:set VAR=value1
CONSUMER_KEY
- LTI consumer key entered when adding UDOIT LTI to CanvasSHARED_SECRET
- LTI secret entered when adding UDOIT LTI to CanvasOAUTH2_ID
- from the developer api key created by your adminOAUTH2_KEY
- from the developer api key created by your adminOAUTH2_URI
- full url to your oauth2response.php - EX:https://your.herokuapp.com/oauth2response.php
GOOGLE_API_KEY
- add a google api key for youtube video supportUSE_HEROKU_CONFIG
- set totrue
to enable the Heroku configuration
To modify the code on your running Heroku server, you'll need to push code to it.
Set up the git repository:
Link the git repository to your Heroku App
Build and Deploy
Peeking at Database Tables
The Heroku install process should create the tables for you.
If you need to check that the tables exist, you can connect to Postgres using some convenient Heroku functions. Need for speed payback key generator password. You'll need to have Postgresql installed on your own system to do the following commands.
heroku pg:psql
will open a psql connection to the remote Heroku databasedt
will show you a list of the tables you just createdd reports
andd users
should describe the tablesSelect * from users;
orSelect * from reports;
will show you their contentsq
quits the psql terminal
If needed, you can manually run the table creation script: heroku run composer db-setup
Generate A New Heroku Api Key Free
Table Schema
The table schema can be found in migrations/
Generate A New Heroku Api Keys
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.
First Time Setup
This process takes a while to set up the first time, but is very fast after that. On your computer:
- Install Git
- Install Heroku CLI and follow the instructions to get your account set up.
- 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 calledUDOIT
that contains the latest version. - In your command line interface, navigate into the newly-created
UDOIT
folder. - Run
heroku git:remote --app your-heroku-instance
, replacingyour-heroku-instance
with your actual heroku instance name. For example, if your UDOIT instance resides athttps://udoit-pcu.herokuapp.com
, you would runheroku git:remote --app udoit-pcu
. This adds your Heroku instance as a remote calledheroku
in the Git repository so that you can push updates to it in the future.
Pushing Updates to Heroku
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:
- In your command line interface, navigate to the
UDOIT
directory on your computer. - Run
git checkout master
to make sure we're on the master branch, which represents the latest version of UDOIT. - Run
git pull
to update your local copy of UDOIT from the official GitHub repository. - Run
git push heroku master:master
to deploy the new version to your UDOIT instance. - Run
heroku run --app your-heroku-instance 'php composer.phar migrate'
to update the database structure for your UDOIT instance. (Remember to replaceyour-heroku-instance
with your Heroku instance name.) - Log into the Heroku website and click on your UDOIT instance.
- Click Settings
- Under the Config Vars heading, click Reveal Config Vars.
- Compare them to the
env
section of app.json, and add any missing variables to Heroku.
UDOIT should now be up to date with the latest release!
Dealing with Multiple Heroku Instances
First Time Setup (Test Instance)
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 to create one. Assuming you set everything up for your production instance in the First Time Setup section above, here's how to set up your testing instance (sometimes called 'staging' or 'QA'):
- In your command line interface, navigate to the
UDOIT
directory on your computer. - Run
heroku git:remote --remote test --app your-heroku-test-instance
, replacingyour-heroku-test-instance
with your actual heroku test instance name. For example, if your UDOIT instance resides athttps://udoit-pcu-test.herokuapp.com
, you would runheroku git:remote --remote test --app udoit-pcu-test
. This adds your Heroku test instance as a remote calledtest
in the Git repository so that you can push updates to it in the future.
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.
Pushing Updates to the Test Instance
Now that you have the connection to the test instance set up, here's how to push an update to it:
- In your command line interface, navigate to the
UDOIT
directory on your computer. - Run
git checkout master
to make sure we're on the master branch, which represents the latest version of UDOIT. - Run
git pull
to update your local copy of UDOIT from the official GitHub repository. - Run
git push test master:master
to deploy the new version to your UDOIT test instance. - Run
heroku run --app your-heroku-test-instance 'php composer.phar migrate'
to update the database structure for your UDOIT test instance. (Remember to replaceyour-heroku-test-instance
with your Heroku test instance name.) - Log into the Heroku website and click on your UDOIT test instance.
- Click Settings
- Under the Config Vars heading, click Reveal Config Vars.
- Compare them to the
env
section of app.json, and add any missing variables to Heroku.
Why aren't my scans completing?
If you are using the free tier, you may need to manually turn on the worker dyno. You can do this by going to the Heroku Control Panel, selecting your instance of UDOIT, clicking Configure Dynos, clicking the pencil icon next to the Worker dyno, clicking the slider to the on position, then clicking Confirm.
Mojolicious::Command::deploy::heroku - Deploy to Heroku
Mojolicious::Command::deploy::heroku deploys a Mojolicious app to Heroku.
*NOTE* The deploy command itself works on Windows, but the Heroku service does not reliably accept deployments from Windows. Your mileage may vary.
*NOTE* This release works with Mojolicious versions 4.50 and above. For older Mojolicious versions, please use 0.10 or before.
The deploy command creates a git repository of the current directory's contents in /tmp, and then pushes it to a remote heroku repository.
https://github.com/tempire/mojolicious-command-deploy-heroku, https://github.com/tempire/perloku, http://heroku.com/, http://mojolicio.us
0.22
Glen Hinkle tempire@cpan.org
MattOates
briandfoy