Configuration

In order to run DemocracyOS, some config settings are needed. Default values are listed on config/defaults.json.

WARNING: Never change values at config/defaults.json, to edit any value use the methods listed below.

Configuring

Configuration Files

Environment specific options can be added using config/{NODE_ENV}.json. E.g.: If your NODE_ENV is development you can use config/development.json, the options there will override the ones at config/defaults.json.

You can generate configuration files using the command:

NODE_ENV=development node ./bin/dos-install --config

Environment Variables

Environment Variables also can be used to override options (recommended for production). Here’s explained how to manage environment variables on Linux/Mac.

For more info, the values are casted using lib/config/cast-string.js.

Configuration Values

locale

Default language. The app will be in this language for the user, unless it has a valid Accept-Language header, or changes it on his Settings.

availableLocales

Enabled languages. These are all the languages the user can select on the /settings page.

protocol

Base protocol to be considered when building application URLs. Change it to https for SSL-enabled servers.

host

Public accessible URL to your app. Used as base for internal URL building.

publicPort

Port where the application should listen, and to be considered when building application URLs.

mongoUrl

Full URL to your MongoDB storage solution. Including DB name.

jwtSecret

Secret signing key used for calculating and verifying the session signature. This value is required for encrypt and decrypt user sessions stored on cookies.

corsDomains

Domains allowed for Cross-Origin requests. Set it to ["*"] to allow requests from everywhere.

staff

Users with emails listed here will have access to /admin, and will be able to edit Topics, Tags, Whitelist users, etc…

allowEmailAliases

When this is true, the user will be able to register several times with the same email using alias like the ones from Gmail. Uses Verigy module.

visibility

When hidden is selected, only registered users will be able to view the topics.

usersWhitelist

If this option is set to true, only users listed on /admin/users will be able to signin/signup. This doesn’t affect staff users.

multiForum

If this option is set to true, the application will be in a “hub” state and any user will be able to create it’s own forum.

DISCLAIMER: This option is in ALPHA state, expect a lot a changes not far away.

defaultForum

Optional value for setting an existent forum’s name of a multiforum database for using it as a singleForum.

client

Config options to be sended to the client, and usable from /lib/config.js. In most cases, this shouldn’t be edited.

forceSafeImageURLs

When true, the protocol of images added to Topics will be forcefully changed to config.protocol.

spamLimit

Absolute value of a negative score that an argument should reach to be flagged as spam. For example, if the value is 5, all arguments with score less or equal to -5 will be flagged as spam.

SSL

Values needed to use SSL. Go to the SSL section for installation instructions.

https.serverKey

Path to ssl key file.

https.serverCert

Path to ssl certificate file.

https.port

Port where the https server will listen to.

https.redirect

Proxy redirection type to be used when redirecting the user from HTTP to HTTPS. Possible options:

Let’s Encrypt

Values needed to be able to validate a certificate generated using Let’s Encrypt’s Certbot service. To use it, setup the following configuration options and follow this instructions.

cerbot.key

Certbot key needed when manually generating the certificate, should be something like hvBj5jK2o3B6IpFhdrc8Q1OR6UeIl63_xXxXxXxXxXx

cerbot.token

Certbot token needed when manually generating the certificate, should be something like msbwzok5NNPLg2BjLBIGVali8utyXrc95xXxXxXxXxX

Embebed Notifier Server

By default DemocracyOS uses an embeded Notifier. This options are used to configure mailer transports (gmail, mailchimp, sendgrid, etc).

notifications.mailer.service

Notifier service. Any of nodemailer-wellknown.

notifications.mailer.auth.user

User for the notifier transport.

notifications.mailer.auth.pass

Password for the notifier transport.

notifications.nodemailer

Optional object that will override any nodemailer options for creating a mailerTransport.

External Notifier Server

In case you’re using an external Notifier Server, these are the options that need to be configured.

notifications.url

Url of the Notifier server.

notifications.token

Token of the Notifier server.

Facebook Login

Values needed to setup facebook login. For a complete guide on how to setup facebook login go to Facebook Setup.

auth.facebook.clientID

App ID of your facebook app.

auth.facebook.clientSecret

App Secret of your facebook app.

auth.facebook.permissions

Data to access from the user’s facebook account. email is the only one needed for DemocracyOS. More info on Facebook Permissions

Basic HTTP authentication

Values needed to setup Basic HTTP authentication on the application.

auth.basic.username

Authentication Username.

auth.basic.password

Authentication Password.

Independant Users Database

Values only needed if you want to have a different database for users. This allows, for example, to have different instances of DemocracyOS but share the same users collection, so they could register only once.

mongoUsersUrl

Full URL to your MongoDB storage solution.

signinUrl

URL to redirect the users when gets to the signin page (/singin).

signupUrl

URL to redirect the users when gets to the signup page (/signup).

settingsUrl

URL to redirect the users when gets to the settings page (/settings).

User Tracking

googleAnalyticsTrackingId

Set this options to enable Google Analytics tracking.

segmentKey

Set this options to enable Segment tracking.

Application Styles

logo

URL of the logo to be used on the header.

logoMobile

Optional, URL of the logo to be used on the header when the width of the screen is less than 700px.

Where to take the user when click the logo on header.

favicon

URL of the favicon.

organizationName

Title of the app to be shown on the right side of the header.

organizationUrl

Link to take the user when clicks on organizationName.

organizationEmail

Sender email to show on all email notifications.

headerBackgroundColor

Background color of the header.

headerFontColor

Color of the header’s texts.

headerContrast

When true will add a little shadow to the header. Recommended to be used when the color of the header doesn’t create contrast with the white background.

Static Pages

frequentlyAskedQuestions

When true will enable the route under /help/faq in which the content of lib/help-faq/faq.md is going to be shown

termsOfService

When true will enable the route under /help/terms-of-service in which the content of lib/help-tos/tos.md is going to be shown

privacyPolicy

When true will enable the route under /help/privacy-policy in which the content of lib/help-pp/pp.md is going to be shown

glossary

When true will enable the route under /help/privacy-policy in which the content of lib/help-pp/pp.md is going to be shown

In-App featuresn

facebookSignin

When true will enable signin/signup using Facbook instead of the default email and password.

learnMoreUrl

Link to any URL explaining more about the particular DemocracyOS instance or any other thing that wants to be clarified as the institution using it or any kind of impact on the real world the decision arrived on the software will have.

rssEnabled

When true will enable a route under /rss that can be used as a RSS Feed (XML)

commentsPerPage

Number specifying how many comments will be listed before a “Show more” button is shown. 0 will get all comments from the backend.

feedsLimit

Number of feed cards shown on the homepage when multiForum is set to true

tweetText

Text used when sharing a topic on Twitter

googleAPIKey

Key (string) used by google-translate use Google Translator in order to use the command in bin/dos-translate

Social sharing

This settings will be used when sharing a link on Facebook or Twitter.

They are used in lib/facebook-card and lib/twitter-card modules to generate the proper HTML.

siteName

siteDescription

image

domain

twitter.username