Commit Graph
18 Commits
Author SHA1 Message Date
ik 722c88d436 sync
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s
2026-09-17 07:35:04 +07:00
ik 4c75db1f74 feat: parse RF4DB waterbody catalog
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s
2026-09-15 17:19:15 +07:00
ik 61c7ac7d51 feat: reconcile RF4DB media catalog
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s
2026-09-14 07:45:29 +07:00
ik 674bc5627f feat: expand RF4 media inventory 2026-09-13 08:06:48 +07:00
ik bda0a0ef5e feat: add rate-limited RF4 media collector 2026-09-12 15:52:27 +07:00
ik 57aa3ffafb A02/A03: Add state validation and normalize subdomain keys for shared cooldown 2026-09-10 20:34:05 +07:00
ik 97660833ab A02: Fix double cooldown reservation bug in main()
Bug: main() called both enforce_fetch_interval() and mark_fetch(), which
both now call check_and_reserve(). On cold start:
  1. enforce_fetch_interval() → check_and_reserve() → SUCCESS (reserves)
  2. mark_fetch() → check_and_reserve() → FAILS (cooldown now active)

This prevented HTTP from ever being called on cold start.

Fix:
- Removed duplicate calls to enforce_fetch_interval() and mark_fetch()
- Single check_and_reserve() call before fetch_html()
- enforce_fetch_interval() and mark_fetch() remain as legacy wrappers

Verification:
- All 18 community_cli tests pass
- Code analysis confirms single check_and_reserve() call in main()
- check_and_reserve() is atomic with exclusive lock for check+reserve
2026-09-10 17:55:30 +07:00
ik d0d208ebd7 A03: Manual redirect control with per-hop validation
Replace urlopen automatic redirect following with custom HTTPRedirectHandler
that raises on 3xx redirects. Each redirect hop is validated (scheme, host,
port) before the request is made using _validate_url_before_io().

Key changes:
- _StrictRedirectHandler intercepts 301/302/303/307/308 responses
- _extract_redirect_url() extracts Location header from redirect responses
- fetch_html() manually follows redirects with hop count limit (MAX_REDIRECT_HOPS=5)
- Relative redirect URLs resolved with urljoin() before validation
- All redirect targets validated against ALLOWED_HOSTS, ALLOWED_PORTS, HTTPS-only

Tests:
- test_fetch_html_redirect_to_disallowed_host_rejected (mocked redirect)
- test_fetch_html_redirect_chain_limit (exceeds MAX_REDIRECT_HOPS)
- test_extract_redirect_url_from_headers (Location/location headers)
- test_urljoin_resolves_relative_redirects (relative URL resolution)
2026-09-10 06:26:15 +07:00
ik 4ac50db1db A02: Atomic check-and-reserve with lockfile for cross-process coordination
- Single exclusive lock covers read-check-write in one critical section
- Lockfile pattern ensures cross-process mutual exclusion
- Atomic write via temp file + rename after unlock
- Flush + fsync before unlock to prevent data loss
- Real multi-process test: 3 concurrent processes get exactly 1 reservation
- 111 Python tests pass (+2 new tests)
2026-09-10 06:23:14 +07:00
ik 4974f362ac A03: Validate scheme/host/port before every network I/O
- _validate_url_before_io: check scheme (HTTPS only), port (80/443), host
- fetch_html: recursive redirect validation with hop limit (MAX_REDIRECT_HOPS=5)
- Reject non-HTTPS redirects and non-standard ports
- All validation happens BEFORE urlopen() call
- Updated tests for new validation messages
- 109 Python tests pass
2026-09-10 06:11:17 +07:00
ik 79245965ec A02: Atomic cooldown state with exclusive lock and flush
- _write_state: write to temp file, fsync, rename atomically
- Acquire exclusive lock before any file operations
- Flush and fsync before unlock to prevent data loss
- Remove stale .tmp file after successful write
- Add test for atomic write behavior
- 109 Python tests pass
2026-09-10 06:10:35 +07:00
ik 39f66481be R11: Validate URL host before network I/O — prevent SSRF
- Add _validate_url_host() to check allowlist before urlopen()
- Validate both original URL and redirect target
- Reject localhost, internal IPs, and non-allowlisted hosts
- Add 2 unit tests for disallowed host rejection
- Prevents SSRF attacks via malicious source URLs
2026-09-10 05:45:57 +07:00
ik ff0bc08222 fix: R03 research CLI cooldown — _read_state/_write_state helpers, handle missing file (#1788956171115) 2026-09-09 21:23:29 +07:00
ik 63e33e1861 fix: audit P0-P1 — T03-T07, D01-D08, U01-U02 (#1788956171115) 2026-09-09 20:02:52 +07:00
ik 486b4e9645 fix: enforce community cooldown per site 2026-09-08 16:32:42 +07:00
ik 3f468799bd feat: enforce community source cooldown
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s
2026-09-05 07:52:37 +07:00
ik 1a09bd59f3 feat: add RF4MAP and RF4 Posts research parsers
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s
2026-09-05 07:36:35 +07:00
ik 16d64606f8 feat: add RF4DB and RF4-STAT research parsers 2026-09-03 18:37:09 +07:00