Skip to content

Latest commit

 

History

History
631 lines (477 loc) · 14 KB

Environment-Variables.md

File metadata and controls

631 lines (477 loc) · 14 KB

👈 Return to Overview

Environment Variables

One App can be configured via Environment Variables:

📖 Table of Contents

By Topic

Alphabetical Contents

⚠️ = Required

HOLOCRON_MODULE_MAP_URL

⚠️ Required In Production

Runs In

  • ✅ Production
  • ✅ Development

URL where the Module Map is hosted.

Defaults to http://localhost:3001/static/module-map.json if NODE_ENV is set to development so that One App Dev CDN can be leveraged for local development.

Shape

HOLOCRON_MODULE_MAP_URL=String

Example

HOLOCRON_MODULE_MAP_URL=https://my-cdn.com/module-map.json

Default Value

# if NODE_ENV=development
HOLOCRON_MODULE_MAP_URL=http://localhost:3001/static/module-map.json
# else
HOLOCRON_MODULE_MAP_URL=undefined

HOLOCRON_SERVER_MAX_MODULES_RETRY

Runs In

  • ✅ Production
  • ✅ Development

Maximum amount of times One App should retry on failed module fetches.

Shape

HOLOCRON_SERVER_MAX_MODULES_RETRY=Number

Default Value

HOLOCRON_SERVER_MAX_MODULES_RETRY=3

HOLOCRON_SERVER_MAX_SIM_MODULES_FETCH

Runs In

  • ✅ Production
  • ✅ Development

Maximum number of Holocron Modules One App will try to load at a time when new Modules are found in Module Map.

Useful to configure in case of a large module map and/or a bad network connection.

Shape

HOLOCRON_SERVER_MAX_SIM_MODULES_FETCH=Number

Default Value

HOLOCRON_SERVER_MAX_SIM_MODULES_FETCH=30

HTTPS_PORT

⚠️ Requires HTTPS_PRIVATE_KEY_PATH and HTTPS_PUBLIC_CERT_CHAIN_PATH to be set.

Runs In

  • ✅ Production
  • ✅ Development

Sets the port on which One App will listen for requests.

Shape

HTTPS_PORT=Number

Example

HTTPS_PORT=443

HTTPS_PRIVATE_KEY_PASS_FILE_PATH

Runs In

  • ✅ Production
  • ✅ Development

The file path to a file containing a shared passphrase for single private key (See Node documentation on passphrase for tls.createSecureContext).

Shape

HTTPS_PRIVATE_KEY_PASS_FILE_PATH=String

Example

HTTPS_PRIVATE_KEY_PASS_FILE_PATH=./some-extra-certs.pem

HTTPS_PRIVATE_KEY_PATH

Runs In

  • ✅ Production
  • ✅ Development

The file path to the private key of an SSL Certificate.

Shape

HTTPS_PRIVATE_KEY_PATH=String

Example

HTTPS_PRIVATE_KEY_PATH=./some-private-key.pem

HTTPS_PUBLIC_CERT_CHAIN_PATH

⚠️ Required by HTTPS_PORT

Runs In

  • ✅ Production
  • ✅ Development

The file path to the public key of an SSL Certificate.

Shape

HTTPS_PUBLIC_CERT_CHAIN_PATH=String

Example

HTTPS_PUBLIC_CERT_CHAIN_PATH=./some-cert.pem

HTTPS_TRUSTED_CA_PATH

⚠️ Required by HTTPS_PORT

Runs In

  • ✅ Production
  • ✅ Development

The file path to a file containing one or more certs to trust over the system default. See Node documentation on ca option in tls.createSecureContext.

Shape

HTTPS_TRUSTED_CA_PATH=String

Example

HTTPS_TRUSTED_CA_PATH=./some-extra-certs.pem

HTTP_METRICS_PORT

Runs In

  • ✅ Production
  • ✅ Development

Sets the port on which One App's metrics server (e.g. Prometheus) will listen for requests.

Shape

HTTP_METRICS_PORT=Number

Default Value

HTTP_METRICS_PORT=3005

HTTP_ONE_APP_DEV_CDN_PORT

Runs In

  • 🚫 Production
  • ✅ Development

Sets the port on which the One App Dev CDN server will listen for requests. It defaults to 3001 if NODE_ENV is development, otherwise it is undefined as it is only used for local development.

Shape

HTTP_ONE_APP_DEV_CDN_PORT=Number

Default Value

# if NODE_ENV=development
HTTP_ONE_APP_DEV_CDN_PORT=3001
# else
HTTP_ONE_APP_DEV_CDN_PORT=undefined

HTTP_ONE_APP_DEV_PROXY_SERVER_PORT

Runs In

  • 🚫 Production
  • ✅ Development

Sets the port on which the One App Dev Proxy server will listen for requests. It defaults to 3002 if NODE_ENV is development, otherwise it is undefined as it is only used for local development.

Shape

HTTP_ONE_APP_DEV_PROXY_SERVER_PORT=Number

Default Value

# if NODE_ENV=development
HTTP_ONE_APP_DEV_PROXY_SERVER_PORT=3002
# else
HTTP_ONE_APP_DEV_PROXY_SERVER_PORT=undefined

HTTP_PORT

Runs In

  • ✅ Production
  • ✅ Development

Sets the port on which One App will listen for requests.

Shape

HTTP_PORT=Number

Default Value

HTTP_PORT=3000

IP_ADDRESS

Runs In

  • ✅ Production
  • ✅ Development

Specify a specific IP Address for One App to bind to.

Shape

IP_ADDRESS=String

Example

IP_ADDRESS=192.168.1.1

NODE_ENV

Runs In

  • ✅ Production
  • ✅ Development

May be set to either production or development. When set to development additional tooling such as one-app-dev-cdn and one-app-dev-proxy is provided to help with local development. It is undefined by default.

Setting this to development will set a lot of the other environment variables for you to provide sane development time defaults.

Example

NODE_ENV=production

ONE_CLIENT_CDN_URL

⚠️ Required In Production

Runs In

  • ✅ Production
  • ✅ Development

Fully qualified base path URL where the Module Bundle folders are located (See Module Map).

Shape

ONE_CLIENT_CDN_URL=String

Example

ONE_CLIENT_CDN_URL=https://app-cdn.com/statics/

Default Value

# if NODE_ENV=development
ONE_CLIENT_CDN_URL=/_/static/
# else
ONE_CLIENT_CDN_URL=undefined

ONE_CLIENT_LOCALE_FILENAME

Runs In

  • ✅ Production
  • ✅ Development

Locale file name for module language packs. Modifying this per environment allows for modules to have different language packs in different environments.

Must be one of integration, qa, or be undefined (for production). It is undefined by default.

Shape

ONE_CLIENT_LOCALE_FILENAME=String

Example

ONE_CLIENT_LOCALE_FILENAME=integration

Default Value

ONE_CLIENT_LOCALE_FILENAME=undefined

ONE_CLIENT_REPORTING_URL

⚠️ Required In Production

Runs In

  • ✅ Production
  • ✅ Development

URL where browser should send client side errors to. Defaults to /_/report/errors if NODE_ENV is set to development and is undefined otherwise.

Shape

ONE_CLIENT_REPORTING_URL=String

Example

ONE_CLIENT_REPORTING_URL=https://my-app-errors.com/client

Default Value

# if NODE_ENV=development
ONE_CLIENT_REPORTING_URL=/_/report/errors
# else
ONE_CLIENT_REPORTING_URL=undefined

ONE_CLIENT_CSP_REPORTING_URL

⚠️ Required In Production

Runs In

  • ✅ Production
  • ✅ Development

URL where browser should send CSP errors to. Defaults to /_/report/security/csp-violation if NODE_ENV is set to development and is undefined otherwise.

Shape

ONE_CLIENT_CSP_REPORTING_URL=String

Example

ONE_CLIENT_CSP_REPORTING_URL=https://my-app-csp-violations.example.com/client

Default Value

# if NODE_ENV=development
ONE_CLIENT_CSP_REPORTING_URL=/_/report/security/csp-violation
# else
ONE_CLIENT_CSP_REPORTING_URL=undefined


## `ONE_CLIENT_ROOT_MODULE_NAME`

⚠️ Required In Production & Development

**Runs In**
* ✅ Production
* ✅ Development

Name of the module that serves as the entry point to your application. In local development this is
not necessary as you can pass the [`--root-module-name` argument to `npm start`](./Cli-Commands.md#start-commands) instead.

**Shape**
```bash
ONE_CLIENT_ROOT_MODULE_NAME=String

Example

ONE_CLIENT_ROOT_MODULE_NAME=frank-lloyd-root

ONE_CONFIG_ENV

Runs In

  • ✅ Production
  • ✅ Development

An arbitrary String key that is used to look up values provided in App Configuration's provideStateConfig for its children modules.

Shape

ONE_CONFIG_ENV=String

Example

ONE_CONFIG_ENV=staging

Default Value

ONE_CONFIG_ENV=undefined

ONE_ENABLE_POST_TO_MODULE_ROUTES

Runs In

  • ✅ Production
  • ✅ Development

Set if One App should respond to POST requests.

Shape

ONE_ENABLE_POST_TO_MODULE_ROUTES=Boolean

Default Value

ONE_ENABLE_POST_TO_MODULE_ROUTES=false

ONE_MAP_POLLING_MAX

Runs In

  • ✅ Production
  • ✅ Development

Maximum time allowed between module map polls for new modules from One App (in seconds).

Shape

ONE_MAP_POLLING_MAX=Number

Default Value

ONE_MAP_POLLING_MAX=300

ONE_MAP_POLLING_MIN

Runs In

  • ✅ Production
  • ✅ Development

Minimum time allowed between Module Map polls for new modules from One App (in seconds).

Shape

ONE_MAP_POLLING_MIN=Number

Default Value

ONE_MAP_POLLING_MIN=0

ONE_REFERRER_POLICY_OVERRIDE

Runs In

  • ✅ Production
  • ✅ Development

Overrides the Referrer-Policy header.

Must be one of: no-referrer, no-referrer-when-downgrade, same-origin or strict-origin.

Shape

ONE_REFERRER_POLICY_OVERRIDE=String

Exampke

ONE_REFERRER_POLICY_OVERRIDE=no-referrer

Default Value

ONE_REFERRER_POLICY_OVERRIDE=same-origin

ONE_SERVICE_WORKER

Runs In

  • ✅ Production
  • ✅ Development

Feature flag to enable service worker and PWA feature, defaults to false.

Shape

ONE_SERVICE_WORKER=Boolean

Example

ONE_SERVICE_WORKER=true

Default Value

ONE_SERVICE_WORKER=false

📘 More Information

☝️ Return To Top