feat(asr-pipeline): merge PR #1 webauth/CSRF/locking hardening and web_password fallback
Build image / build (push) Canceled after 0s
Build ASR Pipeline / image (push) Canceled after 0s

This commit is contained in:
Codex
2026-11-02 06:37:33 -08:00
parent 9debd1c47d
commit 3c70861463
44 changed files with 4354 additions and 333 deletions
@@ -0,0 +1,25 @@
"""One machine-wide lock for processes that consume the recording inbox."""
from __future__ import annotations
import fcntl
import os
from pathlib import Path
def acquire_recording_lock(path: Path):
"""Return an open file holding an exclusive lock, or exit if another consumer has it.
The handle must stay referenced for the life of the process.
"""
path.parent.mkdir(parents=True, exist_ok=True)
handle = path.open("a+")
try:
fcntl.flock(handle, fcntl.LOCK_EX | fcntl.LOCK_NB)
except OSError:
handle.close()
raise SystemExit(f"another recording consumer holds {path}")
handle.seek(0)
handle.truncate()
handle.write(str(os.getpid()))
handle.flush()
return handle