Removed files related to SQLNetworkService #5
Created by: Linus-CS
Removed following files:
- org.eclipsefoundation.geoip.client.service.impl.SQLNetworkService
- org.eclipsefoundation.geoip.client.dao.MariaDBDao
- org.eclipsefoundation.geoip.client.dao.MockMariaDBDao
Aswell as following properties in src/main/resources/application.properties
:
- quarkus.datasource.driver
- quarkus.datasource.url
- quarkus.datasource.username
- quarkus.datasource.min-size
- quarkus.datasource.max-size
Signed-off-by: LinusCS linus.schulze@hsnet.de
Merge request reports
Activity
@Linus-CS we've merged in the update that fixes fetching data for MaxMind. To be able to run this, you'll need to get a license key for MaxMind GeoLite2 DBs. This is free for this product, and only takes a couple of minutes to sign up for https://www.maxmind.com/en/geolite2/signup.
Once you've got a key, you'll need 2 things. First is an environment with shell (WSL or Cygwin would likely work), and once there, you need to create a license file for your license key. This is just a text file with your key with a new line at the end. Doesn't matter where you put it as long as the current user can read it. Update the
LICENSE_KEY_FILE
environment var to point at the file (e.x.export LICENSE_KEY_FILE=/localdev/geoip-rest-api/key
).From here, you should be able to run
./bin/maxmind.sh /tmp
to get the MaxMind data and run your tests. Let me know if you have any issues running the script and I'll assist!Created by: Linus-CS
@autumnfound after running
$ ./bin/maxmind.sh /tmp
I get these errors:Getting data from MaxMind
curl: (3) Illegal characters found in URL
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Even if I use
$ dos2unix maxmind.sh
to convert the file from Windows to Linux formatCreated by: Linus-CS
The lines seem to be right
curl -sSL "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=$LICENSE_KEY" | tar zxv -C bin --wildcards '*.mmdb' curl -sSL "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&suffix=tar.gz&license_key=$LICENSE_KEY" | tar zxv -C bin --wildcards '*.mmdb' curl -sSL "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&suffix=zip&license_key=$LICENSE_KEY" -o GeoLite2-Country-CSV.zi
I ran the dos2unix command on my key file and now I do not get the error anymore, nevertheless I get a error in
line 21: 1 isn't set.
Created by: Linus-CS
Sorry for bothering you again. I need some help. The maxmind.sh script works fine, yet the tests fail with the message
The system is unable to locate
\tmp\maxmind\bin\..
or\tmp\maxmind\db\..
First of all the maxmind.sh script seems like creating the subfolders \bin and \db but not \maxmind\bin and \maxmind\db, but in the
src\test\resources\application.properties
all paths are\tmp\maxmind\..
. Maybe this needs to be added in the script.Nevertheless if I manualy add the maxmind folder I get the same errors that the system is unable to locate the files. If I navigate to the directory all files are there.
This is how the errors look like:
ERROR [org.ecl.geo.cli.res.map.RuntimeMapper] (vert.x-worker-thread-7) java.io.FileNotFoundException: \tmp\maxmind\bin\GeoLite2-Country.mmdb (Das System kann den angegebenen Pfad nicht finden)
The maxmind folder was added by running the script with /tmp/maxmind as the storage location. I ran it that way on my machine most times as I have multiple scripts running and I didn't want there to be a collision. I could have made that clearer, apologies!
In terms of not being able to see the content...where are you running the maven/junit command for the test? Windows, Mac, or Linux?
Your issue might be that since you're running in a Windows-based environment, the file path format wouldn't be valid. We currently pipe the path directly into a File object which relies on your operating system to resolve the path. In Windows, you would need to give a path as your system would use (e.g. C:\home\joe\foo). Could you try updating the path to where those files reside in your Windows environment?
More info on paths here: https://docs.oracle.com/javase/tutorial/essential/io/pathOps.html