Skip to main content

Environment Variables

Manifold uses Environment variables to orchestrate and configure its various services.

Package Install#

Environment variables for the Manifold API and Client are stored in /var/opt/manifold/etc/. Do not edit these files directly, as they are generated anew each time you run manifold-ctl reconfigure. Instead, edit the master configuration file at etc/manifold/manifold.rb. To inject environment variables for the API, expose your environment variables as a hash at manifold_api['env']. Remember, this file is a Ruby file and should be valid Ruby syntax.

#### Add custom environment to Manifold API
manifold_api['env'] = {
"FOO" => "bar"
}

As always, once you've updated this file, run sudo manifold-ctl reconfigure to apply your changes. Look at /var/opt/manifold/etc/api-env.sh to confirm that your additons to the environment persisted.

Other installation types#

In a Docker environment, you can pass environment variables to services using the Docker Compose file. When developing locally or deploying from source, it's also possible to set variables in the application's root .env file.

Available Variables#

The following environment variables can be used to adjust Manifold's behavior. Variables can be exposed to the Client and/or the API services, [C] and [A] accordingly.

Environment Variables
DOMAIN[C, A] The FQDN domain name for the instance
SSL_ENABLED[C, A] True if SSL is enabled
NODE_TLS_REJECT_UNAUTHORIZED [C] True if client should accept self-signed API certificates
API_SOCKET[A] Location for the API service socket file
API_CABLE_SOCKET[A] Location for the cable service socket file
CLIENT_SERVER_SOCKET[C]Location for the client service socket file
CLIENT_SERVER_PORT[C] Expose the client service on a port
API_PORT[A] Expose the API service on a port
API_CABLE_PORT[A] Expose the cable service on a port
CLIENT_URL[C, A] The base URL for the client
CLIENT_BROWSER_API_URL[C] The base URL that the client should use to access the API
CLIENT_BROWSER_API_CABLE_URL[C] The base URL that the client should use to access cable
CLIENT_SERVER_PROXIES[C] Allows the client to proxy requests to the API
ELASTICSEARCH_URL[A] The URL of Elasticsearch
NODE_ENV[C] The client environment (production, development)
RAILS_ENV[A] The API environment (production, development)
RAILS_DB_PORT[A] Postgres port
RAILS_DB_HOST[A] Postgres host
RAILS_DB_NAME[A] Postgres database name
RAILS_DB_USER[A] Postgres user
RAILS_DB_USER[A] Postgres password
RAILS_DB_PASS[A] Redis URL
RAILS_SECRET_KEY[A] A long, secret, string
MANAGE_SETTINGS_FROM_ENV[A] Allow settings to be managed from the environment
tip

It is also possible to manage Manifold settings through the environment. See our documentation on managing settings for more information.