docs/docs/en/api/app/env.md
Used to set the application's time zone, defaults to the operating system's time zone.
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
:::warning Time-related operations will be processed according to this time zone. Modifying TZ may affect the date values in the database. For details, see 'Date & Time Overview' :::
Application environment, default value is development. Options include:
production - Production environmentdevelopment - Development environmentAPP_ENV=production
The application's secret key, used for generating user tokens, etc. Change it to your own application key and ensure it is not disclosed.
:::warning If APP_KEY is changed, old tokens will become invalid. :::
APP_KEY=app-key-test
Application port, default value is 13000.
APP_PORT=13000
NocoBase API address prefix, default value is /api/.
API_BASE_PATH=/api/
v1.6.0+
Multi-core (cluster) startup mode. If this variable is configured, it will be passed through to the pm2 start command as the -i <instances> parameter. The options are consistent with the pm2 -i parameter (see PM2: Cluster Mode), including:
max: use the maximum number of CPU cores-1: use the maximum number of CPU cores minus 1<number>: specify the number of coresThe default value is empty, which means it is not enabled.
:::warning{title="Note"} This mode needs to be used with cluster mode-related plugins, otherwise the application's functionality may be abnormal. :::
For more information, see: Cluster Mode.
Plugin package name prefix, defaults to: @nocobase/plugin-,@nocobase/preset-.
For example, to add the hello plugin to the my-nocobase-app project, the full package name of the plugin would be @my-nocobase-app/plugin-hello.
PLUGIN_PACKAGE_PREFIX can be configured as:
PLUGIN_PACKAGE_PREFIX=@nocobase/plugin-,@nocobase-preset-,@my-nocobase-app/plugin-
Then the mapping between plugin names and package names is as follows:
users plugin is @nocobase/plugin-usersnocobase plugin is @nocobase/preset-nocobasehello plugin is @my-nocobase-app/plugin-helloDatabase type, options include:
mariadbmysqlpostgresDB_DIALECT=mysql
Database host (required when using MySQL or PostgreSQL database).
Default value is localhost.
DB_HOST=localhost
Database port (required when using MySQL or PostgreSQL database).
DB_PORT=3306
Database name (required when using MySQL or PostgreSQL database).
DB_DATABASE=nocobase
Database user (required when using MySQL or PostgreSQL database).
DB_USER=nocobase
Database password (required when using MySQL or PostgreSQL database).
DB_PASSWORD=nocobase
Table prefix.
DB_TABLE_PREFIX=nocobase_
Whether to convert database table names and field names to snake case style, defaults to false. If you are using a MySQL (MariaDB) database and lower_case_table_names=1, then DB_UNDERSCORED must be true.
:::warning
When DB_UNDERSCORED=true, the actual table and field names in the database will not be consistent with what is seen in the interface. For example, orderDetails in the database will be order_details.
:::
Database logging switch, default value is off. Options include:
on - Enabledoff - DisabledDB_LOGGING=on
Log output transport, multiple values are separated by ,. The default value in development environment is console, and in production environment is console,dailyRotateFile. Options:
console - console.logfile - FiledailyRotateFile - Daily rotating fileLOGGER_TRANSPORT=console,dailyRotateFile
Output log level. The default value in development environment is debug, and in production environment is info. Options:
errorwarninfodebugtraceLOGGER_LEVEL=info
The database log output level is debug, and whether it is output is controlled by DB_LOGGING, not affected by LOGGER_LEVEL.
Maximum number of log files to keep.
LOGGER_TRANSPORT is file, the default value is 10.LOGGER_TRANSPORT is dailyRotateFile, use [n]d to represent days. The default value is 14d.LOGGER_MAX_FILES=14d
Rotate logs by size.
LOGGER_TRANSPORT is file, the unit is byte, and the default value is 20971520 (20 * 1024 * 1024).LOGGER_TRANSPORT is dailyRotateFile, you can use [n]k, [n]m, [n]g. Not configured by default.LOGGER_MAX_SIZE=20971520
Log printing format. The default in development environment is console, and in production environment is json. Options:
consolejsonlogfmtdelimiterLOGGER_FORMAT=json
See: Log Format
The unique identifier for the cache store to use, specifying the server-side default cache store. Default value is memory. Built-in options:
memoryredisCACHE_DEFAULT_STORE=memory
Maximum number of items in memory cache, default value is 2000.
CACHE_MEMORY_MAX=2000
Redis connection, optional. Example: redis://localhost:6379
CACHE_REDIS_URL=redis://localhost:6379
Enable telemetry data collection, defaults to off.
TELEMETRY_ENABLED=on
Enabled monitoring metric readers, defaults to console. Other values should refer to the registered names of the corresponding reader plugins, such as prometheus. Multiple values are separated by ,.
TELEMETRY_METRIC_READER=console,prometheus
Enabled trace data processors, defaults to console. Other values should refer to the registered names of the corresponding processor plugins. Multiple values are separated by ,.
TELEMETRY_TRACE_PROCESSOR=console