Skip to content

Configuration

Teddy Paul edited this page Dec 7, 2022 · 9 revisions

Each service has its own JavaScript configuration files. Default configuration can be overridden in 2 ways:

  • providing a local.js file in service config folder. Settings specified in this file will override default ones. More info here
  • setting environment variables at runtime.

Core

Config folder: apps/core/config

Available settings

All mandatory settings have no default value and must be provided

Env variable Description Default value Mandatory
Core server
SERVER_HOST Server host localhost
SERVER_PORT Server port 4001
SERVER_PUBLIC_URL Public URL http://localhost:4001
SERVER_WS_URL Websocket URL http://localhost:4001
API_ENDPOINT GraphlQL API endpoint graphql
SERVER_ALLOW_INTROSPECTION Allow GraphQL introspection queries true
SERVER_UPLOAD_LIMIT Upload limit 100mb
SERVER_SUPPORT_EMAIL Email shown in "contact support" links *
SERVER_ADMIN_LOGIN Admin default login *
SERVER_ADMIN_PASSWORD Admin default password *
SERVER_ADMIN_EMAIL Admin default email *
SERVER_SYSTEM_USER_EMAIL System user default email system@leav-engine.com
ArangoDB
ARANGO_URL ArangoDB URL, including username and password *
DB_NAME Database name *
Cache
DISK_CACHE_DIRECTORY Directory where disk cache will be stored /cache
Elastic Search
ELASTICSEARCH_URL Elastic Search URL http://elasticsearch:9200
Authentication
AUTH_KEY Key used to generate authentication token *
TOKEN_TTL Authentication token Time To Live 7d
AUTH_COOKIE_SAMESITE samesite settings for authentication cookies lax
AUTH_COOKIE_SECURE secure flag for authentication cookies false
AUTH_RESET_PWD_TTL "Reset password" time to live 20m
Sending emails
MAILER_HOST Host of server for sending emails localhost
MAILER_PORT Port of server for sending emails 587
MAILER_SECURE Use secure connection for sending emails false
MAILER_AUTH_USER Emails server username *
MAILER_AUTH_PWD Emails server password *
Languages
LANG_AVAILABLE Available languages ['fr', 'en']
LANG_DEFAULT Default language fr
Logs
LOG_LEVEL Log level (more info) info
LOG_TRANSPORT Log transport (Comma separated list of transport, including : console, file) console,file
LOG_FILE Log destination file * (if transport includes "file")
RabbitMQ
AMQP_HOST Host of RabbitMQ server *
AMQP_USERNAME Username of RabbitMQ server *
AMQP_PWD Password of RabbitMQ server *
AMQP_PORT Port of RabbitMQ server 5672
AMQP_EXCHANGE Exchange name where RabbitMQ messages are sent leav_core
AMQP_TYPE Type of exchange for messages routin (more info) direct
AMQP_PREFETCH Number of messages fetched simultaneously 5
Redis
REDIS_HOST Host of Redis server *
REDIS_PORT Port of Redis server *
REDIS_DATABASE Database number on Redis server 0
Files manager
FM_EVENTS_QUEUE Queue for files events files_events
FM_PREVIEW_REQUEST_QUEUE Queue for preview requests messages files_preview_request
FM_PREVIEW_RESPONSE_QUEUE Queue for preview response messages files_preview_response
FM_USER_ID ID of user used for all files related actions (eg. create records, update, ...) 2 (system user)
FM_USER_GROUPS_IDS ID of group for user used for all files related actions 1 (files admins group)
FILES_ROOT_PATHS Files root path by root key (eg. files1:/files,files2:/other_files_folder files1:/files
FILES_ORIGINALS_PREFIX Public path prefix for original files URL originals
Tasks manager
TM_NB_WORKERS Number of simultaneous workers Number of CPUs available
TM_ORDERS_QUEUE Queue for tasks orders (eg. creation, cancel, ...) tasks_orders
Debug more
DEBUG Enable debug mode false
Export
EXPORT_DIR Directory where export files are stored /exports
Import
IMPORT_DIR Directory where import files are stored /imports
IMPORT_SIZE_LIMIT Limit size (in megabytes) where the JSON file syntax is checked. This process requires a lot of memory. Setting this limit too high may make the whole process to crash if we reach memory limit 10
IMPORT_GROUP_DATA Number of elements processed simultaneously, to limit load on database server 50
Previews
PREVIEWS_DIRECTORY Directory where previews generated by previews generator are stored /results
Applications
APPLICATIONS_FOLDER Directory where applications instances (builds) are stored applications
DB profiling
DB_PROFILER_ENABLE Enable database profiling. This will add a "dbProfiler" section in all API calls. Do not use in production as it slows down every calls to DB

Automate Scan

Config folder: apps/automate-scan/config

Available settings

All mandatory settings have no default value and must be provided

Env variable Description Default value Mandatory
Allowed/ignored files
ALLOW_FILES_LIST List of comma seperated minimatch patterns of allowed files '' (all allowed)
IGNORE_FILES_LIST List of comma seperated minimatch patterns of ignored files '' (nothing ignored)
Root settings
ROOT_PATH Directory to monitor *
ROOT_KEY Root key to identify events related to this directory among all events. Useful when running multiple automate scan on multiple directories. Still mandatory even with only one automate scan running *
Redis
REDIS_HOST Host of Redis server *
REDIS_PORT Port of Redis server *
RabbitMQ
AMQP_PROTOCOL Protocol for communication with RabbitMQ amqp
AMQP_HOST Host of RabbitMQ server *
AMQP_PORT Port of RabbitMQ server 5672
AMQP_USERNAME Username of RabbitMQ server *
AMQP_PWD Password of RabbitMQ server *
AMQP_QUEUE Queue for files events files_events
AMQP_EXCHANGE Exchange where messages are sent leav_core
AMQP_ROUTING_KEY Routing key of messages files.event
AMQP_TYPE Exchange type direct
Clone this wiki locally