Skip to content

Deployment and Maintenance / Configuration Files

This article mainly introduces the configuration files of DataFlux Func and how to adjust them.

1. Configuration File Location

Please refer to Deployment and Maintenance / Configuration and Data Files / DataFlux Func Configuration

2. Configuration Items

Do not modify the configuration items not listed below

DataFlux Func has a large number of configurable items

The following only lists some commonly used ones that users can directly modify

Other configuration items not listed should not be modified arbitrarily

Restart required after modifying configuration

After modifying the configuration, the entire DataFlux Func needs to be restarted for the new configuration to take effect

Do not start individual services separately to avoid conflicts between services due to different configurations

Configuration Item Default Value Version Requirement Description
SECRET Randomly generated during deployment Private key. Used for login tokens, Connector configuration encryption, etc.
Note: Once configured, do not modify it, otherwise the system will not function properly
LOG_LEVEL "WARNING" Log level, options:
 "ALL": Output all
 "DEBUG": Output debug, info, warning, and error logs
 "INFO": Output info, warning, and error logs
 "WARNING": Output warning and error logs
 "ERROR": Output only error logs
 "NONE": No output
LOG_FILE_PATH "data/logs/dataflux-func.log" Log file output path
Must use absolute path
TIMEZONE "Asia/Shanghai" Timezone
LOG_FILE_FORMAT "text" Log output format, options:
 "text": Plain text format
 "json": JSON format
LOG_CONSOLE_COLOR false Whether to color terminal logs
WEB_BASE_URL "" Web service access URL
i.e., the address users need to enter in the browser address bar when accessing
Leave blank to follow the browser
WEB_BIND "0.0.0.0" Web service binding IP, e.g.:
 "0.0.0.0": For public access
 "127.0.0.1": For local access only
WEB_PORT 8088 Web service binding port
WEB_FIXED_RESPONSE_HEADERS_MAP null 6.3.0 Web service fixed response headers
Configuration Details
WEB_CORS_ORIGIN_LIST See Configuration Details 6.3.0 Web service CORS Origin list
Configuration Details
MYSQL_HOST Automatically filled during deployment MySQL host address
MYSQL_PORT 3306 MySQL port
MYSQL_USER "root" MySQL user
MYSQL_PASSWORD Randomly generated during deployment MySQL password
MYSQL_DATABASE "dataflux_func" MySQL database
REDIS_HOST Automatically filled during deployment Redis host address
REDIS_PORT 6379 Redis port
REDIS_DATABASE 5 Redis database
REDIS_USER "" Redis user
REDIS_PASSWORD Randomly generated during deployment Redis password
REDIS_USE_TLS false 1.1.9 Whether to enable TLS for Redis
REDIS_AUTH_TYPE "default" 2.8.1 Redis authentication method, options:
 "default": Default (i.e., original Redis)
 "aliyun": Alibaba Cloud database authentication
REDIS_MODE "auto" 6.2.12 Redis mode, options:
 "auto": Auto-detect
 "singleton": Standalone
 "cluster": Cluster
BAD_SIGNIN_TEMP_LOCK_ACTIVE_COUNT 10 Number of times to temporarily lock a user due to failed login attempts

3. Configuration Details

Details of some configuration items are as follows:

WEB_FIXED_RESPONSE_HEADERS_MAP

This configuration item is a dictionary structure

Web service fixed response headers

After configuration, all HTTP response headers of DataFlux Func will include the specified content

Example
1
2
WEB_FIXED_RESPONSE_HEADERS_MAP:
  X-Content-Type-Options: nosniff

WEB_CORS_ORIGIN_LIST

This configuration item is a list structure

Web service CORS Origin list

Each item in the list is a rule. The web service will match them in order and process according to the first matched rule

Available rules and their syntax are as follows:

Rule Example Description
Any "*" A rule that always matches, can be written as the last rule as the default rule
Origin Match "http://non.func.domain" Control for specific origin Origins
URL Match "http://non.func.domain/api/v1"
"http://non.func.domain/api/*"
"http://non.func.domain/api/v*"
"http://non.func.domain/api/**"
Control for specific origin Origins and only for requests to specific paths
Paths support * wildcard
Path Match "/api/v1"
"/api/*"
"/api/v*"
"/api/**"
CORS control only for requests to specific paths
Paths support * wildcard
Host Match "non.func.domain" Control only when the Host part of the origin Origin matches
i.e., ignoring HTTP protocol type
Host + Path Match "non.func.domain/api/v1"
"non.func.domain/api/*"
"non.func.domain/api/v*"
"non.func.domain/api/**"
Control only when the Host part of the origin Origin matches and only for requests to specific paths
Paths support * wildcard

By default, a match results in allowing CORS. Adding "!" at the beginning of a rule means disallowing CORS upon a match. If no rule matches, CORS is forbidden by default, e.g.:

Allow CORS for /api/v1/func-api/**, disallow for others
1
2
3
WEB_CORS_ORIGIN_LIST:
  - '/api/v1/func-api/**'
  - '!*

The current default configuration is as follows:

Default Value
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
WEB_CORS_ORIGIN_LIST:
  - '/api/v1/func-api/**'              # Func API interface
  - '/api/v1/cron/*'                   # Manual trigger Cron Job interface
  - '/api/v1/func-api-list'            # Func API list interface
  - '/api/v1/func/integration/sign-in' # Integration login interface
  - '/api/v1/fs/**'                    # File Service interface
  - '/api/v1/sync/**'                  # Sync API interface (legacy)
  - '/api/v1/async/**'                 # Async API interface (legacy)
  - '/api/v1/al/**'                    # Auth Link interface (legacy)
  - '/api/v1/bat/**'                   # Batch interface (legacy)