Commit Graph

17 Commits

Author SHA1 Message Date
b0txec 6b9c7cf4ae Fix path traversal, auth-bypass, and DoS findings from the security review
- Add ValidateFileName (allowlist regex, rejects .. and separators) and apply
  it to every route that concatenates a raw path segment into a filesystem or
  remote FTP path: /show/lvgmc-forecast, /show/grib, /grib/binary-chunk, and
  /debug/file. Previously an unauthenticated caller could read arbitrary
  files, including /proc/self/environ (leaks LVGMC_PASSWORD/POSTGRES_PASSWORD).
- Harden ValidateInt to reject negative integers.
- Gate /api/fetch/lvgmc/stations behind ENABLE_LVGMC_FTP_JOBS so it can no
  longer trigger a real, unauthenticated FTP login regardless of the flag;
  stop leaking error.getMessage in its response.
- Add an explicit /api/* catch-all (NotFound) so an unmatched API route can
  never fall through to the SPA fallback and be served index.html as a 200.
- Cap binary-chunk read length at 64MB to prevent an unbounded allocation.
2026-08-24 11:50:53 +03:00
Guntis Smaukstelis d621c2c89a Faster downloading grib files 2025-07-11 11:12:06 +03:00
Guntis Smaukstelis b44364d9a6 Write fatal errors to logs, view logs, clear tmp folder 2025-03-16 15:38:11 +02:00
Guntis Smaukstelis e9408391ac Rest api for deleting old forecasts 2025-03-05 23:25:42 +02:00
Guntis Smaukstelis 2206e1018a Remove console logs 2025-02-26 13:32:07 +02:00
Guntis Smaukstelis 5e47a336e6 Process slideshow requests in batches, add more memory 2025-02-25 18:19:42 +02:00
Guntis Smaukstelis 3696172c72 Optimize getAllStructure with parTraverseN, chunk reading with RandomAccessFile 2025-02-24 23:56:21 +02:00
Guntis Smaukstelis b6cc4a4b24 Show which slide show hours is fetched 2025-02-23 20:21:11 +02:00
Guntis Smaukstelis 0b221bcfee Download structure for all files in one go. For better UX 2025-02-14 20:26:57 +02:00
Guntis Smaukstelis 8bd5be413d Cleanup now keeps only needed grib files 2025-02-14 14:59:07 +02:00
Guntis Smaukstelis 15cfbd1801 Refactor to one scheduler, separated csv/grib under one folder 2025-02-14 14:46:31 +02:00
Guntis Smaukstelis dc82b95a8a Fix paths in docker images 2025-02-13 23:21:19 +02:00
Guntis Smaukstelis 37ac7eb0e3 Fix deployment for fly.io 2025-02-13 16:11:50 +02:00
Guntis Smaukstelis c3f85fb477 Create just one scheduler instance 2025-02-13 13:15:46 +02:00
Guntis Smaukstelis 09449b5675 Delete old grib files more than 9hours old 2025-02-11 11:33:27 +02:00
Guntis Smaukstelis cf69372204 Download recent forecasts with checking local files 2025-02-10 23:43:58 +02:00
Guntis Smaukstelis 63d555bf5b Read forecast dates which are already downloaded 2025-02-08 23:34:50 +02:00