refactor(settings): unify config.py, mconfig.py, and settings.py into single PrySettings

- Merge all configuration into settings.py with PRY_* env var prefix.
- Add legacy env aliases (PROXY_URL, TOR_ENABLED, MAX_RETRIES, etc.) for migration.
- Load and persist runtime overrides from JSON config file (default /app/config.json).
- Update scraper.py, deps.py, routers/config.py to use unified settings.
- Add resolved_proxy_chain and resolved_proxy_url properties.
- Replace tests/test_mconfig.py with tests/test_settings.py (9 tests).
- Update .env.example with new PRY_* options.
- All 500 tests pass; ruff clean.
This commit is contained in:
Crypto Rug Munch 2026-07-03 05:04:29 +02:00
parent ecb05bbf49
commit 1f9e71d294
9 changed files with 424 additions and 316 deletions

View file

@ -69,3 +69,26 @@ PRY_FLARESOLVERR_URL=http://flaresolverr:8191/v1
# ── Redis ──
# PRY_REDIS_URL=redis://localhost:6379/0
# ── Database ──
# PRY_DATABASE_URL=postgresql+asyncpg://pry:pry@localhost/pry
# ── Stealth ──
# PRY_STEALTH_ENABLED=true
# PRY_RANDOM_USER_AGENT=true
# PRY_WEBDRIVER_OVERRIDE=true
# PRY_CANVAS_NOISE=true
# PRY_WEBRTC_DISABLE=true
# PRY_GEOLOCATION_SPOOF=true
# PRY_MIN_DELAY_MS=500
# PRY_MAX_DELAY_MS=3000
# ── Output ──
# PRY_DEFAULT_FORMAT=markdown
# PRY_MAX_CHARS=100000
# PRY_INCLUDE_LINKS=true
# ── x402 / MCP ──
# PRY_X402_ENABLED=false
# PRY_X402_PAY_TO=
# PRY_MCP_ENABLED=true