Skip to main content

Configuration

Pry is configured through environment variables. All PRY_* variables are auto-loaded. Copy .env.example to .env, adjust values, and restart.

cp .env.example .env

Per the security contract, no secrets live in .env in production.env is for local dev and CI only. Production secrets go in the secrets manager (gopass by default) — see Secrets backend.

Secrets backend

Pry resolves secrets via secrets_backend.get_secret(name). The default backend is gopass, reading under pry/<name>.

VariableDefaultMeaning
PRY_SECRET_BACKENDautogopass (default) — reads from the gopass store under pry/<name>; env — reads os.environ (PRY_<NAME> or PRY_<name>); file — reads from PRY_ENV_FILE (default $PRY_DATA_DIR/.env); auto — tries gopass, falls back to env
PRY_ENV_FILE$PRY_DATA_DIR/.env.env file path for the file backend
PRY_DATA_DIR~/.pryRoot directory for on-disk data (quality, monitors, sessions, vault, etc.). Override for production (e.g. /var/lib/pry) or tests (e.g. /tmp/pry-test)
PRY_WEBSHARE_GOPASS_PATHpry/webshare_proxy_listgopass path used as fallback for the Webshare proxy list

Seed initial secrets (one time):

gopass insert -m pry/jwt_secret # opens editor, paste a strong random value
gopass insert -m pry/api_key
gopass insert -m pry/x402_wallet # your receiving EVM/Solana address
gopass insert -m pry/x402_facilitator # https://x402.org/facilitator or your own

Core

VariableDefaultDescription
PRY_HOST127.0.0.1Bind address for the API server
PRY_PORT8002Bind port (container port — Docker publishes 80058002)
PRY_URLhttp://localhost:8002API endpoint used by the CLI
PRY_TIMEOUT60Default request timeout (seconds)

Authentication (fail-closed)

VariableDefaultDescription
PRY_API_KEY(unset)API key for endpoint authentication. Set → every request (loopback or remote) must send Authorization: Bearer <key> (or an rmi JWT); requests without a valid credential get 401. Unset → the API is only reachable from the loopback interface; every non-loopback request is rejected with 401, so a keyless instance is never exposed to the internet
# Generate a strong key
python -c "import secrets; print(secrets.token_urlsafe(48))"

Proxy/Tor configuration endpoints follow the same rule and are guarded explicitly in addition to the middleware: /v1/proxy/configure, POST /v1/config, and /v1/config/profile/tor reject remote clients that cannot present the key.

LLM / AI

VariableDefaultDescription
PRY_OLLAMA_URLhttp://100.100.18.18:11434Ollama endpoint (used for summarization, categorization, extraction)
PRY_OPENROUTER_API_KEYOpenRouter API key (optional — used for vision model queries with 5-model auto-fallback)

Web scraping

VariableDefaultDescription
PRY_FLARESOLVERR_URLhttp://flaresolverr:8191/v1FlareSolverr endpoint for Cloudflare bypass

Webhook

VariableDefaultDescription
PRY_WEBHOOK_SECRETSecret used to sign job-completion webhooks

Proxy / Tor

VariableDefaultDescription
PRY_PROXY_URLHTTP/SOCKS proxy URL (e.g. http://proxy:8080)
PRY_PROXY_TYPEhttpProxy type (http, socks5, …)
PRY_PROXY_USERNAMEProxy username
PRY_PROXY_PASSWORDProxy password
PRY_TOR_ENABLEDfalseEnable Tor routing
PRY_TOR_SOCKS5_HOSTtorTor SOCKS5 host
PRY_TOR_SOCKS5_PORT9050Tor SOCKS5 port

Webshare residential proxy pool

VariableDefaultDescription
WEBSHARE_PROXY_LISTSpace-separated Webshare residential proxies (http://user:pass@host:port). Loaded by webshare_proxy.py and exposed to the ProxyManager pool/rotation (provider tag webshare). If unset, falls back to the secrets manager (gopass) at PRY_WEBSHARE_GOPASS_PATH
WEBSHARE_PROXY_LIST="http://user:pass@proxy1.webshare.io:80 http://user:pass@proxy2.webshare.io:80"

Never commit real credentials here — this is a format example only.

Rotation / retry

VariableDefaultDescription
PRY_IP_ROTATIONIP rotation mode
PRY_MAX_RETRIES3Max retries per scrape
PRY_MIN_QUALITY50Minimum content-quality score to accept a scrape
PRY_RATE_LIMIT_RPM120Requests per minute (token bucket, per IP)

Redis

VariableDefaultDescription
PRY_REDIS_URLredis://localhost:6379/0Redis URL (cache backend with TTL-based invalidation)

Database

VariableDefaultDescription
PRY_DATABASE_URLpostgresql+asyncpg://pry:pry@localhost/pryAsync SQLAlchemy database URL

Stealth / anti-detection

VariableDefaultDescription
PRY_STEALTH_ENABLEDtrueEnable the stealth engine
PRY_RANDOM_USER_AGENTtrueRotate user agents
PRY_WEBDRIVER_OVERRIDEtrueHide the navigator.webdriver flag
PRY_CANVAS_NOISEtrueInject canvas fingerprint noise
PRY_WEBRTC_DISABLEtrueDisable WebRTC IP leaks
PRY_GEOLOCATION_SPOOFtrueSpoof geolocation
PRY_MIN_DELAY_MS500Minimum human-like delay between actions
PRY_MAX_DELAY_MS3000Maximum human-like delay between actions

Output

VariableDefaultDescription
PRY_DEFAULT_FORMATmarkdownDefault scrape output format
PRY_MAX_CHARS100000Maximum characters returned per scrape
PRY_INCLUDE_LINKStrueInclude extracted links in output

x402 / MCP

VariableDefaultDescription
PRY_X402_ENABLEDfalseEnable x402 pay-per-call gating
PRY_X402_PAY_TOReceiving wallet for x402 payments
PRY_X402_WALLETpry-default-walletWallet override (gopass pry/x402_wallet is preferred — persistent across restarts)
PRY_X402_FACILITATORhttps://x402.org/facilitatorx402 facilitator router (or your own)
PRY_X402_ASSETUSDCDefault payment asset
PRY_X402_PAYMENT_TTL3600Seconds a verified payment_id stays valid for replay
PRY_X402_TIMEOUT15Facilitator timeout (seconds)
PRY_MCP_ENABLEDtrueEnable the MCP server
warning

PRY_X402_OFFLINE=true is a dev-only bypass that makes every verify/settle succeed without a facilitator. It requires DEBUG=true (or PRY_DEBUG=true) and must never be active in production.

Data layout

On bare metal, all data is stored under ~/.pry/ (or PRY_DATA_DIR):

DirectoryPurpose
~/.pry/quality/Quality check history
~/.pry/reviews/Human review queue
~/.pry/intel/Competitive intelligence snapshots
~/.pry/costing/Usage tracking
~/.pry/freshness/Content fingerprints
~/.pry/structure/Page structure monitor history
~/.pry/seo/SEO snapshot history
~/.pry/monitors/Scheduled monitors
~/.pry/vault/Encrypted credentials
~/.pry/accounts/Registered account pool
~/.pry/reports/Generated client reports
~/.pry/training/AI training datasets
~/.pry/pipelines/Saved pipeline definitions
~/.pry/gdpr/Consent records, deletion requests
~/.pry/agency/Agency/client management

Next steps