Skip to main content
SunnyDays
Ops

Weather-gate configuration

Live read of the three constants that decide what appears on the homepage. This page is read-only. Changes require direct DB access and are audited in settings_audit_log.

Active thresholds

Setting key Value Allowed range Meaning
weather.min_temp_f 70.0°F 32.0–110.0 Daily high must be strictly above this to pass
weather.max_rain_pct 20.0% 0.0–100.0 Precip probability must be strictly below this to pass
weather.window_size 3 days 1–14 Consecutive qualifying days required for a destination to appear

Under these thresholds, 39 destination(s) currently qualify (from data/cache.json at render time). Use the preview API to try different values.

Preview API

Before changing any threshold, call the preview endpoint to see the qualifying count:

GET /api/gate-config/preview?min_temp_f=72&max_rain_pct=15&window_size=2

Returns the count and list of qualifying destinations under those proposed values, plus the delta against the current thresholds, and a warning if the result would be 0 or all.

How to change a threshold

  1. Call /api/gate-config/preview with the proposed values and confirm the qualifying count looks right.
  2. Open a DB session (e.g. psql $DATABASE_URL).
  3. Run:
    UPDATE settings SET value = '72', updated_at = now() WHERE key = 'weather.min_temp_f';
    INSERT INTO settings_audit_log (settings_key, old_value, new_value, changed_by)
      VALUES ('weather.min_temp_f', '70', '72', 'your-name');
  4. Reload the app process (systemctl restart sunnydays-travel) so the process cache is cleared.
  5. Verify on /api/gate-config that the new value is live.

Scoring weights (temp 40% / sky 30% / dry 30%) are a separate concern and are NOT managed here. They live in the score.w_* settings keys.

Audit log

No changes recorded yet in settings_audit_log.