docs: give geolocation its own section, and drop the dead GEO_TIMEOUT_SECONDS - #653
Conversation
|
Warning Review limit reached
Next review available in: 22 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review of #653 caught both. GEO_ENRICHMENT_ENABLED=false was described as leaving country/city/ASN empty outright. It only stops new lookups: GeoOrgLookupAdapter and the ip_geo_cache join in SubnetLabelSuggestionService read the cache directly without consulting tracepcap.geo.enabled, so geo resolved before the switch was flipped still surfaces. Say so, and point at the cache table. GEO_MMDB_PATH's fallback was described unconditionally. tryOpenMmdb only falls back when the file does not exist — an existing but unopenable file (corrupt, or an unreadable bind mount) returns null from openFile and leaves no offline database at all. Distinguish the two cases and name the log line to check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…_SECONDS #645 wired the GeoIP variables into the backend container, which was the larger half of #652. Two things it left behind: GEO_TIMEOUT_SECONDS is dead. No Java reads tracepcap.geo.timeout-seconds — GeoIpService uses hardcoded CONNECT_TIMEOUT_MS/READ_TIMEOUT_MS constants — so #645 faithfully passed through a knob that does nothing. Remove the property and the two compose lines rather than leave an advertised setting with no effect. The env-vars page still had no geolocation section: GEO_MMDB_PATH appeared nowhere on it, and nothing in .env.example covered either variable. Add the section, and document both there. It spells out the distinction the two switches blur, which the one-line toggle entry could not: GEO_ENRICHMENT_ENABLED=false kills geolocation including the local MMDB, while GEO_FORCE_OFFLINE=true only suppresses the ipinfo.io egress — the latter is what an air-gapped deployment wants, since the MMDB lookup never touches the network. Two caveats worth stating because the code contradicts the obvious reading: * Turning enrichment off is not retroactive. GeoOrgLookupAdapter and the ip_geo_cache join in SubnetLabelSuggestionService read the cache directly without consulting tracepcap.geo.enabled, so geo resolved earlier still surfaces. The toggle row's "no geo fields on hosts" is corrected to match. * GEO_MMDB_PATH only falls back to the bundled database when the path does not exist. tryOpenMmdb returns openFile(f) the moment f.exists(), so a corrupt file or an unreadable bind mount yields null and leaves the deployment with no offline database at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2d01beb to
39df8b0
Compare
…656) * fix: make the env guard catch dead knobs, not just unreachable ones The guard checked one direction — variables the backend reads that no compose file passes — and was blind to the inverse: a variable compose passes that no Spring config reads. That one looks configurable in .env and does nothing. Which is exactly what I shipped. #645 wired GEO_TIMEOUT_SECONDS into both compose files because application.yml referenced it, without checking whether anything consumed it. Nothing did — GeoIpService uses hardcoded timeout constants — so the knob was inert from the moment it was added, and CI passed. #653 removed the dead property and the compose lines with it. A check written after this failure mode bit twice should not have been able to introduce a third instance of it. Now reports both directions separately, with the fix for each. The allowance for variables consumed outside Spring is an explicit two-entry list (APP_MEMORY_MB, TZ) rather than prefix matching. A pattern like LLM_* or MINIO_* would be less maintenance but would hide a genuinely dead knob in the same family — the precise thing this half of the check exists to find. Verified in both directions: injecting a knob nothing reads fails the check, and removing SURICATA_ENABLED from compose fails it too. Passes clean on main. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix/use-extend-for-filtered-diagnostics PERF401 from review on #656. Both filtered append loops become extend over a generator, which also gave each branch a one-line comment saying what it detects — the two halves of this check are easy to confuse when skimming. Adopted the intent rather than the suggested diff: the proposal rewrote the second loop as dead.extend([(stack, var)]) still inside the for, which is a single-element extend per iteration and strictly worse than the append it replaces. Note there is no Ruff config or Python lint in CI, so this is a readability change rather than a gate. Behaviour verified unchanged in both directions — injected dead knob still fails, removed SURICATA_ENABLED still fails, clean tree still passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Closes #652
Rebased after #645 landed. That PR wired every backend env var into the container — including
GEO_ENRICHMENT_ENABLEDandGEO_MMDB_PATH— and added a CI guard (scripts/check_env_passthrough.py) so the class of bug cannot recur. That was the larger half of #652, so the wiring commit here is dropped. What remains:Summary
GEO_TIMEOUT_SECONDS/tracepcap.geo.timeout-seconds. No Java reads it —GeoIpServiceuses hardcodedCONNECT_TIMEOUT_MS/READ_TIMEOUT_MSconstants — so fix: pass every backend environment variable into the container (#641) #645 faithfully passed through a knob that does nothing. Dropped fromapplication.ymland the two compose files that wired it, rather than leaving an advertised setting with no effect.GEO_MMDB_PATHappeared nowhere on it, and the section spells out the distinction the one-line toggle entry could not:GEO_ENRICHMENT_ENABLED=falsekills geolocation including the local MMDB, whileGEO_FORCE_OFFLINE=trueonly suppresses the ipinfo.io egress — the latter is what an air-gapped deployment wants..env.example, which covered neither.GeoOrgLookupAdapterand theip_geo_cachejoin inSubnetLabelSuggestionService.java:226read the cache directly without consultingtracepcap.geo.enabled, so geo resolved earlier still surfaces. fix: pass every backend environment variable into the container (#641) #645's "no geo fields on hosts" is corrected to match.GEO_MMDB_PATHonly falls back to the bundled database when the path does not exist.GeoIpService.java:341-345returnsopenFile(f)the momentf.exists(), so a corrupt file or an unreadable bind mount yields null and leaves no offline database at all.No behaviour change to defaults.
Test plan
docker compose configclean on all four stacks;GEO_ENRICHMENT_ENABLED,GEO_MMDB_PATHand the rightGEO_FORCE_OFFLINEsplit still reach the backend, with noGEO_TIMEOUT_SECONDSpython3 scripts/check_env_passthrough.pypasses — nothing the backend reads went unreachableGeolocation_ references resolve and the duplicate toggle row is goneGEO_TIMEOUT_SECONDSremains anywhere in the repo🤖 Generated with Claude Code