a2468a2a2c
- Fix SSE streams not terminating on successful jobs (C-2) - Anchor data/session paths to BASE_DIR instead of CWD (C-3) - Guard TelegramAuthManager state with RLock (H-1) - Replace millisecond job ids with uuid4 (H-2) - Always redact api_id/api_hash on export, drop include_secrets (H-3) - Enforce JSON content-type + same-origin on mutating requests (H-4) - Rate-limit auth attempts and phone-code requests (H-5) - Deep-copy StateStore.load() on all paths (H-6) - Cap FloodWait retries in forward_message (H-7) - De-duplicate forwarding handler registration (H-8) - Validate continuous channels at ingest, join scrape thread on account removal, fix refresh_config status under lock, cap SSE streams and JSON body size (M-5, M-6, M-17) - Add regression tests (33 passing) and REVIEW.md
35 lines
827 B
Python
35 lines
827 B
Python
import logging
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from webui_server import run_server
|
|
|
|
|
|
def main():
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
|
|
datefmt="%Y-%m-%d %H:%M:%S",
|
|
stream=sys.stdout,
|
|
)
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
# Run legacy migration before starting the server
|
|
from app_state import migrate_legacy_state
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent
|
|
data_dir = BASE_DIR / "data"
|
|
session_dir = BASE_DIR / "session"
|
|
try:
|
|
if migrate_legacy_state(data_dir, session_dir):
|
|
logger.info("Legacy migration completed successfully.")
|
|
except Exception as exc:
|
|
logger.error("Migration failed: %s", exc)
|
|
|
|
run_server()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|