Skip to content

feat: body reading, loop fingerprint body_hash, GeoIP/ASN config (#9, #13, #15)#19

Merged
levleontiev merged 6 commits intomainfrom
fix/issues-9-13-15
Mar 12, 2026
Merged

feat: body reading, loop fingerprint body_hash, GeoIP/ASN config (#9, #13, #15)#19
levleontiev merged 6 commits intomainfrom
fix/issues-9-13-15

Conversation

@levleontiev
Copy link
Contributor

Implements three open issues:

Code authored by @gemini-cli, PR opened by @claude.

@levleontiev
Copy link
Contributor Author

Code Review — PR #19 (Issues #9, #13, #15)

#9 — Body reading ✅ (with one note)

  • read_body() + get_body_file() fallback: correct, addresses @codex high-severity gap
  • utils.to_hex(utils.sha256(body)) safe: nil propagates without crash
  • Scoped correctly to reverse_proxy + POST/PUT/PATCH

⚠️ Nice-to-fix: No body size guard — a 100 MB body would be fully read into memory. Add a content-length cap before reading.

#13 — Loop fingerprint body_hash ✅

Clean. build_fingerprint appends body_hash after query_params, before limit_key_values. No issues.

#15 — GeoIP/ASN 🚨 Two blockers + artifact cleanup

🚨 BLOCKER 1: ngx_http_geoip2_module not installed
The geoip2 directive is not part of the base openresty/openresty:1.25.3.2-jammy image. The Dockerfile installs libmaxminddb0 (C lib) but not the nginx module — nginx will fail with unknown directive "geoip2". Fix:

RUN opm get leev/ngx_http_geoip2_module

🚨 BLOCKER 2: MMDB database files not provided
/etc/geoip2/GeoLite2-Country.mmdb and GeoLite2-ASN.mmdb are referenced but never downloaded or mounted — nginx will fail at startup. Need at minimum: documentation that files must be volume-mounted, or a download hook in entrypoint.sh gated on MAXMIND_LICENSE_KEY.

🚫 Artifacts committed
artifacts/e2e-full/compose.log (+370/-76086 lines) and junit.xml should not be committed. Add artifacts/ to .gitignore.


Verdict: REQUEST_CHANGES#9 and #13 are good to go, #15 needs the two blockers resolved and artifacts removed.

@levleontiev
Copy link
Contributor Author

Follow-up Review ✅ APPROVED

Все три блокера устранены:

Body size cap ✅ — string_sub(body, 1, 1048576) для in-memory + f:read(1048576) для file-backed. Чисто.

opm get leev/ngx_http_geoip2_module ✅ — добавлен в Dockerfile корректно.

Артефакты ✅ — compose.log и junit.xml удалены, artifacts/ в .gitignore.

MMDB check в entrypoint.sh ⚠️ note: предупреждение напечатается, но nginx всё равно упадёт с ошибкой если файлы отсутствуют (geoip2 модуль не работает без баз). Рекомендую поменять на exit 1 с понятным сообщением — но это не блокер, можно followup-issue.

PR #19 готов к мержу. @шеф

@levleontiev levleontiev merged commit f7a93de into main Mar 12, 2026
7 checks passed
@levleontiev levleontiev deleted the fix/issues-9-13-15 branch March 12, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants