title | position |
---|---|
Configuration |
3 |
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.
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 also can be used to override options (recommended for production
). Here's explained how to manage environment variables on Linux/Mac.
- Var names should be
CONSTANT_CASE
.- e.g.:
mongoUrl
=>MONGO_URL
- Scoped variables e.g.:
notifications.url
=>NOTIFICATIONS_URL
- e.g.:
Arrays
should be strings separated by commas.- e.g.:
"staff": ["[email protected]", "[email protected]"]
=>STAFF="[email protected],[email protected]"
- e.g.:
Boolean
values should betrue
orfalse
.- e.g.:
"rssEnabled": false
=>RSS_ENABLED="false"
- e.g.:
For more info, the values are casted using
lib/config/cast-string.js
.
- env:
LOCALE
- default:
en
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.
- env:
AVAILABLE_LOCALES
- default:
[ ... ]
Enabled languages. These are all the languages the user can select on the /settings
page.
- env:
PROTOCOL
- default:
http
Base protocol to be considered when building application URLs. Change it to https
for SSL-enabled servers.
- env:
HOST
- default:
localhost
Public accessible URL to your app. Used as base for internal URL building.
- env:
PUBLIC_PORT
- default:
3000
Port where the application should listen, and to be considered when building application URLs.
- env:
MONGO_URL
- default:
mongodb://localhost/DemocracyOS-dev
Full URL to your MongoDB storage solution. Including DB name.
- 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.
- env:
CORS_DOMAINS
- default:
[]
Domains allowed for Cross-Origin
requests. Set it to ["*"]
to allow requests from everywhere.
- env:
STAFF
- default:
[]
Users with emails listed here will have access to /admin
, and will be able to edit Topics, Tags, Whitelist users, etc...
- 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.
- env:
VISIBILITY
- default:
visible
- options:
visible
|hidden
When hidden
is selected, only registered users will be able to view the topics.
- 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.
- 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.
- env:
DEFAULT_FORUM
- default:
""
Optional value for setting an existent forum's name of a multiforum database for using it as a singleForum.
- env:
CLIENT
- default:
[ ... ]
Config options to be sended to the client, and usable from /lib/config.js
. In most cases, this shouldn't be edited.
- env:
FORCE_SAFE_IMAGE_URLS
- default:
true
When true
, the protocol of images added to Topics will be forcefully changed to config.protocol
.
- 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.
Values needed to use SSL. Go to the SSL section for installation instructions.
- env:
HTTPS_SERVER_KEY
- default:
server.key
Path to ssl key file.
- env:
HTTPS_SERVER_CERT
- default:
server.crt
Path to ssl certificate file.
- env:
HTTPS_PORT
- default:
443
Port where the https
server will listen to.
- 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.
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.
- env:
CERTBOT_KEY
Certbot key needed when manually generating the certificate, should be something like hvBj5jK2o3B6IpFhdrc8Q1OR6UeIl63_xXxXxXxXxXx
- env:
CERTBOT_TOKEN
Certbot token needed when manually generating the certificate, should be something like msbwzok5NNPLg2BjLBIGVali8utyXrc95xXxXxXxXxX
By default DemocracyOS uses an embeded Notifier. This options are used to configure mailer transports (gmail, mailchimp, sendgrid, etc).
- env:
NOTIFICATIONS_MAILER_SERVICE
Notifier service. Any of nodemailer-wellknown.
- env:
NOTIFICATIONS_MAILER_AUTH_USER
User for the notifier transport.
- env:
NOTIFICATIONS_MAILER_AUTH_PASS
Password for the notifier transport.
- env:
NOTIFICATIONS_NODEMAILER
Optional object that will override any nodemailer options for creating a mailerTransport.
In case you're using an external Notifier Server, these are the options that need to be configured.
- env:
NOTIFICATIONS_URL
Url of the Notifier server.
- env:
NOTIFICATIONS_TOKEN
Token of the Notifier server.
Values needed to setup facebook login. For a complete guide on how to setup facebook login go to Facebook Setup.
- env:
AUTH_FACEBOOK_CLIENT_ID
App ID of your facebook app.
- env:
AUTH_FACEBOOK_CLIENT_SECRET
App Secret of your facebook app.
- 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
Values needed to setup Basic HTTP authentication on the application.
- env:
AUTH_BASIC_USERNAME
Authentication Username.
- env:
AUTH_BASIC_PASSWORD
Authentication Password.
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.
- env:
MONGO_USERS_URL
Full URL to your MongoDB storage solution.
- env:
SIGNIN_URL
URL to redirect the users when gets to the signin page (/singin
).
- env:
SIGNUP_URL
URL to redirect the users when gets to the signup page (/signup
).
- env:
SETTINGS_URL
URL to redirect the users when gets to the settings page (/settings
).
- env:
GOOGLE_ANALYTICS_TRACKING_ID
Set this options to enable Google Analytics tracking.
- env:
SEGMENT_KEY
Set this options to enable Segment tracking.
- env:
LOGO
- default:
/boot/logo.png
URL of the logo to be used on the header.
- 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.
- env:
FAVICON
- default:
/boot/favicon.ico
URL of the favicon.
- env:
ORGANIZATION_NAME
- default:
DemocracyOS on GitHub
Title of the app to be shown on the right side of the header.
- env:
ORGANIZATION_URL
- default:
https://github.com/DemocracyOS/app
Link to take the user when clicks on organizationName
.
- env:
ORGANIZATION_EMAIL
- default:
[email protected]
Sender email to show on all email notifications.
- env:
HEADER_BACKGROUND_COLOR
- default:
#7d4489
Background color of the header.
- env:
HEADER_FONT_COLOR
- default:
#fff
Color of the header's texts.
- 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.
- 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
- 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
- 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
- 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
- env:
FACEBOOK_SIGNIN
- default: false
When true
will enable signin/signup using Facbook instead of the default email and password.
- 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.
- env:
TWEET_TEXT
- default: ""
Text used when sharing a topic on Twitter
- env:
GOOGLE_API_KEY
- default: ""
Key (string) used by google-translate use Google Translator in order to use the command in bin/dos-translate
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.
- env:
SOCIALSHARE_SITE_NAME
- default: "DemocracyOS"
- env:
SOCIALSHARE_SITE_DESCRIPTION
- default: "DemocracyOS voting system"
- env:
SOCIALSHARE_IMAGE
- default: "https://2.gravatar.com/avatar/a8b9176bd0d042db078bf38500727671?d=https%3A%2F%2Fidenticons.github.com%2F14bae9f2564556f8eb23cc263a779f59.png&s=400"
- env:
SOCIALSHARE_DOMAIN
- default: "democracyos.org"
- env:
SOCIALSHARE_TWITTER_USERNAME
- default: "@democracyos"