Adds osrm-foot, osrm-bicycle, and otp services to Docker Compose under a 'routing' profile (opt-in). Setup scripts download Greater London OSM data and pre-process for OSRM foot/bicycle profiles, plus TfL GTFS for OTP transit. Routing engine env vars added to .env.sample.
72 lines
4.3 KiB
Text
72 lines
4.3 KiB
Text
# Copy me to .env and source me
|
|
|
|
export ROUTING_API_KEY="<CHANGE ME>" # fetch from https://console.cloud.google.com/google/maps-apis/; prices - https://developers.google.com/maps/billing-and-pricing/pricing
|
|
|
|
# export DB_CONNECTION_STRING="mysql://wrongmove:wrongmove@localhost:3306/wrongmove" # example for mysql
|
|
export DB_CONNECTION_STRING="sqlite:///data/wrongmove.db" # by default use SQLite locally
|
|
export CELERY_BROKER_URL="redis://localhost:6379/0" # processing background tasks
|
|
export CELERY_RESULT_BACKEND="redis://localhost:6379/1"
|
|
|
|
# Rightmove scraper configuration
|
|
# These settings control query splitting to work around Rightmove's ~1500 result cap
|
|
RIGHTMOVE_MAX_CONCURRENT=5 # Max concurrent HTTP requests
|
|
RIGHTMOVE_REQUEST_DELAY_MS=100 # Delay between requests in milliseconds
|
|
RIGHTMOVE_SPLIT_THRESHOLD=1200 # Split query when results exceed this threshold
|
|
RIGHTMOVE_MIN_PRICE_BAND=100 # Minimum price band width (won't split below this)
|
|
RIGHTMOVE_MAX_PAGES=60 # Max pages per subquery (60 * 25 = 1500 max results)
|
|
RIGHTMOVE_PROXY_URL= # Optional SOCKS proxy URL (e.g., socks5://localhost:9050 for Tor)
|
|
|
|
# Throttling detection and circuit breaker
|
|
RIGHTMOVE_SLOW_RESPONSE_THRESHOLD=10.0 # Response time threshold in seconds
|
|
RIGHTMOVE_ENABLE_CIRCUIT_BREAKER=true # Enable circuit breaker protection
|
|
RIGHTMOVE_CIRCUIT_BREAKER_FAILURES=5 # Consecutive failures to open circuit
|
|
RIGHTMOVE_CIRCUIT_BREAKER_TIMEOUT=60.0 # Seconds to wait before recovery attempt
|
|
|
|
# Periodic scraping schedules (JSON array)
|
|
# Each schedule has: name, enabled, hour, minute, day_of_week, listing_type, min/max_bedrooms, min/max_price, district_names, furnish_types
|
|
# Cron fields: minute (0-59), hour (0-23), day_of_week (0-6, 0=Sunday)
|
|
# Example:
|
|
# SCRAPE_SCHEDULES='[{"name":"Daily RENT","listing_type":"RENT","hour":"2","min_bedrooms":2,"max_bedrooms":3,"min_price":2000,"max_price":4000}]'
|
|
# Multiple schedules:
|
|
# SCRAPE_SCHEDULES='[{"name":"RENT 2am","listing_type":"RENT","hour":"2"},{"name":"BUY 4am","listing_type":"BUY","hour":"4"}]'
|
|
SCRAPE_SCHEDULES=
|
|
|
|
# WebAuthn / Passkey configuration
|
|
WEBAUTHN_RP_ID=localhost # Relying Party ID (domain)
|
|
WEBAUTHN_RP_NAME=Wrongmove # Relying Party display name
|
|
WEBAUTHN_ORIGIN=https://localhost # Expected WebAuthn origin
|
|
|
|
# JWT configuration (for passkey-issued tokens)
|
|
JWT_SECRET=change-me-in-production # HMAC secret for HS256 signing
|
|
JWT_ALGORITHM=HS256 # JWT signing algorithm
|
|
JWT_EXPIRATION_HOURS=24 # Token expiry in hours
|
|
JWT_ISSUER=wrongmove # JWT issuer claim
|
|
|
|
# API rate limiting (format: max_requests/window_seconds)
|
|
# RATE_LIMIT_LISTING=30/60 # /api/listing: 30 req per 60s
|
|
# RATE_LIMIT_GEOJSON=10/60 # /api/listing_geojson: 10 req per 60s
|
|
# RATE_LIMIT_GEOJSON_STREAM=10/60 # /api/listing_geojson/stream: 10 req per 60s
|
|
# RATE_LIMIT_REFRESH=3/300 # /api/refresh_listings: 3 req per 5min
|
|
# RATE_LIMIT_TASK_STATUS=60/60 # /api/task_status: 60 req per 60s
|
|
# RATE_LIMIT_TASKS_FOR_USER=30/60 # /api/tasks_for_user: 30 req per 60s
|
|
# RATE_LIMIT_CANCEL_TASK=10/60 # /api/cancel_task: 10 req per 60s
|
|
# RATE_LIMIT_CLEAR_TASKS=5/60 # /api/clear_all_tasks: 5 req per 60s
|
|
# RATE_LIMIT_DISTRICTS=20/60 # /api/get_districts: 20 req per 60s
|
|
# RATE_LIMIT_PASSKEY=10/60 # /api/passkey/*: 10 req per 60s
|
|
RATE_LIMIT_REDIS_DB=3 # Redis DB for rate limit counters
|
|
|
|
# Bulk export caps
|
|
EXPORT_LISTING_LIMIT_CAP=100 # Max listings per /api/listing request
|
|
EXPORT_GEOJSON_LIMIT_CAP=5000 # Max features per /api/listing_geojson request
|
|
EXPORT_GEOJSON_STREAM_LIMIT_CAP=10000 # Max features per /api/listing_geojson/stream
|
|
EXPORT_GEOJSON_STREAM_BATCH_CAP=200 # Max batch size for streaming
|
|
|
|
# Metrics endpoint access control (comma-separated IPs/CIDRs)
|
|
METRICS_ALLOWED_IPS=127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,::1
|
|
|
|
# Self-hosted routing engines (POI distance calculator)
|
|
OSRM_FOOT_URL=http://osrm-foot:5000 # OSRM walking profile
|
|
OSRM_BICYCLE_URL=http://osrm-bicycle:5000 # OSRM cycling profile
|
|
OTP_URL=http://otp:8080 # OpenTripPlanner for transit
|
|
OSRM_BATCH_SIZE=50 # Origins per OSRM /table request
|
|
OTP_MAX_CONCURRENT=10 # Max concurrent OTP requests
|