# Rasa X Environment Variables

Rasa X version 0.33.0 or higher is only compatible with Rasa Open Source 2.x. If you are on Rasa Open Source 1.x, please check the [compatibility matrix](https://legacy-docs-rasa-x.rasa.com/docs/rasa-x/changelog/compatibility-matrix) for a compatible version.

## Adding Environment Variables

To add extra environment variables to your containers, add the environment variable to an `extraEnvs` array on the service in your `values.yml`. These values can be provided directly or refer to [secrets](https://legacy-docs-rasa-x.rasa.com/docs/rasa-x/installation-and-setup/configure/use-external-secrets). The `extraEnvs` parameter is available for the `rasa`, `rasax`, `eventService`, and `app` services.

For example:

```yaml
# rasa: Settings common for all Rasa containers
rasa:
  # other configured parameters
  # ...
  extraEnvs:
    - name: "SANIC_RESPONSE_TIMEOUT"
      value: 7200

# app (custom action server) specific settings
app:
  # other configured parameters
  # ...
  extraEnvs:
    - name: "SECRET_USERNAME"
      valueFrom:
        secretKeyRef:
          name: "login-secret"
          key: "username"
```

To add environment variables to the `postgres`, `rabbit`, or `redis` services, see [Configuring the Subcharts](https://legacy-docs-rasa-x.rasa.com/docs/rasa-x/installation-and-setup/configure/configure-subcharts).

## Available Environment Variables

The environment variables below are configured by the Rasa X Helm chart and should only need to be configured directly in certain circumstances such as e.g. when [using Oracle as a database](https://legacy-docs-rasa-x.rasa.com/docs/rasa-x/installation-and-setup/configure/database#oracle). They are listed for reference and for cases where you do need to configure them directly.

### Rasa Variables

These variables define the behavior of the Rasa containers and how the other services connect to them.

| Variable | Default Value | Description |
| --- | --- | --- |
| `RASA_TOKEN` | **No default**, must be defined in `.env` | Authentication token for the Rasa service. This is used by other services to communicate with Rasa. |
| `RASA_MODEL_PULL_INTERVAL` | `10` | How often to check for new models, in seconds |
| `RABBITMQ_QUEUE` (`rasa-production`) | `rasa_production_events` | Which Rabbit event queue to publish events to. |
| `DB_DATABASE` (`rasa-production`) | `tracker` | Which database table to use to access and store trackers. |
| `DB_DATABASE` (`rasa-worker`) | `worker_tracker` | Which database table to use to access and store trackers. |
| `POSTGRESQL_SCHEMA` | **No default** | PostgreSQL track store database schema to access. By default, Rasa accesses the `public` schema. |
| `RASA_MODEL_SERVER` | `http://rasa-x:5002/api/models/tags/production` | URL where to access stored models and store new ones. |

### Rasa X API Variables

These variables define the behavior of the Rasa X API and how the other services connect to it.

| Variable | Default Value | Description |
| --- | --- | --- |
| `RASA_X_HOST` | `"http://rasa-x:5002"` | The URL of the Rasa X services. This is used by other services to connect to the Rasa X API. |
| `RASA_X_TOKEN` | **No default**, must be defined in `.env` | The token used for authentication between other services and the Rasa X API. |
| `RASA_X_USERNAME` (only for Rasa Enterprise) | **admin** | If `RASA_X_PASSWORD` is specified then the user with this username will be created automatically after Rasa X is started for the first time. |
| `RASA_X_PASSWORD` | **No default**, must be defined in `.env` if you want user to be created | If specified, this user with username `RASA_X_USERNAME` will be created immediately after Rasa X is started for the first time. |
| `JWT_SECRET` | **No default**, must be defined in `.env` | Symmetric JWT token for authentication protection of the Rasa API server. |
| `RASA_USER_APP` | `"http://app:5055"` | URL of the custom action server. |
| `RASA_PRODUCTION_HOST` | `http://rasa-production:5005` | Host and port at which to find the rasa-production server. |
| `RASA_WORKER_HOST` | `"http://rasa-worker:5005"` | Host and port at which to find the rasa-worker server. |
| `RASA_WORKER_TOKEN` | Interpolated from `RASA_TOKEN` | Authentication token used to connect to the Rasa services. |
| `RASA_MODEL_DIR` | `/app/models` | The directory in which models are stored on the Rasa X container. |
| `RABBITMQ_QUEUE` | `rasa_production_events` | Which queue to read conversation events from. |
| `ROOT_URL` | `"/"` | Root URL for the frontend to check for resources. Use this if you are hosting your Rasa X instance on a subdirectory of a domain. No trailing slash. |
| `PASSWORD_SALT` | **No default**, must be defined in `.env` | Salt used to securely store the users passwords. |
| `RASA_X_USER_ANALYTICS` | `0` | Binary value specifying whether Rasa X UI users’ conversations should be included in conversation analytics in the analytics tab. (Rasa Enterprise only) |
| `SANIC_RESPONSE_TIMEOUT` | `28800` | Number of seconds a request can run before Sanic generates a 503 response. |
| `SANIC_REQUEST_MAX_SIZE_IN_BYTES` | `800000000` | Maximum size of requests sent to server. For uploading large models. |
| `SANIC_ACCESS_CONTROL_MAX_AGE` | `1800` | Value (in seconds) to use for the `Access-Control-Max-Age` header in responses to preflight requests. |
| `RUN_EVENT_CONSUMER_AS_SEPARATE_SERVICE` | `"false"` | Whether the event service is run as a separate service. If `"false"`, Rasa X will launch the event service automatically as a subprocess. |
| `JWT_PUBLIC_KEY_PATH` | `"/app/public_key"` | Path where to store JWT authentication. |
| `JWT_PRIVATE_KEY_PATH` | `"/app/private_key"` | Path where to store JWT authentication. |
| `JWT_EXPIRATION_TIME` | `28800` | Expiration time in seconds for JWT tokens. |
| `DEBUG_MODE` | `"false"` | Whether or not to turn on debug logs. |
| `LOG_LEVEL` | `"INFO"` | Log level to use, overwritten by `DEBUG_MODE` if `DEBUG_MODE` variable is set. |
| `SAML_PATH` | `"/app/auth/saml"` | Path at which to store SAML authentication (Rasa Enterprise). |
| `SAML_DEFAULT_ROLE` | `"tester"` | Role to assign to SSO users upon first sign on (Rasa Enterprise). |
| `CREDENTIALS_PATH` | `"/app/credentials.yml"` | Path to `credentials.yml` in the Rasa X container. |
| `RASA_X_SSL_CERTIFICATE` | None | Path to SSL certificate if running the `rasa-x` container on HTTPS. |
| `RASA_X_SSL_KEYFILE` | None | Path to SSL keyfile if running the `rasa-x` container on HTTPS. |
| `RASA_X_SSL_PASSWORD` | None | Path to SSL password if running the `rasa-x` container on HTTPS with a password-protected keyfile. |
| `DEFAULT_E2E_TESTS_DIR` | `"tests"` | Directory where tests are saved on the Rasa X container. |
| `DEFAULT_E2E_TEST_FILE_PATH` | `"conversation_tests.md"` | File inside `DEFAULT_E2E_TESTS_DIR` where end-to-end tests are saved by default on the Rasa X container. |
| `MAX_DUMPING_DELAY_IN_SECONDS` | `60` | Training data changes are dumped to disk in a batches. This variable describes the maximum time in seconds after which changes are dumped to disk. |
| `POSTGRESQL_SCHEMA` | **No default** | PostgreSQL database schema to access. By default, Rasa X accesses the `public` schema. |

### RabbitMQ Variables

These variables define the behavior of RabbitMQ and how the other services connect to it. More information about RabbitMQ can be found in the [RabbitMQ docs](https://github.com/bitnami/bitnami-docker-rabbitmq#configuration).

| Variable | Description |
| --- | --- |
| `RABBITMQ_HOST` | Hostname of the RabbitMQ instance. |
| `RABBITMQ_PORT` | Port of the RabbitMQ instance. |
| `RABBITMQ_USERNAME` | Username used by other services to access RabbitMQ. |
| `RABBITMQ_PASSWORD` | Password used by other services to access RabbitMQ. |
| `RABBITMQ_QUEUE` | Queue from which the event service should read messages. |

### DB Variables

These variables define the connection details for the Rasa X database / the Rasa Open Source tracker store.

| Variable | Default Value | Description |
| --- | --- | --- |
| `DB_HOST` | `"db"` | Hostname of the container hosting the PostgreSQL database. |
| `DB_PORT` | `"5432"` | Port used by other services to access the database. |
| `POSTGRESQL_USERNAME` (`DB_USER`) | `"admin"` | Username used by other services to access the database. |
| `POSTGRESQL_PASSWORD` (`DB_PASSWORD`) | **No default**, must be defined in `.env` | Password used by other services to access the database. |
| `DB_LOGIN_DB` | `"rasa"` | Database connection used to create tracker database. |
| `POSTGRESQL_DATABASE` (`DB_DATABASE`) | `"rasa"` | Database used by other services to access the database.
