Skip to content

Backend

WARNING

Manual editing is usually not required; you typically only need to fill in the main variables because there is a file that generates .env files for services.

VariableDefaultPurpose
PU_FF_TELEGRAM_BOT_ENABLETrueFeature flag that controls whether the Telegram Bot is enabled
PU_FF_GRAFANA_INTEGRATION_ENABLETrueFeature flag that controls whether integration with Grafana is enabled
PU_FF_DATAPIPE_DEFAULT_LAST_VALUE_ENABLETrueFeature flag that controls whether DataPipe of type LastValue is created by default for each UnitNode
PU_FF_DATAPIPE_ENABLETrueFeature flag that controls whether DataPipe capabilities are enabled. When disabled, you should also stop the DataPipe service, as it will no longer receive configuration updates, etc.
PU_FF_PROMETHEUS_ENABLETrueFeature flag that controls whether monitoring of requests via Prometheus is enabled
PU_LOG_FORMATjsonLog format. In json mode, each log record is a single dict. In plain mode, logs are standard text lines, but traceback is written line by line
PU_MIN_LOG_LEVELINFOMinimum log level output to the console. Logs below this level are not shown. Allowed values: DEBUG, INFO, WARNING, ERROR, CRITICAL
PU_APP_PREFIX/pepeunitStandard prefix used to separate app paths from the domain; usually does not need changes. Useful for complex embedded setups
PU_API_V1_PREFIX/api/v1Prefix for REST API version. Allows supporting old REST API versions and multiple versions simultaneously
PU_WORKER_COUNT2Number of Gunicorn workers; increases the load that the Backend can handle
PU_DOMAIN-Domain name or IP. Affects links generated by the Backend and allows Unit to connect to the Backend. Propagated to Unit ENV as PU_DOMAIN
PU_SECURETrueIf True, the Backend generates https links for PU_DOMAIN. Propagated to Unit ENV field PU_HTTP_TYPE as https/http
PU_AUTH_TOKEN_EXPIRATION2678400Lifetime of user auth tokens, in seconds
PU_SAVE_REPO_PATHrepo_cachePath where the Backend stores external Git repositories, relative to the Backend root directory
PU_SQLALCHEMY_DATABASE_URL-Connection URL for PostgreSQL
PU_CLICKHOUSE_DATABASE_URL-Connection URL for ClickHouse
PU_SECRET_KEY-32‑byte key in base64 format. Used to sign auth tokens. If changed, all previously issued jwt tokens become invalid
PU_ENCRYPT_KEY-32‑byte key in base64 format. Used to encrypt all data. If changed, all previously encrypted records become impossible to decrypt
PU_STATIC_SALT-32‑byte key in base64 format. Used to generate password hash values for Users. If changed, all accounts created before the change will no longer be able to authenticate
PU_MIN_INTERVAL_SYNC_REPOSITORY10Minimum time in seconds before the next repository update request to an external source
PU_STATE_SEND_INTERVAL60Interval in seconds at which Units should send their state. Propagated to Unit ENV as STATE_SEND_INTERVAL
PU_MAX_EXTERNAL_REPO_SIZE50Limit in MB for the size of external Git repositories that can be downloaded
PU_MAX_CIPHER_LENGTH1000000Maximum length in characters for encrypted data
PU_MIN_TOPIC_UPDATE_TIME30Update interval for messages in domain.com/+/pepeunit MQTT topics, in seconds
PU_UNIT_LOG_EXPIRATION86400Lifetime in seconds of logs sent by Unit
PU_MAX_PAGINATION_SIZE500Maximum number of objects that can be returned in a single request where pagination is used
PU_TELEGRAM_BOT_MODEwebhookAccepts webhook or pooling. Defines how the Backend communicates with the Telegram Bot. pooling works without a personal domain and https in environments with internet access. webhook is more performant and intended for https and a personal domain; the webhook URL is set automatically on startup
PU_TELEGRAM_DEL_OLD_WEBHOOKTrueWhether to delete the existing webhook for the Telegram Bot before creating a new one
PU_TELEGRAM_TOKEN-Telegram Bot token. Secret – do not share it
PU_TELEGRAM_BOT_LINK-Link to the Telegram Bot managed by the Backend. Used to generate verification links for Users. Exposed in openapi.json
PU_TELEGRAM_ITEMS_PER_PAGE7Number of items per page in the Telegram Bot UI
PU_TELEGRAM_HEADER_ENTITY_LENGTH15Maximum length of entity names shown in the Telegram Bot
PU_TELEGRAM_GIT_HASH_LENGTH8Maximum length of Git Commit hash shown in the Telegram Bot
PU_PROMETHEUS_MULTIPROC_DIR./prometheus_metricsDirectory used by Prometheus to store metrics from multiple uvicorn workers. Cleared on application startup
PU_REDIS_URLredis://redis:6379/0Redis connection URL used by the Backend. The Redis instance must be the same as for MQTT_REDIS_AUTH_URL
PU_MQTT_HOST-Domain name or IP used by the Backend to manage and subscribe to EMQX topics, and by Unit to connect to EMQX. Propagated to Unit ENV as PU_MQTT_HOST
PU_MQTT_SECURETrueIf True, the Backend uses https to configure EMQX
PU_MQTT_PORT1883Port used by Unit and Backend to connect to EMQX. Propagated to Unit ENV as PU_MQTT_PORT
PU_MQTT_API_PORT18083EMQX API port used by the Backend to configure EMQX
PU_MQTT_KEEPALIVE60Maximum period in seconds between ping messages from the Backend to EMQX
PU_MQTT_USERNAME-EMQX username used by the Backend for initial broker setup
PU_MQTT_PASSWORD-EMQX password used by the Backend for initial broker setup
PU_MQTT_REDIS_AUTH_URLredis://redis:6379/0Redis connection URL used by EMQX to connect to Redis. The Redis instance must be the same as REDIS_URL
PU_MQTT_MAX_CLIENTS10000Maximum number of EMQX clients
PU_MQTT_MAX_CLIENT_CONNECTION_RATE20/sMaximum connection rate for EMQX clients
PU_MQTT_MAX_CLIENT_ID_LEN512Maximum client ID length in EMQX
PU_MQTT_CLIENT_MAX_MESSAGES_RATE30/sMaximum message rate for a single EMQX client
PU_MQTT_CLIENT_MAX_BYTES_RATE1MB/sMaximum connection throughput for an EMQX client
PU_MQTT_MAX_PAYLOAD_SIZE256Maximum payload size in KB for data sent through EMQX topics
PU_MQTT_MAX_QOS2Maximum Quality of Service supported by EMQX
PU_MQTT_MAX_TOPIC_LEVELS5Maximum topic depth in EMQX
PU_MQTT_MAX_LEN_MESSAGE_QUEUE128Maximum queue length for EMQX messages
PU_MQTT_MAX_TOPIC_ALIAS128Maximum number of topic aliases in EMQX
PU_GITHUB_TOKEN_NAME-Name of a GitHub token with read‑only access to public repositories. Increases the rate limit for downloading public repositories from GitHub from 60 to 5000 per hour
PU_GITHUB_TOKEN_PAT-GitHub token with read‑only access to public repositories; also increases the public repo download rate limit
PU_GRAFANA_ADMIN_USER-Admin login for Grafana
PU_GRAFANA_ADMIN_PASSWORD-Admin password for Grafana
PU_GRAFANA_LIMIT_UNIT_NODE_PER_ONE_PANEL10Maximum number of UnitNode per single Visualization