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 configuration items not listed below

DataFlux Func has a large number of configurable items

Only some commonly used items that users can directly modify are listed below

Do not modify other configuration items not listed here

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 error logs only
 "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 colorize console logs
WEB_BASE_URL "" Web service access URL
This is 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 See Configuration Details 6.3.0 Web service fixed response headers
Configuration Details
WEB_CORS_ORIGIN_LIST See Configuration Details 6.3.0 Web service cross-origin 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": Automatic detection
 "singleton": Standalone version
 "cluster": Cluster version
BAD_SIGNIN_TEMP_LOCK_ACTIVE_COUNT 10 Number of times a user is temporarily locked 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 contain the specified content

Example
1
2
WEB_FIXED_RESPONSE_HEADERS_MAP:
  X-Custom-Header: some-value

Default configuration is as follows:

Default Value
1
2
WEB_FIXED_RESPONSE_HEADERS_MAP:
  X-Content-Type-Options: nosniff
Default Value
1
WEB_FIXED_RESPONSE_HEADERS_MAP: null

WEB_CORS_ORIGIN_LIST

This configuration item is a list structure

Web service cross-origin Origin list

Each item in the list is a rule. When the web service receives a request, it will match sequentially and process according to the first matched rule

Available rules and their syntax are as follows:

Rule Example Description
Any "*" Always matching rule, can be written as the last rule as the default rule
Origin Match "http://non.func.domain" Control for specific origin Origin
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 Origin and only for specific request paths
Path supports * wildcard
Path Match "/api/v1"
"/api/*"
"/api/v*"
"/api/**"
CORS control only for specific request paths
Path supports * 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 specific request paths
Path supports * wildcard

By default, a match means allow cross-origin. Adding "!" at the beginning of a rule means disallow cross-origin if matched. If no rule is matched, cross-origin is forbidden by default, e.g.:

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

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 (old version)
  - '/api/v1/async/**'                 # Async API interface (old version)
  - '/api/v1/al/**'                    # Auth Link interface (old version)
  - '/api/v1/bat/**'                   # Batch interface (old version)