# Ping River Monitor configuration: copy to .env and fill in. # # Read by ping-collector (the service; rust/collector/src/config.rs) and by the # Python training tools (src/config.py). Under systemd the variables come from # EnvironmentFile= (systemd's parser); for manual runs both programs load # ./.env with python-dotenv's rules. Unset keys take the defaults shown. # --- Database (PostgreSQL only) --------------------------------------------- # Either a full connection string (URL-encode special characters in the # password: : %3A @ %40 # %23 ? %3F & %26 / %2F % %25) ... POSTGRES_CONNECTION_STRING= # ... or the parts (the password is encoded for you) POSTGRES_HOST=localhost POSTGRES_PORT=5432 POSTGRES_DB=water_monitoring POSTGRES_USER=postgres POSTGRES_PASSWORD= # --- What the service runs --------------------------------------------------- # Website and API: the address to listen on (empty = no website) WEB_LISTEN=0.0.0.0:8000 # Forecast + ntfy/Matrix notifications after each collection (false = collect only) FORECAST_IN_COLLECTOR=true # Trained models (models/flood_.json.gz from src/ml/export.py) # MODELS_DIR=models # --- Collection ---------------------------------------------------------------- # RID is polled this many minutes past each hour and retried every # RID_RETRY_MINUTES while the current hour is not published yet RID_POLL_OFFSET_MINUTES=5 RID_RETRY_MINUTES=10 # RID reports with holes re-fetched at startup (0 = off); older: `ping-collector fill-gaps all` GAP_FILL_DAYS_ON_START=14 # ENABLE_HII_COLLECTION=true # ENABLE_RESERVOIR_COLLECTION=true # ENABLE_RAIN_COLLECTION=true # HII_BASIN_CODE=6 # REQUEST_TIMEOUT=30 # Runtime station list written by the admin API; falls back to src/data/stations.json # STATION_CONFIG_PATH=stations.json LOG_LEVEL=INFO # --- Notifications (docs/NOTIFICATIONS.md) ------------------------------------ # Public push alerts via self-hosted ntfy; empty NTFY_SERVER = off. Topics: # --warning|danger, -warning|danger, # -p1-outlook, -status. NTFY_SERVER= # Where the service POSTs (default NTFY_SERVER): the local ntfy address, so # publishing does not depend on DNS or the reverse proxy NTFY_PUBLISH_URL= NTFY_TOPIC_PREFIX=ping NTFY_TOKEN= PUBLIC_URL=https://water.buildfor.life/ # Report RID lagging this many hours while ThaiWater telemetry is current (0 = never) RID_STALE_ALERT_HOURS=18 # Matrix room for a team: the same transitions (docs/MATRIX_QUICK_START.md); # off while token or room is empty MATRIX_HOMESERVER=https://matrix.org MATRIX_ACCESS_TOKEN= MATRIX_ROOM_ID= # --- Website and API ------------------------------------------------------------- # X-API-Key for station editing, /config and POST /scrape/trigger (empty = those are off) ADMIN_API_KEY= # Comma-separated origins allowed cross-site with credentials (empty: any origin, no credentials) CORS_ALLOW_ORIGINS= # ThaiWater API key for /sensors/thaiwater (extra Ping-basin sensors on the map) THAIWATER_API_KEY= # Self-hosted Umami: server-side tracking of API calls # UMAMI_API_URL=https://stats.buildfor.life/api/send # UMAMI_WEBSITE_ID=00b2be73-8f5f-4400-9029-3be852eb08f7 # UMAMI_TRACK_API=true # Response cache TTLs (seconds) # LATEST_CACHE_TTL_SECONDS=45 # HII_CACHE_TTL_SECONDS=120 # HEALTH_CACHE_TTL_SECONDS=30 # A stored forecast older than this is served marked X-Data-Stale: true # FORECAST_MAX_AGE_SECONDS=7200 # STATIC_DIR=src/static # Only for `ping-collector serve` running separately from `run`: the status file # SCRAPING_STATUS_FILE=collector-status.json # --- Python tools ---------------------------------------------------------------- # Training/evaluation read the database above; this overrides it for them only # FLOOD_ML_DB_URL=