[MGNLPN-395] Externalize GeoLite2-Country.mmdb to a configurable point Created: 03/Aug/17  Updated: 01/Sep/21  Resolved: 31/Aug/21

Status: Closed
Project: Magnolia Personalization
Component/s: Traits
Affects Version/s: 1.4.5, 1.4.7
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Viet Nguyen Assignee: Unassigned
Resolution: Outdated Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 3h
Original Estimate: Not Specified

Attachments: Java Source File PersonalizationTraitsModule.java    
Issue Links:
causality
dependency
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

We "Reads the country from an IP address using a GeoLite2 database." which is continuously updated but the way we read it and use it is quite static such as hardcoding a specific path "info/magnolia/personalization/geoip/GeoLite2-Country.mmdb" in our packaged JAR file.
(grep code: GeoIPReader::info.magnolia.personalization.geoip.GeoIPReader line 53)
Expected result:
Having a configuration point such as '/modules/personalization-traits/geoip@GeoLite2Db=/Users/viet.nguyen/tmp/my_new_db.mmdb'
System able to load it whenever we make a change.



 Comments   
Comment by Viet Nguyen [ 03/Aug/17 ]

Workaround is overriding old file by a new one by putting it within your web app folder under '/WEB-INF/classes/info/magnolia/personalization/geoip/GeoLite2-Country.mmdb'

Comment by Viet Nguyen [ 17/May/18 ]

This time in SUPPORT-8684, a customer had an issue with country resolver because of out dated database.

Comment by Viet Nguyen [ 17/May/18 ]

Make it configurable by changing Module class like this: PersonalizationTraitsModule.java
Configuration could be done by setting /modules/personalization-traits/config@countryDbLocation to a classpath resource our external file.

Comment by Viet Nguyen [ 23/May/18 ]

Our GeoIP related library also too old which caused some issues with our Cloud support.
https://github.com/maxmind/MaxMind-DB-Reader-java/issues/4

Comment by Viet Nguyen [ 23/May/18 ]

Latest version:

<dependency>
    <groupId>com.maxmind.geoip2</groupId>
    <artifactId>geoip2</artifactId>
    <version>2.12.0</version>
</dependency>

<dependency>
    <groupId>com.maxmind.db</groupId>
    <artifactId>maxmind-db</artifactId>
    <version>1.2.2</version>
</dependency>
Comment by Viet Nguyen [ 01/Sep/21 ]

The library was updated in Magnolia 6.2. Please upgrade to take advantage of this.

Generated at Mon Feb 12 06:37:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.