Configuration

App Environment Variables

Replace app_name with the app name entered during the ionshop script execution.

Update PUBLIC_SERVER_URL

dokku config:set app_name PUBLIC_SERVER_URL="https://ionshop.yourdomain.com"

Update the APP_NAME with the name of your project.

dokku config:set app_name APP_NAME="My awesome app"

Enable (1) / disable (0) email verification:

dokku config:set app_name VERIFY_USER_EMAILS="1"

Users will receive an email with a verification link. You need to configure Mailgun to send and receive emails (see below).

Setup Parse Keys

Use random.org to generate a set of random strings and update the following values:

dokku config:set app_name APP_ID="random_string"
dokku config:set app_name MASTER_KEY="secret_string"
dokku config:set app_name READ_ONLY_MASTER_KEY="secret_read_string"

Setup Currency

dokku config:set app_name CURRENCY_CODE="USD" CURRENCY_LOCALE="en-US" CURRENCY_DISPLAY="symbol"

Setup Language

The language of the web portal is set using the CUSTOM_LANG variable. It supports English (Default), Spanish (es) and Arabic (ar).

For example to change the language to Spanish:

dokku config:set app_name CUSTOM_LANG="es"

If you need to add more languages follow these steps:

  1. Create a new json file in the ./locales folder. For example, for the French language, add a file called fr.json based on the contents of the en.json file.

  2. Edit the server.js file by adding the new language in the i18n package configuration:

i18n.configure ({
  locals: ['en', 'es', 'ar', 'fr'],
  defaultLocale: 'en',
  fallbacks: {'en': 'en'},
  directory: __dirname + '/ locals',
  register: global
})

Setup Parse Dashboard

The password must be encrypted with the help of a tool like BCrypt-Generator.

# User who will have full permissions (create, read, update, delete).

dokku config:set app_name PARSE_DASHBOARD_USER="admin"
dokku config:set app_name PARSE_DASHBOARD_PASS="$2a$12$emtAfkyi..."

We should also define a user with only read access.

dokku config:set app_name PARSE_DASHBOARD_USER_READ_ONLY="subadmin"
dokku config:set app_name PARSE_DASHBOARD_PASS_READ_ONLY="$2a$12$emtAfkyi..."

Setup Mailgun

dokku config:set app_name MAILGUN_API_KEY="secret_key"
dokku config:set app_name MAILGUN_DOMAIN="mg.domain.com"
dokku config:set app_name MAILGUN_HOST="api.mailgun.net"
dokku config:set app_name MAILGUN_FROM_ADDRESS="YourAppName <noreply@yourdomain.com>"
dokku config:set app_name MAILGUN_PUBLIC_LINK="https://www.yourdomain.com"

When using the EU region, the host should be set to “api.eu.mailgun.net”.

Setup notifications

dokku config:set app_name PUSH_ANDROID_SENDER_ID="XXXXXXXXXXX" PUSH_ANDROID_API_KEY="XXXXXXXXXXXX"

Update the variable PUSH_IOS_BUNDLE_ID with the same App ID that you configured in the Apple developer portal.

dokku config:set app_name PUSH_IOS_BUNDLE_ID="com.domain.app"

Enable OneSignal (optional)

dokku config:set app_name ONE_SIGNAL_APP_ID="app_id"
dokku config:set app_name ONE_SIGNAL_API_KEY="api_key"

Sometimes, you would want to use another subdomain like admin, console, portal, etc.

Run the following commands to remove the default subdomain and add a new one:

dokku domains:remove app_name cloud.yourdomain.com
dokku domains:add app_name console.yourdomain.com

Add the proper DNS record (console => server_ip) and update the PUBLIC_SERVER_URL

dokku config:set app_name PUBLIC_SERVER_URL='https://console.yourdomain.com'

If for some reason you need to renew the ssl certificate, run the following command:

dokku letsencrypt:enable app_name