Configurations
Learn how to configure the Ocular backend.
Configurations in Ocular live in ocular-config-local.js
when running the application fully in Docker or ocular-config-dev.js
when running Ocular in dev mode.
ocular-config-xxx.js
export a configuration wit hte the following properties:
- projectConfig: An object that holds general configurations related to Ocular (jwtSecret, cookieSecret, database_url).
- plugins: Array of plugin configurations defining what plugins are installed and their configurations.
- apps: Array of app configurations defining what apps are installed and their configurations.
Example:
Enviroment Variables
Environment variables live in .env.local
or .env.dev
and can be referenced in ocular-config-xxx.js
.
Set enviroment variables in the files above reference them in ocular-config-xxx.js
.
projectConfig
Holds essential Ocular configurations such as DB configs,
jwtSecret
- A random string used to create jwt auth tokens. Not required but neccessary for added security.cookieSecret
- A random string used to create cookie tokens. Not required but neccessary for added security.database_url
- Connection URL of the database. ExampleDATABASE_URL=postgres://postgres@localhost/ocular-db
redis-url
- Used to specify the URL to connect to Rediskafka_url
- Used to specify the URL to connect to Kafkaui_cors
- Ocular backend API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.
plugins
Plugins add custom features to integrate with third-party services. plugins
holds configurations to install plugins in Ocular.
A plugin object has the following properties:
- resolve: Name of the plugin.
- options: Object that includes the plugin’s options. These options vary for each plugin, and you should refer to the plugin’s documentation for available options.
apps
Apps add custom features to index data from third-party services. apps
hold configurations to install apps in Ocular.