Skip to content

DeployingToHeroku

Naohide Sano edited this page May 8, 2020 · 1 revision

Deploying to Heroku

Add Postgresql option.

Config Vars

ONEDRIVE_CLIENT_ID=...
ONEDRIVE_CLIENT_SECRET=...
ONEDRIVE_REDIRECT_URL=https://your-heroku-app/redirect/microsoft
DROPBOX_CLIENT_ID=...
DROPBOX_CLIENT_SECRET=...
DROPBOX_REDIRECT_URL=https://your-heroku-app/redirect/dropbox
BOX_CLIENT_ID=...
BOX_CLIENT_SECRET=...
BOX_REDIRECT_URL=https://your-heroku-app/redirect/box
GOOGLEDRIVE_CLIENT_SECRET={"web":{"client_id":...,"redirect_uris":["https://your-heroku-app/redirect/google"]}}
WEBDAV_ADMIN_PASSWORD=...
WEBDAV_USER_PASSWORD=...
JDBC_DATABASE_URL=jdbc:postgresql:your-postgresql-server-address:port/your-postgresql-database
JDBC_USER_NAME=postgresql-account
JDBC_PASSWORD=postgresql-password
SPRING_PROFILES_ACTIVE=production

Create Database

Make sure you have the Heroku CLI installed. Also, install the psql.

$ heroku pg:psql postgresql-flexible-99999 --app your-heroku-app
your-heroku-app::DATABASE=> CREATE TABLE IF NOT EXISTS credential (id VARCHAR(512) UNIQUE, token VARCHAR(2048));
your-heroku-app::DATABASE=> CREATE TABLE IF NOT EXISTS google (id VARCHAR(512) UNIQUE, credentials BYTEA);
your-heroku-app::DATABASE=> INSERT INTO google VALUES ('StoredCredential', NULL);
your-heroku-app::DATABASE=> INSERT INTO credential VALUES ('onedrive:your_account@hotmail.com', NULL);
your-heroku-app::DATABASE=> INSERT INTO credential VALUES ('googledrive:your_account@gmail.com', NULL);
your-heroku-app::DATABASE=> INSERT INTO credential VALUES ('box:your_account@box.com', NULL);
your-heroku-app::DATABASE=> INSERT INTO credential VALUES ('dropbox:your_account@dropbox.com', NULL);
 :

Deploy

$ heroku create
$ git push heroku master
$ heroku open
Clone this wiki locally