This commit is contained in:
eric
2026-03-29 01:34:23 -05:00
parent 8bce529255
commit 784a4468b8
8 changed files with 308 additions and 218 deletions

View File

@@ -30,9 +30,9 @@ def _read_text(path: Path) -> str:
def _file_kind(path: Path) -> str:
name = path.name.lower()
if name == "url_config.ini":
if name == "url_config.ini" or (name.startswith("url_config.") and name.endswith(".ini")):
return "url_config"
if name == "youtube.ini":
if name == "youtube.ini" or (name.startswith("youtube.") and name.endswith(".ini")):
return "youtube_ini"
if name == "config.ini":
return "recorder_ini"

View File

@@ -4,6 +4,7 @@ import asyncio
import json
import os
import platform
import re
import shutil
import socket
import subprocess
@@ -24,6 +25,9 @@ HW_PROFILE_JSON = CONFIG_DIR / "hardware-profile.json"
STACK_ENV = CONFIG_DIR / "system-stack.env"
MAX_FILES_PER_ROOT = 256
_PRO_URL_CONFIG_INI = re.compile(r"^URL_config\.[a-zA-Z0-9_.-]+\.ini$")
_PRO_YOUTUBE_INI = re.compile(r"^youtube\.[a-zA-Z0-9_.-]+\.ini$")
@dataclass(frozen=True)
class ManagedRoot:
@@ -44,7 +48,13 @@ class ManagedRoot:
def allows(self, rel_path: Path) -> bool:
rel_posix = rel_path.as_posix()
if self.explicit_names:
return rel_posix in self.explicit_names
if rel_posix in self.explicit_names:
return True
if len(rel_path.parts) == 1:
n = rel_path.name
if _PRO_URL_CONFIG_INI.match(n) or _PRO_YOUTUBE_INI.match(n):
return True
return False
return rel_path.suffix.lower() in self.allowed_suffixes

View File

@@ -203,11 +203,14 @@ class LocalProcessRegistry:
err_log = open(self.log_dir / f"{name}-error.log", "a", encoding="utf-8", errors="ignore")
try:
child_env = os.environ.copy()
child_env["LIVE_PM2_PROCESS_NAME"] = name
kw: dict[str, Any] = {
"cwd": str(self.base_dir),
"stdout": out_log,
"stderr": err_log,
"preexec_fn": os.setsid,
"env": child_env,
}
proc = await asyncio.create_subprocess_exec(*cmd, **kw)
except Exception as e: