---
url: /v7.0/en-us/setting-system-env.md
---
# Environment Variables

HENGSHI SENSE provides a wide range of features for different business scenarios. You can adjust environment variables to meet specific environment and feature requirements.

The following sections list key environment variables and their descriptions.

***

**APP_CONFIG_APP_ENABLE_EXTEND_APP_APPROVAL**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to enable extended app approval for apps. |

***

**APP_CONFIG_APP_ENABLE_RULE_STRICT_VALIDATE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to enable strict rule validation for apps. |

***

**APP_CONFIG_ENABLE_TENANT_APP_VERSION**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to enable app version management for tenants. This takes effect only if the current license supports app version management. |

***

**ENGINE_CONFIG_ANALYZE_ENGINE_TABLE_WHEN_IMPORT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to analyze engine tables when importing data into the engine. |

***

**ENGINE_CONFIG_DATASET_CACHE_IMPORT_MAX_TIME**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `3` | Maximum time for dataset cache imports (hours). |

***

**ENGINE_CONFIG_ENGINE_FIELD_TYPE_CHANGE_AUTO_IMPORT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to import data automatically when an engine field type changes. |

***

**ENGINE_CONFIG_ENGINE_FIELD_TYPE_CHANGE_IMPORT_DELAY_TIME**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `120` | Delay before importing data after an engine field type changes (seconds). |

***

**ENGINE_CONFIG_ENGINE_IMPORT_CHECK_TABLE_EXISTS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to check if a table exists when importing data into the engine. |

***

**ENGINE_CONFIG_ENGINE_IMPORT_EXPR_JSON_FIELD**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to import expression JSON fields when importing data into the engine. |

***

**ENGINE_CONFIG_ENGINE_IMPORT_FROM_PG_BATCH_FETCH_SIZE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `-1` |  |

***

**ENGINE_CONFIG_ENGINE_IMPORT_USER_EXPR_AND_TYPE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to use user-defined expressions and types when importing data into the engine. |

***

**ENGINE_CONFIG_ENGINE_TABLES_SYNC_INTERVAL**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `3600000` | Interval between engine table synchronizations (ms). |

***

**ENGINE_CONFIG_GPDB_ENGINE_IDLE_IN_TRANSACTION_MAX**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `60` | Maximum idle-in-transaction duration for GPDB engine cleanup during query queue and engine resource management. |

***

**ENGINE_CONFIG_GPDB_WITH_TO_TEMP_TABLE_THRESHOLD**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `5` | Threshold for using temporary tables in GPDB. |

***

**EXTERNAL_DB_CONFIG_BATCH_INSERT_MAX_CELL_COUNT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `100000` | Maximum number of cells in a batch insert. |

***

**EXTERNAL_DB_CONFIG_CONN_LOCK_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `600000` | Connection lock timeout (ms). |

***

**EXTERNAL_DB_CONFIG_DORIS_BATCH_INSERT_SIZE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `-1` |  |

***

**EXTERNAL_DB_CONFIG_DORIS_TABLE_NAME_MAX_LENGTH**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `64` |  |

***

**EXTERNAL_DB_CONFIG_DORIS_TABLE_REPLICATION_NUM**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `1` |  |

***

**EXTERNAL_DB_CONFIG_JDBC_CONNECT_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `20` | JDBC connection timeout (seconds). |

***

**EXTERNAL_DB_CONFIG_JDBC_GET_CONN_TEST_SOCKET**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to test the socket when obtaining a JDBC connection. |

***

**EXTERNAL_DB_CONFIG_JDBC_SOCKET_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `3600` | JDBC socket timeout (seconds). |

***

**EXTERNAL_DB_CONFIG_SPLIT_BATCH_FOR_STAR_ROCKS_SPECIAL_CHAR_INSERT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to split batches when inserting special characters into StarRocks. |

***

**EXTERNAL_DB_CONFIG_THROTTLE_QUERY_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `600` | Timeout for throttled vendor queries (seconds). |

***

**GENERAL_CONFIG_API_DATASET_IMPORT_TIME_OUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `3600000` | API dataset import timeout (ms). The default is one hour. |

***

**GENERAL_CONFIG_APP_IMAGE_MAX_AGE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `31536000` | Maximum age of app images (seconds). |

***

**GENERAL_CONFIG_AUDIT_LOG_HISTORY_RESERVE_DAYS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `90` | Retention period for audit log history (days). |

***

**GENERAL_CONFIG_CHART_DATA_ROWS_LIMIT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `100000` | Maximum number of chart data rows. |

***

**GENERAL_CONFIG_COLUMN_AUTH_HIDE_FIELD_NAME**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to hide field names based on column permissions. |

***

**GENERAL_CONFIG_DEFAULT_IMAGE_COMPRESS_QUALITY**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `0.75` | Image compression ratio. |

***

**GENERAL_CONFIG_DOWNLOAD_INTERVAL**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `5000` |  |

***

**GENERAL_CONFIG_DOWNLOAD_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `55000` | Download timeout (ms). |

***

**GENERAL_CONFIG_ENABLE_BODY_ENCODE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to encode HTTP request bodies. Refresh the page after changing this setting for it to take effect. |

***

**GENERAL_CONFIG_ENABLE_VERIFY_ADMIN_PASSWORD**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to verify the current user's password when resetting a password. |

***

**GENERAL_CONFIG_EVEREST_DELETED_USER_RESERVED_DAYS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `15` | Retention period for deleted users (days). Users are soft-deleted by default and permanently deleted only after this period. |

***

**GENERAL_CONFIG_EVEREST_MSG_MAX_LENGTH**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `300` |  |

***

**GENERAL_CONFIG_EXPORT_INVISIBLE_FIELDS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to include invisible fields in exports. |

***

**GENERAL_CONFIG_FILE_HEADER_ABNORMAL_RATIO_THRESHOLD**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `1.1` | Threshold for the file header anomaly ratio. |

***

**GENERAL_CONFIG_FILE_HEADER_SUPPORT_PADDING**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to support adding headers automatically to files that contain only data. |

***

**GENERAL_CONFIG_FILE_MEM_PROCESSING_THRESHOLD**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `52428800` | Threshold for processing files in memory (bytes). |

***

**GENERAL_CONFIG_FILE_TYPE_DETECT_LINE_LIMIT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `50000` | Maximum number of rows to inspect for type detection in files. |

***

**GENERAL_CONFIG_HENGSHI_ACCESS_AGGREGATION_LOG_RESERVED_DAYS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `180` | Retention period for aggregated access logs (days). |

***

**GENERAL_CONFIG_HENGSHI_ACCESS_LOG_RESERVED_DAYS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `32` | Retention period for access logs (days). |

***

**GENERAL_CONFIG_HENGSHI_BACKGROUND_JOB_LOG_RESERVED_DAYS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `2` | Retention period for background job logs (days). |

***

**GENERAL_CONFIG_LOGIN_BLOCK_MINUTE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `3` | Duration of the block after failed login attempts (minutes). |

***

**GENERAL_CONFIG_LOGIN_RETRY_COUNT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `3` | Number of retries after failed login attempts. |

***

**GENERAL_CONFIG_PLATFORM_CONNECTION_AUTH**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| string | `customize` | Permissions for platform connections authorized for tenants.`customize`: Tenant administrators can manage permissions themselves.`read`: All users in the tenant have `read` permission. |

***

**GENERAL_CONFIG_PLATFORM_FOLDER_AUTH**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| string | `customize` | Permissions for platform folders/data packages authorized for tenants.`customize`: Tenant administrators can manage permissions themselves.`read`: All users in the tenant have `read` permission. |

***

**GENERAL_CONFIG_SAMPLE_COUNT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `10000` | Number of samples. |

***

**GENERAL_CONFIG_SESSION_COOKIE_MAX_AGE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `86400` | Maximum cookie age. |

***

**HE_QUERY_CONFIG_CONSTANT_EXPRESSION_OPTIMIZER**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to enable the constant expression optimizer. |

***

**HE_QUERY_CONFIG_DISABLE_MINIO_CACHE_FOR_CHART_DATA**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to disable storing chart data in MinIO when it exceeds the threshold. |

***

**HE_QUERY_CONFIG_ENGINE_FALLBACK_DATA_QUERY_TO_SOURCE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether engine data queries can fall back to querying the data source. |

***

**HE_QUERY_CONFIG_REDIS_MAX_CHART_DATA_SIZE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `2621440` | Maximum length of chart data stored in Redis, measured as the length of the serialized JSON string.The default corresponds to 5 MB, calculated at 2 bytes per character. |

***

**MESSAGE_PUSH_CONFIG_APP_EMAIL_ATTACHEMENT_MAX_SIZE_MB**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `25` | Maximum email attachment size for app subscriptions (MB). |

***

**MESSAGE_PUSH_CONFIG_APP_SUBSCRIBE_NEED_MERGE_CHART_EXCEL_TABLE_MAX_SIZE_MB**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `5` | Maximum size of chart Excel tables to merge for app subscriptions (MB). |

***

**MESSAGE_PUSH_CONFIG_EXPORT_TABLE_MAX_DATA_NUM**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `50000` | Maximum number of data records in table exports for app subscriptions. |

***

**MESSAGE_PUSH_CONFIG_EXPORT_TABLE_MAX_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | 180000 | Maximum timeout for table exports in app subscriptions (ms). |

***

**MESSAGE_PUSH_CONFIG_EXPORT_TABLE_RETRY_WAIT_TIME**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `5000` | Wait time before retrying a table export in an app subscription (ms). |

***

**MESSAGE_PUSH_CONFIG_MAX_NOTIFY_TEST_API_CALL_TIMES**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `10` | Maximum number of notification test API calls. |

***

**SCREENSHOT_CONFIG_HENGSHI_THUMBNAIL_DELAY_TIME**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `10` | Delay before generating thumbnails (seconds). |

***

**SCREENSHOT_CONFIG_HENGSHI_THUMBNAIL_ENABLED**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether to enable thumbnail generation. |

***

**SCREENSHOT_CONFIG_SCREENSHOT_CHART_BASE_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `40000` | Base screenshot timeout (ms). |

***

**SCREENSHOT_CONFIG_SCREENSHOT_IS_NICE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to use `nice` for screenshots. |

***

**SCREENSHOT_CONFIG_SCREENSHOT_NICE_VALUE**

| Value type | Default value | Description |
| ------ | ------ | ---------- |
| number | `19`   | `nice` value for screenshots. |

***

**SCREENSHOT_CONFIG_SCREENSHOT_JS_TIMEOUT_DIFF**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `8000` | JavaScript timeout difference for screenshots (ms). |

***

**SCREENSHOT_CONFIG_SCREENSHOT_MAX_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `90000` | Maximum screenshot timeout (ms). |

***

**SCREENSHOT_CONFIG_SCREENSHOT_PPT_EXPORT_MAX_IMG_SIZE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `10000000` | Maximum image size for PowerPoint exports (bytes). |

***

**SCREENSHOT_CONFIG_SCREENSHOT_PUBLISHED_THUMBNAIL_RESIZE_FACTOR**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `6` | Thumbnail resize factor. |

***

**SCREENSHOT_CONFIG_SCREENSHOT_RETRY_INTERVAL**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `1000` | Screenshot retry interval (ms). |

***

**SCREENSHOT_CONFIG_SCREENSHOT_RETRY_NUM**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `3` | Number of screenshot retries. |

***

**SCREENSHOT_CONFIG_SCREENSHOT_WAIT_TIMEOUT**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `1200000` | Screenshot wait timeout (ms). |

***

**SCREENSHOT_CONFIG_THUMBNAIL_MAX_AGE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `300` |  |

***

### Notebook SQL Security Checks

**SECURITY_CORS_CONFIG_VALIDATE_NOTEBOOK_SQL_SECURITY**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `false` | Whether to enable Notebook SQL security checks in 7.0. When set to `true`, supported statements and sensitive functions are checked before execution. SQL that cannot be safely recognized or is flagged as risky is rejected. |

A system administrator can open **System Settings > Environment Variables**, set this variable to `true`, and save. The checks are disabled by default; existing environments use their actual configured value. Disabling the setting skips these checks. This setting is independent of SQL function security checks for SQL datasets and API custom queries.

**Secure data source accounts with the minimum required privileges first. HENGSHI security checks alone cannot provide complete protection.** For supported data sources, allowed syntax, and check limits, see [Scripts: SQL Security Checks](data-science.md#SQL-Security-Checks).

***

**SECURITY_CORS_CONFIG_ACCESS_CONTROL_ALLOW_CREDENTIALS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| boolean | `true` | Whether browsers can include credentials in cross-origin requests. The default (`true`) is recommended.Reference: [Access-Control-Allow-Credentials](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Credentials) |

***

**SECURITY_CORS_CONFIG_ACCESS_CONTROL_ALLOW_HEADERS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| string | `Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId, token, X-Request-Domain, X-Request-Hash-Url, X-CSRF-Token, x-request-proxy` | Request headers that browsers are allowed to use in cross-origin requests. When adding a header, include all existing values as well.Reference: [Access-Control-Allow-Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Headers) |

***

**SECURITY_CORS_CONFIG_ACCESS_CONTROL_ALLOW_METHODS**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| string | `POST, GET, PUT, OPTIONS, DELETE` | HTTP methods that browsers are allowed to use in cross-origin requests.Reference: [Access-Control-Allow-Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods) |

***

**SECURITY_CORS_CONFIG_ACCESS_CONTROL_ALLOW_ORIGIN**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| string | \`\` | External domains allowed to access the resource.Reference: [Access-Control-Allow-Origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Origin) |

***

**SECURITY_CORS_CONFIG_ACCESS_CONTROL_MAX_AGE**

| Value type | Default value | Description |
| ------- | ------ | ------- |
| number | `-1` | How long preflight request results can be cached (seconds).Reference: [Access-Control-Max-Age](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Max-Age) |
