.env file. All settings are loaded at startup from the environment.
Configuration file
Create a.env file in the root directory of the project. You can use .env.example as a template:
Database connection
Database server hostname or IP address.Example:
192.168.0.137Database server port number.Example:
3306Name of the database to connect to.Example:
dbDatabase username for authentication.Example:
demoDatabase password for authentication.Example:
demoThe gateway uses these credentials to build a SQLAlchemy connection URL in the format:
mysql+pymysql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}MQTT settings
Unique identifier for the MQTT client connection. This ID is used when connecting to the MQTT broker.Example:
mqtt-gatewayMQTT keepalive interval in seconds. The client will send ping messages to the broker at this interval to maintain the connection.Example:
60Operational settings
Directory path where log files will be written.Example:
./logTimeout in seconds for HTTP requests when forwarding messages to HTTP endpoints.Example:
10Interval in seconds between automatic reloads of flow configurations from the database. This allows the gateway to pick up configuration changes without restarting.Minimum value:
1Example: 600 (10 minutes)