Files
WeatherTool/docs/README.md
T
b0txec 1086c8b548 Revert VPS FTP after it crash-looped the app; document the diagnosis
The ltv account fails to authenticate from the VPS specifically
(works fine from Rocky with the same credentials, network path to
ftp.meteo.lv:21 confirmed fine from the VPS too) — narrowed to either
a password transcription error in .env.staging or LVGMC IP-allowlisting
the account, neither confirmable without inspecting the password.
Caught via the overnight watch this was set up for rather than
assumed safe; reverted ENABLE_LVGMC_FTP_JOBS to false on the VPS
immediately once the failure was confirmed real, restoring stable
operation. FTP stays enabled on Rocky, where it works.
2026-08-23 22:14:58 +03:00

8.7 KiB
Raw Blame History

WeatherTool project documentation

This directory contains the working documentation for the WeatherTool modernization effort. The repository-root README.md is preserved as the original project overview; these documents describe the reviewed code, current staging environment, and changes being developed.

Current status

  • Windows is restricted to source editing, review, and Git operations. Rocky is the sole compile, build, development-runtime, and test environment. The Ubuntu VPS is a deployment target only.
  • A production-like staging copy runs through Docker Compose on Rocky Linux at http://192.168.1.101:9190.
  • Rocky now ingests real data from two independent LVĢMC sources at once: the free data.gov.lv open-data feed and the private FTP feed (ftp.meteo.lv, real credentials obtained and verified 2026-08-23). The VPS currently runs open-data only — FTP was briefly enabled there too but reverted the same night after the ltv account failed to authenticate from the VPS specifically (see below). The two providers are gated independently (ENABLE_LVGMC_FTP_JOBS, ENABLE_HARMONIE_JOBS) since real credentials for FTP and DMI HARMONIE arrive on different timelines. HARMONIE's credentials turned out not to be needed at all (DMI dropped its API key requirement — confirmed live, see the roadmap changelog) but wiring it up is deferred to a dedicated verification session, since the GRIB-parsing and map-rendering code has real, untested risk (a hardcoded crop/rotation calibration that may not match the current model grid).
  • A real UTC-vs-local timezone mismatch between the two sources (open-data's timestamps were UTC, FTP's already local, both stored in the same column with no conversion) was found and fixed before enabling both together; both weather tables were backed up and wiped for a clean, consistently-timestamped restart.
  • The safe scheduled jobs (open-data station ingestion, GRIB cleanup) always run; the FTP job now runs too since real credentials exist; HARMONIE's job stays off pending its own implementation work.
  • PostgreSQL is private to the project Compose network; only the Scala application publishes a host port.
  • The operator-facing workspaces now use the Latvian workflow names Stacijas, Kartes, Faktiskā, Ūdens, Brīdinājumi, Apskats, Arhīvs, Harmonie, and LVĢMC. Kartes retains custom analytical map outputs, while Faktiskā is a fixed 13-position, latest-temperature newsroom workflow with a locked 3840×1440 export.
  • Faktiskā symbol placement is automatic after manual image selection and is anchored to each rendered temperature badge.
  • Ūdens auto-populates its six ranges on load with real per-zone water-temperature min/max (65 LVĢMC stations classified into the 6 named zones), with manual override and reset still available. Uses separate authoritative 1920×1080 and 3840×1440 production templates; both exports have been visually validated.
  • Brīdinājumi renders current LVĢMC warning polygons over a production border overlay with feathered severity fills, plus draggable/resizable per-warning weather-symbol placement. Its lon/lat-to-pixel projection is an affine fit calibrated against the same validated city pixel positions Kartes/Faktiskā already use, replacing an earlier bounding-box calibration that drifted up to ~200px on the 3840 canvas.
  • Confirmed local Monda Regular/Bold files provide interface and generated-graphic typography; weather symbols use normalized transparent image assets.
  • Release 3eddf95 is deployed as immutable image weathertool:3eddf95008b103f34d50dbc86c5634d3c0fa3523; release e446f1ff remains the immediate application rollback. On top of the earlier frontend design pass (visual palette rework, Faktiskā decluttering, header nav, weather-icon CSS consolidation), this release fixes the UTC-vs-local timezone mismatch described above, hardens the weather table upsert to be non-destructive across sources (COALESCE instead of a blind overwrite), and splits the scheduler flag so FTP and HARMONIE can be enabled independently. deploy/vps/compose.yml was also fixed to actually read LVGMC_* from .env.staging (it was hardcoding inert placeholders directly in the file before, so real credentials alone wouldn't have taken effect) — real credentials and ENABLE_LVGMC_FTP_JOBS=true are live on the VPS as of 2026-08-23.
  • The isolated VPS UAT stack is running and healthy: WeatherTool is bound to 127.0.0.1:8002, Authelia to 127.0.0.1:9091, and PostgreSQL has no host port. Public access is routed through Cloudflare, Nginx, and Authelia.
  • Cloudflare delegation is active, strict origin TLS covers only laikapstak.li and auth.laikapstak.li, and the public Nginx/Authelia login flow is operational without changing the existing HOP site.
  • The VPS weather table was wiped twice on 2026-08-23: first to remove the original 14-day synthetic dataset (backed up to /srv/weathertool/backups/pre-real-data-release/), then again after the UTC/local timezone fix (backed up to /srv/weathertool/backups/pre-timezone-fix-wipe/) so the two real sources it now holds — open-data (minutes 15/45) and FTP (minutes 11/13/23/30) — are consistently timestamped from a clean start.
  • Approved 1920×1080 and 3840×1440 PNG production bases are now the rendering source for Faktiskā and Ūdens temperatūra; code draws only the changing values, selected weather symbols, and wind data over those fixed newsroom graphics.
  • Browser branding assets and Latvian Open Graph/Twitter metadata are included for favicon, Apple home-screen icon, and link-preview support. Public crawler access still depends on the Nginx/Authelia policy used for the metadata and preview image.
  • Browser and API verification is complete for the deployed 3eddf95 release: exact release image smoke-tested on Rocky before transfer (bundle hash and correct-local-time API responses matched the known-good local build), checksum verified on both ends, container health/loopback/public HTTPS confirmed.
  • VPS FTP is currently disabled again (ENABLE_LVGMC_FTP_JOBS=false), despite being enabled earlier tonight. Watching for its first scheduled fetch (rather than assuming it was safe just because Rocky worked) caught a real problem: the ltv account fails to authenticate from the VPS specifically, and because a scheduled-task failure cascades through parMapN up to the app's top-level error handler, this was actively crash-looping the entire app in-process (not a Docker-level restart, but the whole app — DB, HTTP server, schedulers — tearing down and rebuilding every ~5s, repeating every ~2 minutes as the schedule re-fired). Reverted immediately; confirmed stable afterward. VPS network connectivity to ftp.meteo.lv:21 itself is fine (verified with a raw connection test); this is specifically the ltv account failing from the VPS's IP, not a firewall issue — see the roadmap changelog for the full diagnosis and next steps (check the password transcription, or ask LVGMC whether the account is IP-restricted). FTP stays enabled on Rocky, where it's confirmed working.
  • Frontend dependency maintenance is complete: Solid runtime and Vite tooling were updated, obsolete packages were removed, TypeScript checking was added, and a clean Rocky npm ci, typecheck, production build, full audit, and production-only audit all pass with zero known vulnerabilities.
  • This is not yet approved or hardened for workplace production.

Documents

  • Architecture and data flow — components, data sources, data flow, and repository layout.
  • Development and staging — Windows source/Git workflow, Rocky development and verification, VPS deployment, synthetic data, and rollback.
  • Product workflows — the intended purpose and current status of each visible workspace.
  • Update roadmap — phased technical, security, dependency, testing, and UI work.
  • Third-party notices — licenses and attribution for adapted interface components.
  • Temporary VPS staging plan — isolation, authentication, prepared deployment bundle, release, backup, verification, and rollback model for external user testing.

Documentation rules

  1. Do not put passwords, API keys, workplace URLs, or production data in Git.
  2. Document the behavior that exists separately from behavior that is proposed.
  3. Update these documents in the same commit when a change alters deployment, data flow, or a user workflow.
  4. Keep synthetic/development instructions clearly distinguished from workplace production procedures.
  5. Preserve established Latvian names in operator-facing workspaces and production files even when development notes are written in English.