mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
allow mqtt password to be set by env var
This commit is contained in:
parent
1734c0569a
commit
e7c536ea31
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import cv2
|
import cv2
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
@ -16,6 +17,8 @@ from frigate.object_processing import TrackedObjectProcessor
|
|||||||
from frigate.util import EventsPerSecond
|
from frigate.util import EventsPerSecond
|
||||||
from frigate.edgetpu import EdgeTPUProcess
|
from frigate.edgetpu import EdgeTPUProcess
|
||||||
|
|
||||||
|
FRIGATE_VARS = {k: v for k, v in os.environ.items() if k.startswith('FRIGATE_')}
|
||||||
|
|
||||||
with open('/config/config.yml') as f:
|
with open('/config/config.yml') as f:
|
||||||
CONFIG = yaml.safe_load(f)
|
CONFIG = yaml.safe_load(f)
|
||||||
|
|
||||||
@ -24,6 +27,8 @@ MQTT_PORT = CONFIG.get('mqtt', {}).get('port', 1883)
|
|||||||
MQTT_TOPIC_PREFIX = CONFIG.get('mqtt', {}).get('topic_prefix', 'frigate')
|
MQTT_TOPIC_PREFIX = CONFIG.get('mqtt', {}).get('topic_prefix', 'frigate')
|
||||||
MQTT_USER = CONFIG.get('mqtt', {}).get('user')
|
MQTT_USER = CONFIG.get('mqtt', {}).get('user')
|
||||||
MQTT_PASS = CONFIG.get('mqtt', {}).get('password')
|
MQTT_PASS = CONFIG.get('mqtt', {}).get('password')
|
||||||
|
if not MQTT_PASS is None:
|
||||||
|
MQTT_PASS = MQTT_PASS.format(**FRIGATE_VARS)
|
||||||
MQTT_CLIENT_ID = CONFIG.get('mqtt', {}).get('client_id', 'frigate')
|
MQTT_CLIENT_ID = CONFIG.get('mqtt', {}).get('client_id', 'frigate')
|
||||||
|
|
||||||
# Set the default FFmpeg config
|
# Set the default FFmpeg config
|
||||||
|
Loading…
Reference in New Issue
Block a user