Skip to content

Commit

Permalink
Use IPInfo as secondary source
Browse files Browse the repository at this point in the history
Fix #2682

Signed-off-by: Daniel Hansson <[email protected]>
  • Loading branch information
enoch85 authored Sep 22, 2024
1 parent 0bd74fb commit cb555a4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ HTTP2_CONF="/etc/apache2/mods-available/http2.conf"
# GeoBlock
GEOBLOCK_MOD_CONF="/etc/apache2/conf-available/geoblock.conf"
GEOBLOCK_MOD="/etc/apache2/mods-available/maxminddb.load"
GEOBLOCK_DIR="/usr/share/GeoIP"
# PHP-FPM
PHPVER=8.3
PHP_FPM_DIR=/etc/php/$PHPVER/fpm
Expand Down Expand Up @@ -423,8 +424,12 @@ download_geoip_mmdb() {
else
docker rm -f maxmind
rm -f /tmp/dockerenv
msg_box "Update limit for Maxmind GeoDatabase reached! Please try again tomorrow."
return 1
print_text_in_color "$ICyan" "Update limit for Maxmind GeoDatabase reached! We're now trying to get the Country Database from https://ipinfo.io instead."
if ! curl -sfL https://ipinfo.io/data/free/country.mmdb?token="$x8v8GyVQg2UejdPh" -o "$GEOBLOCK_DIR"/GeoLite2-Country.mmdb
then
msg_box "Sorry, we couldn't get the needed IP geolocation database from any source, please try again in 24 hours."
return 1
fi
fi
}

Expand Down

0 comments on commit cb555a4

Please sign in to comment.