pryscraper/.env.example
cryptorugmunch c2c33c4d9f refactor(paths): centralize ~/.pry/ into PRY_DATA_DIR env var
The data root was hardcoded as Path(os.path.expanduser("~/.pry")) in
25+ modules, making it impossible to point Pry at a different data
directory (production systemd, Docker volumes, CI scratch, tests).

Changes:
- New module paths.py: single source of truth
    PRY_DATA_DIR: Path  # read once at import, overridable via env var
    subdir(name) -> Path  # mkdir+return helper
    ensure_data_dir() -> Path  # eager init
- 25 modules: replace
      X_DIR = Path(os.path.expanduser("~/.pry/x"))
    with
      X_DIR = PRY_DATA_DIR / "x"
  (plus the import; total 53 changes across 26 files)
- .env.example: document PRY_DATA_DIR with examples
- Verified:
    - 407 tests collect (was 5 collection errors before fix)
    - 83 sampled tests pass
    - 0 remaining hardcoded ~/.pry references in py files
2026-07-02 20:19:46 +02:00

55 lines
1.6 KiB
Text

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Rug Munch Media LLC
# Part of Pry - https://git.rugmunch.io/RugMunchMedia/pryscraper
# Licensed under MIT. See LICENSE.
# ── Pry Configuration ──
# Copy this to .env and adjust values.
# All PRY_* vars are auto-loaded by PrySettings.
# ── Core ──
PRY_HOST=0.0.0.0
PRY_PORT=8002
PRY_URL=http://localhost:8002
# Root directory for Pry's on-disk data (quality, monitors, sessions, etc.).
# Defaults to ~/.pry. Override for production (e.g., /var/lib/pry) or tests (e.g., /tmp/pry-test).
# PRY_DATA_DIR=~/.pry
# ── LLM / AI ──
# Ollama endpoint (used for summarization, categorization, extraction)
PRY_OLLAMA_URL=http://100.100.18.18:11434
# OpenRouter API key (optional — used for vision model queries)
# PRY_OPENROUTER_API_KEY=sk-or-v1-...
# ── Web Scraping ──
# FlareSolverr endpoint for Cloudflare bypass
PRY_FLARESOLVERR_URL=http://flaresolverr:8191/v1
# ── Webhook ──
# Secret used to sign job completion webhooks
# PRY_WEBHOOK_SECRET=pry-webhook-secret
# ── Authentication ──
# API key for endpoint authentication (empty = auth disabled)
# Set a strong random key to protect your Pry instance
# PRY_API_KEY=
# ── Proxy / Tor ──
# PRY_PROXY_URL=http://proxy:8080
# PRY_PROXY_TYPE=http
# PRY_PROXY_USERNAME=user
# PRY_PROXY_PASSWORD=pass
# PRY_TOR_ENABLED=false
# PRY_TOR_SOCKS5_HOST=tor
# PRY_TOR_SOCKS5_PORT=9050
# ── Rotation / Retry ──
# PRY_IP_ROTATION=
# PRY_MAX_RETRIES=3
# PRY_MIN_QUALITY=50
# PRY_RATE_LIMIT_RPM=120
# ── Redis ──
# PRY_REDIS_URL=redis://localhost:6379/0