2018-11-26 10:53:33 +01:00
# Environment Configuration
##### Table of Contents
1. [Introduction ](#introduction )
2. [General settings ](#general-settings )
3. [Internationalization settings ](#internationalization-settings )
4. [Open projects settings ](#open-projects-settings )
< a name = "introduction" > < / a >
## Introduction
2020-01-13 17:05:53 +01:00
The following environment variables configure the addresses of the databases, some credentials, some application behaviours and the localization preferences.
2018-11-26 11:02:15 +01:00
If you are in a development environment, your can keep most of the default values, otherwise, in production, values must be configured carefully.
2020-05-13 14:46:25 +02:00
The settings in [.env ](../env.example ) configure the environment variables when the application run in development mode.
If you run the application in production with docker, the settings are localized in [config/env ](../setup/env.example ).
2018-11-26 10:53:33 +01:00
< a name = "general-settings" > < / a >
## General settings
2019-10-21 12:47:35 +02:00
< a name = "POSTGRES_HOST" > < / a >
2018-11-26 10:53:33 +01:00
POSTGRES_HOST
2018-11-26 11:02:15 +01:00
DNS name or IP address of the server hosting the PostgreSQL database of the application (see [PostgreSQL ](../README.md#postgresql )).
2018-11-26 15:14:43 +01:00
This value is only used when deploying in production, otherwise this is configured in [config/database.yml ](../config/database.yml.default ).
2019-09-30 16:43:58 +02:00
When using docker-compose, you should provide the name of the service in your [docker-compose.yml ](../docker/docker-compose.yml ) file (`postgres` by default).
2019-10-21 13:04:28 +02:00
< a name = "POSTGRES_PASSWORD" > < / a >
2018-11-26 10:53:33 +01:00
POSTGRES_PASSWORD
2019-09-30 16:43:58 +02:00
Password for the PostgreSQL user, as specified in `database.yml` (default: `postgres` ).
2018-11-26 15:14:43 +01:00
This value is only used when deploying in production, otherwise this is configured in [config/database.yml ](../config/database.yml.default ).
2019-09-30 16:43:58 +02:00
When using docker-compose, the default configuration (with `postgres` user) does not uses any password as it is confined in the docker container.
2019-10-21 13:04:28 +02:00
< a name = "REDIS_HOST" > < / a >
2018-11-26 10:53:33 +01:00
REDIS_HOST
DNS name or IP address of the server hosting the redis database.
2019-09-30 16:43:58 +02:00
When using docker-compose, you should provide the name of the service in your [docker-compose.yml ](../docker/docker-compose.yml ) file (`redis` by default).
2019-10-21 13:04:28 +02:00
< a name = "ELASTICSEARCH_HOST" > < / a >
2018-11-26 10:53:33 +01:00
ELASTICSEARCH_HOST
DNS name or IP address of the server hosting the elasticSearch database.
2019-09-30 16:43:58 +02:00
When using docker-compose, you should provide the name of the service in your [docker-compose.yml ](../docker/docker-compose.yml ) file (`elasticsearch` by default).
2019-10-21 13:04:28 +02:00
< a name = "SECRET_KEY_BASE" > < / a >
2018-11-26 10:53:33 +01:00
SECRET_KEY_BASE
Used by the authentication system to generate random tokens, eg. for resetting passwords.
Used by Rails to verify the integrity of signed cookies.
2020-03-25 17:58:53 +01:00
You can generate such a random key by running `rails secret` .
2019-10-21 13:04:28 +02:00
< a name = "INVOICE_PREFIX" > < / a >
2018-11-26 10:53:33 +01:00
INVOICE_PREFIX
When payments are done on the platform, an invoice will be generated as a PDF file.
2019-10-21 13:04:28 +02:00
The PDF file name will be of the form "(INVOICE_PREFIX) - (invoice ID) _ (invoice date) .pdf".
< a name = "FABLAB_WITHOUT_ONLINE_PAYMENT" > < / a >
2018-11-26 10:53:33 +01:00
2019-09-11 17:08:00 +02:00
FABLAB_WITHOUT_ONLINE_PAYMENT
If set to 'true', the online payment won't be available and the you'll be only able to process reservations when logged as admin.
2019-10-21 13:04:28 +02:00
Valid stripe API keys are still required, even if you don't require online payments.
2020-02-12 18:15:44 +01:00
< a name = "FABLAB_WITHOUT_WALLET" > < / a >
FABLAB_WITHOUT_WALLET
If set to 'true', the wallet will be disabled.
2020-03-02 15:47:43 +01:00
This is useful if you won't use wallet system.
2019-12-30 09:29:45 +01:00
< a name = "USER_CONFIRMATION_NEEDED_TO_SIGN_IN" > < / a >
USER_CONFIRMATION_NEEDED_TO_SIGN_IN
2020-01-07 10:34:12 +01:00
If set to 'true' the users will need to confirm their email address to be able to sign in.
Set to 'false' if you don't want this behaviour.
2019-10-21 13:04:28 +02:00
< a name = "DELIVERY_METHOD" > < / a >
2018-11-26 10:53:33 +01:00
DELIVERY_METHOD
Configure the Rails' Action Mailer delivery method.
See http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration for more details.
2020-06-02 18:29:24 +02:00
< a name = "SMTP_ADDRESS" > < / a > < a name = "SMTP_PORT" > < / a > < a name = "SMTP_USER_NAME" > < / a > < a name = "SMTP_PASSWORD" > < / a > < a name = "SMTP_AUTHENTICATION" > < / a > < a name = "SMTP_ENABLE_STARTTLS_AUTO" > < / a > < a name = "SMTP_OPENSSL_VERIFY_MODE" > < / a > < a name = "SMTP_TLS" > < / a >
2018-11-26 10:53:33 +01:00
2020-06-01 17:32:32 +02:00
SMTP_ADDRESS, SMTP_PORT, SMTP_USER_NAME, SMTP_PASSWORD, SMTP_AUTHENTICATION, SMTP_ENABLE_STARTTLS_AUTO, SMTP_OPENSSL_VERIFY_MODE & SMTP_TLS
2018-11-26 10:53:33 +01:00
When DELIVERY_METHOD is set to **smtp** , configure the SMTP server parameters.
See https://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration for more details.
2020-06-02 18:29:24 +02:00
< a name = "DEFAULT_HOST" > < / a > < a name = "DEFAULT_PROTOCOL" > < / a >
DEFAULT_HOST, DEFAULT_PROTOCOL
Your members will receive email notifications containing links to your of Fab-manager.
You must properly configure these variables to match URL of this instance, to prevent broken links.
Typically, `DEFAULT_PROTOCOL` will be `https` (`http` if you are in development, or if you set `ALLOW_INSECURE_HTTP` ).
The variable `DEFAULT_HOST` should be your domain name (eg. fabmanager.example.com), and is also used for visits statistics (configuration of Google Analytics).
2019-10-21 13:04:28 +02:00
< a name = "LOG_LEVEL" > < / a >
2018-11-26 10:53:33 +01:00
LOG_LEVEL
This parameter configures the logs verbosity.
Available log levels can be found [here ](http://guides.rubyonrails.org/debugging_rails_applications.html#log-levels ).
2019-10-21 13:04:28 +02:00
< a name = "MAX_IMAGE_SIZE" > < / a >
2018-11-26 10:53:33 +01:00
MAX_IMAGE_SIZE
Maximum size (in bytes) allowed for image uploaded on the platform.
This parameter concerns events, plans, user's avatars, projects and steps of projects.
If this parameter is not specified the maximum size allowed will be 2MB.
2019-10-21 13:04:28 +02:00
< a name = "MAX_CAO_SIZE" > < / a >
2018-11-26 10:53:33 +01:00
2019-09-24 16:38:16 +02:00
MAX_CAO_SIZE
Maximum size (in bytes) allowed for CAO files uploaded on the platform, as project attachments.
2019-09-24 17:42:50 +02:00
If this parameter is not specified, the maximum size allowed will be 5MB.
2019-10-21 13:04:28 +02:00
< a name = "MAX_IMPORT_SIZE" > < / a >
2019-09-24 17:42:50 +02:00
MAX_IMPORT_SIZE
Maximum size (in bytes) allowed for import files uploaded on the platform.
2020-01-13 17:05:53 +01:00
Currently, this is only used to import users from a CSV file.
2019-09-24 16:38:16 +02:00
If this parameter is not specified, the maximum size allowed will be 5MB.
2019-10-21 13:04:28 +02:00
< a name = "DISK_SPACE_MB_ALERT" > < / a >
2019-09-24 16:38:16 +02:00
2019-02-26 15:18:19 +01:00
DISK_SPACE_MB_ALERT
Threshold in MB of the minimum free disk space available on the current mount point.
2019-10-21 13:04:28 +02:00
The check will run every weeks and if the threshold is exceeded, an alert will be sent to every administrators.
< a name = "ADMIN_EMAIL" > < / a > < a name = "ADMIN_PASSWORD" > < / a >
2019-02-26 15:18:19 +01:00
2018-11-26 10:53:33 +01:00
ADMIN_EMAIL, ADMIN_PASSWORD
2020-01-13 17:05:53 +01:00
Credentials for the first admin user created when seeding the project.
2020-03-25 17:58:53 +01:00
By default, theses variables are not present in application.yml because they are only used once, when running the database seed with the command `rails db:seed` .
2019-10-21 13:04:28 +02:00
< a name = "SUPERADMIN_EMAIL" > < / a >
2018-11-26 10:53:33 +01:00
2019-03-20 16:49:38 +01:00
SUPERADMIN_EMAIL
2020-01-13 17:05:53 +01:00
Optional email of the administrator account in charge of the system administration.
2019-09-30 16:43:58 +02:00
If specified, it will be hidden from the administrators list and it will exclusively receive the notifications related to the system administration.
2020-01-13 17:05:53 +01:00
If not specified, every admins will receive system administration notifications.
2020-01-14 17:59:30 +01:00
< a name = "FORCE_VERSION_CHECK" > < / a >
FORCE_VERSION_CHECK
In test and development environments, the version won't be check automatically, unless this variable is set to "true".
2020-05-13 14:03:58 +02:00
< a name = "ALLOW_INSECURE_HTTP" > < / a >
ALLOW_INSECURE_HTTP
2020-05-18 16:23:53 +02:00
2020-05-13 14:03:58 +02:00
In production and staging environments, the session cookie won't be sent to the server unless through the HTTPS protocol.
If you're using Fab-manager on a non-public network or for testing purposes, you can disable this behavior by setting this variable to `true` .
Please, ensure you know what you're doing, as this can lead to serious security issues.
2018-11-26 10:53:33 +01:00
< a name = "internationalization-settings" > < / a >
2019-10-21 13:04:28 +02:00
## Internationalization setting.
< a name = "APP_LOCALE" > < / a >
2018-11-26 10:53:33 +01:00
APP_LOCALE
Configure application's main localization and translation settings.
See `config/locales/app.*.yml` for a list of available locales. Default is **en** .
2019-10-21 13:04:28 +02:00
< a name = "RAILS_LOCALE" > < / a >
2018-11-26 10:53:33 +01:00
RAILS_LOCALE
Configure Ruby on Rails localization settings (currency, dates, number formats ...).
Please, be aware that **the configured locale will imply the CURRENCY symbol used to generate invoices** .
_Eg.: configuring **es-ES** will set the currency symbol to ** €** but **es-MX** will set ** $** as currency symbol, so setting the `RAILS_LOCALE` to simple **es** (without country indication) will probably not do what you expect._
2019-01-02 15:47:12 +01:00
See [config/locales/rails.*.yml ](../config/locales ) for a list of available locales. Default is **en** .
2018-11-26 10:53:33 +01:00
If your locale is not present in that list or any locale doesn't have your exact expectations, please open a pull request to share your modifications with the community and obtain a rebuilt docker image.
You can find templates of these files at https://github.com/svenfuchs/rails-i18n/tree/rails-4-x/rails/locale.
2019-10-21 13:04:28 +02:00
< a name = "MOMENT_LOCALE" > < / a >
2018-11-26 10:53:33 +01:00
MOMENT_LOCALE
Configure the moment.js library for l10n.
2019-01-02 15:47:12 +01:00
See [github.com/moment/momentlocale/*.js ](https://github.com/moment/moment/tree/2.22.2/locale ) for a list of available locales.
2018-11-26 10:53:33 +01:00
Default is **en** (even if it's not listed).
2019-10-21 13:04:28 +02:00
< a name = "SUMMERNOTE_LOCALE" > < / a >
2018-11-26 10:53:33 +01:00
SUMMERNOTE_LOCALE
Configure the javascript summernote editor for l10n.
2019-01-02 15:47:12 +01:00
See [github.com/summernote/summernote/lang/summernote-*.js ](https://github.com/summernote/summernote/tree/v0.7.3/lang ) for a list of available locales.
2018-11-26 10:53:33 +01:00
Default is **en-US** (even if it's not listed).
2019-10-21 13:04:28 +02:00
< a name = "ANGULAR_LOCALE" > < / a >
2018-11-26 10:53:33 +01:00
ANGULAR_LOCALE
Configure the locale for angular-i18n.
Please, be aware that **the configured locale will imply the CURRENCY displayed to front-end users.**
_Eg.: configuring **fr-fr** will set the currency symbol to ** €** but **fr-ca** will set ** $** as currency symbol, so setting the `ANGULAR_LOCALE` to simple **fr** (without country indication) will probably not do what you expect._
2019-01-02 15:47:12 +01:00
See [code.angularjs.org/i18n/angular-locale_*.js ](https://code.angularjs.org/1.6.10/i18n/ ) for a list of available locales. Default is **en** .
2019-10-21 13:04:28 +02:00
< a name = "FULLCALENDAR_LOCALE" > < / a >
2018-11-26 10:53:33 +01:00
FULLCALENDAR_LOCALE
Configure the fullCalendar JS agenda library.
2019-01-02 15:47:12 +01:00
See [github.com/fullcalendar/fullcalendar/lang/*.js ](https://github.com/fullcalendar/fullcalendar/tree/v2.3.1/lang ) for a list of available locales. Default is **en-us** .
2019-10-21 13:04:28 +02:00
< a name = "ELASTICSEARCH_LANGUAGE_ANALYZER" > < / a >
2018-11-26 10:53:33 +01:00
ELASTICSEARCH_LANGUAGE_ANALYZER
This configure the language analyzer for indexing and searching in projects with ElasticSearch.
2019-01-02 15:47:12 +01:00
See [ElasticSearch guide ](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/analysis-lang-analyzer.html ) for a list of available analyzers.
2019-10-21 13:04:28 +02:00
< a name = "TIME_ZONE" > < / a >
2018-11-26 10:53:33 +01:00
TIME_ZONE
2020-03-25 17:58:53 +01:00
In Rails: set Time.zone default to the specified zone and make Active Record auto-convert to this zone. Run `rails time:zones:all` for a list of available time zone names.
2018-11-26 10:53:33 +01:00
Default is **UTC** .
2019-10-21 13:04:28 +02:00
< a name = "WEEK_STARTING_DAY" > < / a >
2018-11-26 10:53:33 +01:00
WEEK_STARTING_DAY
Configure the first day of the week in your locale zone (generally monday or sunday).
2019-10-21 13:04:28 +02:00
< a name = "D3_DATE_FORMAT" > < / a >
2018-11-26 10:53:33 +01:00
D3_DATE_FORMAT
Date format for dates displayed in statistics charts.
2019-12-18 15:57:13 +01:00
See [D3 Wiki ](https://github.com/d3/d3-time-format/blob/v2.2.2/README.md#locale_format ) for available formats.
2019-10-21 13:04:28 +02:00
< a name = "UIB_DATE_FORMAT" > < / a >
2018-11-26 10:53:33 +01:00
UIB_DATE_FORMAT
Date format for dates displayed and parsed in date pickers.
2019-01-02 15:47:12 +01:00
See [AngularUI documentation ](https://angular-ui.github.io/bootstrap/#uibdateparser-s-format-codes ) for a list available formats.
2018-11-26 10:53:33 +01:00
**BEWARE**: years format with less than 4 digits will result in problems because the system won't be able to distinct dates with the same less significant digits, eg. 50 could mean 1950 or 2050.
2019-10-21 13:04:28 +02:00
< a name = "EXCEL_DATE_FORMAT" > < / a >
2018-11-26 10:53:33 +01:00
EXCEL_DATE_FORMAT
Date format for dates shown in exported Excel files (eg. statistics)
2019-01-02 15:47:12 +01:00
See [Microsoft support ](https://support.microsoft.com/en-us/kb/264372 ) for a list a available formats.
2019-12-18 16:50:16 +01:00
< a name = "ENABLE_IN_CONTEXT_TRANSLATION" > < / a >
2018-11-26 10:53:33 +01:00
2019-12-18 16:50:16 +01:00
ENABLE_IN_CONTEXT_TRANSLATION
If set to `true` , and the application in started into a staging environment, this will enable the Crowdin In-context translation layer for the front-end application.
See [Crowdin documentation ](https://support.crowdin.com/in-context-localization/ ) for more details about this.
2020-04-08 15:55:08 +02:00
Accordingly, `RAILS_LOCALE` and `APP_LOCALE` must be configured to `zu` .
2018-11-26 10:53:33 +01:00
< a name = "open-projects-settings" > < / a >
2019-10-21 13:04:28 +02:00
## OpenLab settings
< a name = "OPENLAB_BASE_URI" > < / a >
OPENLAB_BASE_URI
Set this variable to `https://openprojects.fab-manager.com` if you want to use the common projects repository or set it to your own OpenLab server.