Pour pouvoir exécuter DemocracyOS, certains paramètres de configuration sont nécessaires. Les valeurs par défaut sont répertoriées sur config/defaults.json.

_ATTENTION : Ne jamais changer les valeurs sur config/defaults.json, pour editer les valeurs, veuillez suivre les méthodes présentées ci-dessous :

Configurer

Fichier de Configuration

Les options spécifiques d’environnement peuvent être ajoutés en utilisantE config/{NODE_ENV}.json. E.g.: Si votre NODE_ENV est ‘développement”, vous pouvez utiliser config/development.json, ces options

If your NODE_ENV is development you can use config/development.json, ces options remplaceront config/defaults.json.

Vous pouvez générer des fichiers configurations en utilisant la commande :

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

Les Environnements Variables

Les Environnements Variables peuvent aussi être utilises comme option d’annulation (recommande pour la “production”) Ici expliquent comment gerer les environnements variable sur Linux/Mac.

  • Les noms de variables doivent etre CONSTANT_CASE.
    • e.g.: mongoUrl => MONGO_URL
    • Scoped variables e.g.: notifications.url => NOTIFICATIONS_URL Arrays`s doivent être des chaînes séparées par des virgules.
    • e.g.: "staff": ["mail@eg.com", "a@c.m"] => STAFF="mail@eg.com,a@c.m" valeurs boolean devraient être vrai ou fausse`.
    • e.g.: "rssEnabled": false => RSS_ENABLED="false"

Pour plus d’informations, les valeurs sont validées en utilisant lib/config/cast-string.js.

Les Valeurs de Configuration

locale

  • env: LOCALE
  • default: en

Langage par default. L’application sera dans ce langage pour l’utilisateur, sauf s’il existe deja une banniere valide ‘Langages acceptes’ sauf si on peut changer les paramètres.

availableLocales

  • env: AVAILABLE_LOCALES
  • default: [ ... ]

Autoriser langages. Represente toutes les langues qu’un utilisateur peut choisir sur la page ‘/paramètres’

protocol

  • env: PROTOCOL
  • default: http

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

host

  • env: HOST
  • default: localhost

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

publicPort

  • env: PUBLIC_PORT
  • default: 3000

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

mongoUrl

  • env: MONGO_URL
  • default: mongodb://localhost/DemocracyOS-dev

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

jwtSecret

  • env: JWT_SECRET

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

  • env: CORS_DOMAINS
  • default: []

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

staff

  • env: STAFF
  • default: []

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

allowEmailAliases

  • env: ALLOW_EMAIL_ALIASES
  • default: true

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

  • env: VISIBILITY
  • default: visible
  • options: visible  hidden

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

usersWhitelist

  • env: USERS_WHITELIST
  • default: false

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

  • env: MULTI_FORUM
  • default: false

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.

client

  • env: CLIENT
  • default: [ ... ]

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

forceSafeImageURLs

  • env: FORCE_SAFE_IMAGE_URLS
  • default: true

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

spamLimit

  • env: SPAM_LIMIT
  • default: 5

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

  • env: HTTPS_SERVER_KEY
  • default: server.key

Path to ssl key file.

https.serverCert

  • env: HTTPS_SERVER_CERT
  • default: server.crt

Path to ssl certificate file.

https.port

  • env: HTTPS_PORT
  • default: 443

Port where the https server will listen to.

https.redirect

  • env: HTTPS_REDIRECT
  • default: normal
  • options: normal reverse-proxy azure no-redirect

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

  • normal: Normal redirection handled by the DemocracyOS nodejs server.
  • reverse-proxy: Redirection to HTTPS compatible with reverse-proxies (e.g.: Heroku/Nodejitsu/nginx).
  • azure: Redirection to HTTPS compatible with Windows Azure. Do NOT use outside Windows Azure; this can be easily spoofed outside their environment.
  • no-redirect: The redirection is not handled. Meant to be used on development only.

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

  • env: NOTIFICATIONS_MAILER_SERVICE

Notifier service. Any of nodemailer-wellknown.

notifications.mailer.auth.user

  • env: NOTIFICATIONS_MAILER_AUTH_USER

User for the notifier transport.

notifications.mailer.auth.pass

  • env: NOTIFICATIONS_MAILER_AUTH_PASS

Password for the notifier transport.

External Notifier Server

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

notifications.url

  • env: NOTIFICATIONS_URL

Url of the Notifier server.

notifications.token

  • env: 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.username

  • env: AUTH_FACEBOOK_CLIENT_ID

App ID of your facebook app.

auth.facebook.password

  • env: AUTH_FACEBOOK_CLIENT_SECRET

App Secret of your facebook app.

auth.facebook.permissions

  • env: AUTH_FACEBOOK_PERMISSIONS
  • default: [ "email" ]

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

  • env: AUTH_BASIC_USERNAME

Authentication Username.

auth.basic.password

  • env: 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

  • env: MONGO_USERS_URL

Full URL to your MongoDB storage solution.

signinUrl

  • env: SIGNIN_URL

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

signupUrl

  • env: SIGNUP_URL

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

settingsUrl

  • env: SETTINGS_URL

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

User Tracking

googleAnalyticsTrackingId

  • env: GOOGLE_ANALYTICS_TRACKING_ID

Set this options to enable Google Analytics tracking.

segmentKey

  • env: SEGMENT_KEY

Set this options to enable Segment tracking.

Application Styles

  • env: LOGO
  • default: /boot/logo.png

URL of the logo to be used on the header.

logoMobile

  • env: LOGO_MOBILE
  • default: /boot/logo-mobile.png

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

  • env: HOME_LINK
  • default: /

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

favicon

  • env: FAVICON
  • default: /boot/favicon.ico

URL of the favicon.

organizationName

  • env: ORGANIZATION_NAME
  • default: DemocracyOS on GitHub

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

organizationUrl

  • env: ORGANIZATION_URL
  • default: https://github.com/DemocracyOS/app

Link to take the user when clicks on organizationName.

organizationEmail

  • env: ORGANIZATION_EMAIL
  • default: no-reply@democracyos.org

Sender email to show on all email notifications.

headerBackgroundColor

  • env: HEADER_BACKGROUND_COLOR
  • default: #7d4489

Background color of the header.

headerFontColor

  • env: HEADER_FONT_COLOR
  • default: #fff

Color of the header’s texts.

headerContrast

  • env: HEADER_CONTRAST
  • default: false

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

  • env: FREQUENTLY_ASKED_QUESTIONS
  • default: false

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

  • env: TERMS_OF_SERVICE
  • default: false

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

  • env: PRIVACY_POLICY
  • default: false

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

  • env: GLOSSARY
  • default: false

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

  • env: FACEBOOK_SIGNIN
  • default: false

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

learnMoreUrl

  • env: LEARN_MORE_URL
  • default: “”

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

  • env: RSS_ENABLED
  • default: true

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

commentsPerPage

  • env: COMMENTS_PER_PAGE
  • default: 0

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

feedsLimit

  • env: FEEDS_LIMIT
  • default: 10

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

tweetText

  • env: TWEET_TEXT
  • default: “”

Text used when sharing a topic on Twitter

googleAPIKey

  • env: GOOGLE_API_KEY
  • default: “”

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

  • env: SOCIALSHARE_SITE_NAME
  • default: “DemocracyOS”

siteDescription

  • env: SOCIALSHARE_SITE_DESCRIPTION
  • default: “DemocracyOS voting system”

image

  • env: SOCIALSHARE_IMAGE
  • default: “https://2.gravatar.com/avatar/a8b9176bd0d042db078bf38500727671?d=https%3A%2F%2Fidenticons.github.com%2F14bae9f2564556f8eb23cc263a779f59.png&s=400”

domain

  • env: SOCIALSHARE_DOMAIN
  • default: “democracyos.org”

twitter.username

  • env: SOCIALSHARE_TWITTER_USERNAME
  • default: “@democracyos”