mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Set the extra attribute in FrigateBaseModel.Config based on the value of the FRIGATE_EXTRA environment variable, allowing, ignoring or forbidding extra fields
This commit is contained in:
parent
a29c4dccfb
commit
684a634345
@ -45,11 +45,13 @@ DEFAULT_DETECTORS = {"cpu": {"type": "cpu"}}
|
||||
|
||||
class FrigateBaseModel(BaseModel):
|
||||
class Config:
|
||||
extra = (
|
||||
Extra.allow
|
||||
if os.environ.get("FRIGATE_ALLOW_EXTRA") is not None
|
||||
else Extra.forbid
|
||||
)
|
||||
frigate_env_extra_var = os.environ.get("FRIGATE_ALLOW_EXTRA", "forbid")
|
||||
if frigate_env_extra_var.lower() == "allow":
|
||||
extra = Extra.allow
|
||||
elif frigate_env_extra_var.lower() == "ignore":
|
||||
extra = Extra.ignore
|
||||
else:
|
||||
extra = Extra.forbid
|
||||
|
||||
|
||||
class LiveModeEnum(str, Enum):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user