mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-21 00:06:44 +01:00
* Support for dynamic MQTT user configuration #4883 * Fix substitute condition & docs
This commit is contained in:
parent
57dce4ec38
commit
bcbf0061ff
@ -52,6 +52,8 @@ mqtt:
|
|||||||
# NOTE: must be unique if you are running multiple instances
|
# NOTE: must be unique if you are running multiple instances
|
||||||
client_id: frigate
|
client_id: frigate
|
||||||
# Optional: user
|
# Optional: user
|
||||||
|
# NOTE: MQTT user can be specified with an environment variables that must begin with 'FRIGATE_'.
|
||||||
|
# e.g. user: '{FRIGATE_MQTT_USER}'
|
||||||
user: mqtt_user
|
user: mqtt_user
|
||||||
# Optional: password
|
# Optional: password
|
||||||
# NOTE: MQTT password can be specified with an environment variables that must begin with 'FRIGATE_'.
|
# NOTE: MQTT password can be specified with an environment variables that must begin with 'FRIGATE_'.
|
||||||
|
@ -863,8 +863,9 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
"""Merge camera config with globals."""
|
"""Merge camera config with globals."""
|
||||||
config = self.copy(deep=True)
|
config = self.copy(deep=True)
|
||||||
|
|
||||||
# MQTT password substitution
|
# MQTT user/password substitutions
|
||||||
if config.mqtt.password:
|
if config.mqtt.user or config.mqtt.password:
|
||||||
|
config.mqtt.user = config.mqtt.user.format(**FRIGATE_ENV_VARS)
|
||||||
config.mqtt.password = config.mqtt.password.format(**FRIGATE_ENV_VARS)
|
config.mqtt.password = config.mqtt.password.format(**FRIGATE_ENV_VARS)
|
||||||
|
|
||||||
# Global config to propagate down to camera level
|
# Global config to propagate down to camera level
|
||||||
|
Loading…
Reference in New Issue
Block a user