Skip to main content
To configure NRAI, you will need to set some environment variables, There is file called .env at the root directory for our main repo.
When you execute the tools/deploy.sh script in the Docker installation tutorial, it will produce these values.

Environment Variables

OpenTelemetry Configuration

NRAI supports both standard OpenTelemetry environment variables and vendor-specific configuration for observability and tracing.

OpenTelemetry Environment Variables

Note: Both AP_OTEL_ENABLED and OTEL_EXPORTER_OTLP_ENDPOINT must be set for OpenTelemetry to be enabled.
The frontend URL is essential for webhooks and app triggers to work. It must be accessible to third parties to send data.

Setting Webhook (Frontend URL):

The default URL is set to the machine’s IP address. To ensure proper operation, ensure that this address is accessible or specify an AP_FRONTEND_URL environment variable. One possible solution for this is using a service like ngrok (https://ngrok.com/), which can be used to expose the frontend port (4200) to the internet.

Setting Addon Source

These are the different options for the AP_PIECES_SOURCE environment variable:
  1. FILE: Only for Local Development, this option loads addons directly from local files. For Production, please consider using other options, as this one only supports a single version per addon.
  2. DB: This option will only load addons that are manually installed in the database from “My Addons” or the Admin Console in the EE Edition. Addons are loaded from npm, which provides multiple versions per addon, making it suitable for production.
You can also set AP_PIECES_SYNC_MODE to OFFICIAL_AUTO, where it will update the metadata of addons periodically.

Redis Configuration

Set the AP_REDIS_URL environment variable to the connection URL of your Redis server. Please note that if a Redis connection URL is specified, all other Redis properties will be ignored.
If you don’t have the Redis URL, you can use the following command to get it. You can use the following variables:
  • REDIS_USER: The username to use when connecting to Redis.
  • REDIS_PASSWORD: The password to use when connecting to Redis.
  • REDIS_HOST: The hostname or IP address of the Redis server.
  • REDIS_PORT: The port number for the Redis server.
  • REDIS_DB: The Redis database index to use.
  • REDIS_USE_SSL: Connect to Redis with SSL.
If you are using Redis Sentinel, you can set the following environment variables:
  • AP_REDIS_TYPE: Set this to SENTINEL.
  • AP_REDIS_SENTINEL_HOSTS: A comma-separated list of host:port pairs for Redis Sentinels. When set, all other Redis properties will be ignored.
  • AP_REDIS_SENTINEL_NAME: The name of the master node monitored by the sentinels.
  • AP_REDIS_SENTINEL_ROLE: The role to connect to, either master or slave.
  • AP_REDIS_PASSWORD: The password to use when connecting to Redis.
  • AP_REDIS_USE_SSL: Connect to Redis with SSL.
  • AP_REDIS_SSL_CA_FILE: The path to the CA file for the Redis server.