1. поправлено работа с таймерами в vMix
2. поправлено немного Заготовки
This commit is contained in:
@@ -18,6 +18,9 @@ from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
DEFAULT_SECURITY: dict[str, Any] = {
|
||||
# BUILD98: editor access is a fixed local PIN. The older daily PIN and
|
||||
# master PIN fields are retained only so existing config files still parse.
|
||||
"fixed_pin": "1993",
|
||||
"daily_mask": "4827",
|
||||
"master_pin": "638194",
|
||||
"timezone": "Europe/Moscow",
|
||||
@@ -43,11 +46,9 @@ class FailureState:
|
||||
class EditorAuthManager:
|
||||
"""Local PIN guard for the visual editor.
|
||||
|
||||
Daily PIN:
|
||||
digits(DDMM) + digits(mask), each result modulo 10.
|
||||
|
||||
Example:
|
||||
1607 + 4827 = 5424
|
||||
BUILD98 uses one fixed PIN (1993 by default). The old daily-PIN helpers are
|
||||
kept for backward-compatible diagnostics only and are no longer accepted
|
||||
by the login endpoint.
|
||||
"""
|
||||
|
||||
def __init__(self, settings_dir: Path) -> None:
|
||||
@@ -76,6 +77,7 @@ class EditorAuthManager:
|
||||
result.update(raw)
|
||||
|
||||
overrides = {
|
||||
"fixed_pin": os.getenv("EDITOR_FIXED_PIN"),
|
||||
"daily_mask": os.getenv("EDITOR_PIN_MASK"),
|
||||
"master_pin": os.getenv("EDITOR_MASTER_PIN"),
|
||||
"timezone": os.getenv("EDITOR_PIN_TIMEZONE"),
|
||||
@@ -93,6 +95,9 @@ class EditorAuthManager:
|
||||
"1", "true", "yes", "on"
|
||||
}
|
||||
|
||||
fixed = "".join(character for character in str(result.get("fixed_pin", "1993")) if character.isdigit())
|
||||
result["fixed_pin"] = fixed if 4 <= len(fixed) <= 12 else "1993"
|
||||
|
||||
mask = "".join(character for character in str(result["daily_mask"]) if character.isdigit())
|
||||
result["daily_mask"] = mask[:4].ljust(4, "0") if mask else "4827"
|
||||
|
||||
@@ -217,10 +222,7 @@ class EditorAuthManager:
|
||||
},
|
||||
)
|
||||
|
||||
valid = (
|
||||
hmac.compare_digest(supplied, self.daily_pin())
|
||||
or hmac.compare_digest(supplied, str(self.settings["master_pin"]))
|
||||
)
|
||||
valid = hmac.compare_digest(supplied, str(self.settings["fixed_pin"]))
|
||||
if not valid:
|
||||
failure.attempts += 1
|
||||
remaining = max(
|
||||
|
||||
Reference in New Issue
Block a user