An attempt to simplify and automate MaxMind GeoLite2 geoipupdate tool installation and configuration.
It's meant to be edited first (at least GeoIP account credentials at the top of the file need to be set) and then run as an script either at the end of Docker image build, or downloading it inside the container and running it there.
sudo ./install_geoipupdate.sh
It achieves that by these steps:
Installing few small necessary dependencies (curl, wget, tar, jq, nano)
Detecting current system architecture for correct geoipupdate tool package download (Linux and Darwin versions)
Selecting and downloading respective .tar.gz packages and checking their checksums
Creating recommended directory for database files /usr/share/GeoIP
Unpacking necessary files to recommended directories /usr/local/bin and /usr/local/etc
Making necessary changes to /usr/local/etc/GeoIP.conf for automated database download / update
Running installed geoipupdate tool for initial database download or manual update
Setting up cron job for automated database updates (twice weekly - Mon, Thu - at 22:55)
It does some basic validation and error checking and provides verbose output for detecting issues. It only updates files that need to be updated, so can be subsequently run if geoipupdate tool version changes or to manually update database or recreate cron job.
Everything should be apparent from comments in the code.
Please let me know if this is useful, or you want me to implement any changes. I'll try to keep it up to date if anything changes on MaxMind's or ntop's side.
Please bear with the imperfect code. One of my first attempts ;)
An attempt to simplify and automate MaxMind GeoLite2 geoipupdate tool installation and configuration.
It's meant to be edited first (at least GeoIP account credentials at the top of the file need to be set) and then run as an script either at the end of Docker image build, or downloading it inside the container and running it there.
sudo ./install_geoipupdate.sh
It achieves that by these steps:
/usr/share/GeoIP
/usr/local/bin
and/usr/local/etc
/usr/local/etc/GeoIP.conf
for automated database download / updateIt does some basic validation and error checking and provides verbose output for detecting issues. It only updates files that need to be updated, so can be subsequently run if geoipupdate tool version changes or to manually update database or recreate cron job.
Everything should be apparent from comments in the code.
Please let me know if this is useful, or you want me to implement any changes. I'll try to keep it up to date if anything changes on MaxMind's or ntop's side.
Please bear with the imperfect code. One of my first attempts ;)