Environment variables

Matias Lescano edited this page Apr 28, 2015 · 18 revisions

In order to run DemocracyOS, some config settings are needed. These settings can be defined either as a JSON file (as described in the Environments and config files wiki page) following the config/defaults.json, or through environment variables. For the latter case, you should consider the following:

Mandatory variables

DemocracyOS will not run if any of these settings aren't set.

  • NODE_ENV: name of the running environment. Learn more [here] (https://github.com/DemocracyOS/app/wiki/Environments-and-config-files) - Defaults to development.
  • NODE_PATH: path to the home of the running code. If running node from the project's home dir, then set to .
  • HOST: public accessible URL to your app. Used as base for internal URL building.
  • PROTOCOL: base protocol to be considered when building application URLs. http or https for SSL-enabled servers.
  • PUBLIC_PORT: port to be considered when building application URLs.
  • PORT: port where the application is listening.
  • LOCALE: application i18n locale. Check here for available language files.
  • MONGO_URL: full URL to your MongoDB storage solution.
  • NOTIFICATIONS_URL: URL to your notifier notifications server.
  • NOTIFICATIONS_TOKEN: API token for the notifier.
  • FAVICON: URL to app's favicon
  • LOGO: URL to the top-left icon for your deployment
  • ORGANIZATION_NAME: Name of your organization.
  • ORGANIZATION_URL: URL to your organization's website.
  • STAFF: emails whose users are allowed to acces the administration module. For multiple users, separate emails by comas (e.g.: "peter@server.com,jane@something.org"). Please note that this does not create accounts for the given emails in DemocracyOS; admins should signup the same way as other users do before being able to access the admin module.
  • RSS_ENABLED: true/false - Whether the /rss route is enabled for notifying new laws being added to the platform.
  • COMMENTS_PER_PAGE: number of arguments (i.e.: comments) per page. 0 means no paging.
  • JWT_SECRET: a string to be used as secret for signing the app's Jason Web Tokens

Mandatory but not defined by the config file

If you don't define these as environment variables, you'll need to define this in your ~/.netrc file. More about this here

The following environment settings are optional:

  • HTTPS_PORT and HTTPS_REDIRECT: port where the HTTPS enabled server should listen and redirections strategy for HTTP to HTTPS redirection, respectively. Read our HTTPS wiki page for more information on this.
  • AUTH_BASIC_USERNAME and AUTH_BASIC_PASSWORD: username and password for protecting your deployment through Basic Auth
  • MONGO_USERS_URL: if you would like your users to be stored in a separate database than the rest of your data, then specify the URL here.
  • LEARN_MORE_URL: if set, an alert will show with this URL as a target for learning more about your deployment.
  • SOCIALSHARE_DOMAIN: domain for social network sharing.
  • SOCIALSHARE_IMAGE: URL to the social network card thumbnail. 200x200 px recommended.
  • SOCIALSHARE_SITE_DESCRIPTION: description for social network card.
  • SOCIALSHARE_SITE_NAME: site name for social network card.
  • SOCIALSHARE_TWITTER_USERNAME: twitter handle to redirect to when sharing in twitter
  • FAQ: true or false
  • TERMS_OF_SERVICE: true or false
  • PRIVACY_POLICY: true or false
  • GLOSSARY: true or false

These are used to show (or not) a help page on each topic based on faq.md, tos.md and pp.md files located on each help-* component respectively (help-faq, help-tos and help-pp).

Before v0.7.4 these environment variables where named FAQ_ENABLED, TERMS_OF_SERVICE_ENABLED, PRIVACY_POLICY_ENABLED, GLOSSARY_ENABLED.