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.

VariableDefaultValuesPurpose
PU_FF_TELEGRAM_BOT_ENABLETrueTrue / FalseFeature flag that controls whether the Telegram Bot is enabled
PU_FF_GRAFANA_INTEGRATION_ENABLETrueTrue / FalseFeature flag that controls whether integration with Grafana is enabled
PU_FF_DATAPIPE_ENABLETrueTrue / FalseFeature 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_DATAPIPE_DEFAULT_LAST_VALUE_ENABLETrueTrue / FalseFeature flag that controls whether DataPipe of type LastValue is created by default for each UnitNode
PU_FF_PROMETHEUS_ENABLETrueTrue / FalseFeature flag that controls whether monitoring of requests via Prometheus is enabled
PU_FF_FEDERATION_ENABLETrueTrue / FalseFeature flag that controls whether interaction with other Pepeunit instances is enabled: polling their state and exchanging known domains and public registries. When the flag is off, background jobs that collect data about external instances do not start
PU_LOG_FORMATjsonjson / plainLog 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_LEVELINFODEBUG / INFO / WARNING / ERROR / CRITICALMinimum log level output to the console. Logs below this level are not shown. Allowed values: DEBUG, INFO, WARNING, ERROR, CRITICAL
PU_APP_PREFIX/pepeunit/..., ≤ 128 charsStandard prefix used to separate app paths from the domain; usually does not need changes. Useful for complex embedded setups
PU_API_V1_PREFIX/api/v1/..., ≤ 128 charsPrefix for REST API version. Allows supporting old REST API versions and multiple versions simultaneously
PU_WORKER_COUNT22128Number of Gunicorn workers; increases the load that the Backend can handle
PU_DOMAIN-hostname, ≤ 128 charsDomain 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_SECURETrueTrue / FalseIf True, the Backend generates https links for PU_DOMAIN. Propagated to Unit ENV field PU_HTTP_TYPE as https/http
PU_AUTH_TOKEN_EXPIRATION267840060011059200Lifetime of User auth tokens, in seconds
PU_SAVE_REPO_PATHrepo_cache≤ 128 charsPath where the Backend stores external Git repositories, relative to the Backend root directory
PU_PROMETHEUS_MULTIPROC_DIR./prometheus_metrics≤ 128 charsDirectory used by Prometheus to store metrics from multiple uvicorn workers. Cleared on application startup
PU_MIN_INTERVAL_SYNC_REPOSITORY1011800Minimum time in seconds before the next repository update request to an external source
PU_STATE_SEND_INTERVAL601600Interval in seconds at which Units should send their state. Propagated to Unit ENV as STATE_SEND_INTERVAL
PU_MAX_EXTERNAL_REPO_SIZE5001024Limit in MB for the size of external Git repositories that can be downloaded
PU_MAX_CIPHER_LENGTH100000001000000 charsMaximum length in characters for encrypted data
PU_HTTP_TIMEOUT300120Timeout in seconds for outgoing HTTP requests from the Backend: to EMQX, Grafana, external Git repositories, and other Pepeunit instances
PU_HTTP_CONNECT_TIMEOUT15060Timeout in seconds for establishing a connection for outgoing HTTP requests, and for connections to Redis and ClickHouse
PU_INSTANCE_MAX_STATE_SIZE4096409665536 bytesMaximum size of an external Pepeunit instance response in bytes. Larger responses are rejected when collecting state
PU_INSTANCE_RETENTION_DAYS601120Number of days without a successful poll after which a trusted external Pepeunit instance is deleted. A mandatory extra poll is performed before deletion
PU_ADMIN_EMAIL-email or empty, ≤ 128 charsPublic email of the instance Administrator. Shown in the current instance contacts; can be empty
PU_ADMIN_TG-≤ 128 charsPublic Telegram contact of the instance Administrator. Shown in the current instance contacts; can be empty
PU_UNIT_LOG_EXPIRATION8640060604800Lifetime in seconds of logs sent by Unit
PU_MAX_PAGINATION_SIZE1001500Maximum number of objects that can be returned in a single request where pagination is used
PU_SECRET_KEY-16128 chars32-byte key in base64 format. Used to sign auth tokens. If changed, all previously issued jwt tokens become invalid
PU_ENCRYPT_KEY-base64 → 16 / 24 / 32 bytes, ≤ 128 chars32-byte key in base64 format. Used to encrypt all data. If changed, all previously encrypted records become impossible to decrypt
PU_STATIC_SALT-not empty, ≤ 128 chars32-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_SQLALCHEMY_DATABASE_URL-postgresql / postgresql+psycopg2 / postgresql+asyncpg, ≤ 1024 charsConnection URL for PostgreSQL
PU_CLICKHOUSE_DATABASE_URL-URL with hostname, ≤ 1024 charsConnection URL for ClickHouse
PU_REDIS_URLredis://redis:6379/0redis / rediss, ≤ 1024 charsRedis connection URL used by the Backend. The Redis instance must be the same as for PU_MQTT_REDIS_AUTH_URL
PU_TELEGRAM_BOT_MODEwebhookwebhook / poolingAccepts 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_WEBHOOKTrueTrue / FalseWhether to delete the existing webhook for the Telegram Bot before creating a new one
PU_TELEGRAM_TOKEN-123456:ABC-def, ≤ 128 charsTelegram Bot token. Secret – do not share it
PU_TELEGRAM_BOT_LINK-http / https, ≤ 512 charsLink to the Telegram Bot managed by the Backend. Used to generate verification links for Users. Exposed in openapi.json
PU_TELEGRAM_ITEMS_PER_PAGE7120Number of items per page in the Telegram Bot UI
PU_TELEGRAM_HEADER_ENTITY_LENGTH15164 charsMaximum length of entity names shown in the Telegram Bot
PU_TELEGRAM_GIT_HASH_LENGTH8116 charsMaximum length of Git Commit hash shown in the Telegram Bot
PU_TELEGRAM_PROXY_URL-http / https / socks5 / socks5h or empty, ≤ 512 charsWhen specified, allows the bot to proxy requests through the given server, for example socks5://user:password@1.1.1.1:1080. In combination with pooling, it helps bypass Telegram blocks
PU_MQTT_HOST-hostname, ≤ 128 charsDomain 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_SECURETrueTrue / FalseIf True, the Backend uses https to configure EMQX
PU_MQTT_PORT1883165535Port used by Unit and Backend to connect to EMQX. Propagated to Unit ENV as PU_MQTT_PORT
PU_MQTT_API_PORT18083165535EMQX API port used by the Backend to configure EMQX
PU_MQTT_KEEPALIVE600600Maximum period in seconds between ping messages from the Backend to EMQX
PU_MQTT_USERNAME-not empty, ≤ 128 charsEMQX username used by the Backend for initial broker setup
PU_MQTT_PASSWORD-not empty, ≤ 128 charsEMQX password used by the Backend for initial broker setup
PU_MQTT_REDIS_AUTH_URLredis://redis:6379/0redis / rediss, ≤ 512 charsRedis connection URL used by EMQX to connect to Redis. The Redis instance must be the same as PU_REDIS_URL
PU_MQTT_MAX_CLIENTS102411024Maximum number of EMQX clients
PU_MQTT_MAX_CLIENT_CONNECTION_RATE20/s20 / 20/s / 20/m / 20/h, ≤ 64 charsMaximum connection rate for EMQX clients
PU_MQTT_MAX_CLIENT_ID_LEN51211024 charsMaximum client ID length in EMQX
PU_MQTT_CLIENT_MAX_MESSAGES_RATE30/s20 / 20/s / 20/m / 20/h, ≤ 64 charsMaximum message rate for a single EMQX client
PU_MQTT_CLIENT_MAX_BYTES_RATE1MB/s1MB/s, KB / MB / GB / B, ≤ 64 charsMaximum connection throughput for an EMQX client
PU_MQTT_MAX_PAYLOAD_SIZE25614096 KBMaximum payload size in kilobytes for data sent through EMQX topics
PU_MQTT_MAX_QOS202Maximum Quality of Service supported by EMQX
PU_MQTT_MAX_TOPIC_LEVELS5532Maximum topic depth in EMQX
PU_MQTT_MAX_LEN_MESSAGE_QUEUE12811024Maximum queue length for EMQX messages
PU_MQTT_MAX_TOPIC_ALIAS1280256Maximum number of topic aliases in EMQX
PU_GRAFANA_ADMIN_USER-not empty when FF is on, ≤ 128 charsAdmin login for Grafana
PU_GRAFANA_ADMIN_PASSWORD-not empty when FF is on, ≤ 128 charsAdmin password for Grafana
PU_GRAFANA_LIMIT_UNIT_NODE_PER_ONE_PANEL10132Maximum number of UnitNode per single Visualization
PU_GITHUB_TOKEN_NAME-together with PAT or both empty, ≤ 128 charsName 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-together with NAME or both empty, ≤ 128 charsGitHub token with read-only access to public repositories. Increases the rate limit for downloading public repositories from GitHub from 60 to 5000 per hour