diff --git a/.gitignore b/.gitignore index c38e85477dfc0..11ba8cc3dff93 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ plausible-report.xml # Geolocation databases /priv/geodb/*.mmdb +/priv/geodb/*.mmdb.gz # Auto-generated tracker files /priv/tracker/js/*.js diff --git a/config/runtime.exs b/config/runtime.exs index 635c6e2f1e092..95bdfe16f2f13 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -129,7 +129,7 @@ geolite2_country_db = get_var_from_path_or_env( config_dir, "GEOLITE2_COUNTRY_DB", - Application.app_dir(:plausible, "/priv/geodb/dbip-country.mmdb") + Application.app_dir(:plausible, "/priv/geodb/dbip-country.mmdb.gz") ) ip_geolocation_db = get_var_from_path_or_env(config_dir, "IP_GEOLOCATION_DB", geolite2_country_db) diff --git a/lib/mix/tasks/download_country_database.ex b/lib/mix/tasks/download_country_database.ex index 5a2027af7c601..d81855d6e2e24 100644 --- a/lib/mix/tasks/download_country_database.ex +++ b/lib/mix/tasks/download_country_database.ex @@ -34,7 +34,7 @@ defmodule Mix.Tasks.DownloadCountryDatabase do if res.status_code == 200 do File.mkdir("priv/geodb") - File.write!("priv/geodb/dbip-country.mmdb", res.body) + File.write!("priv/geodb/dbip-country.mmdb.gz", res.body) Logger.info("Downloaded and saved the database successfully") else Logger.error("Unable to download and save the database. Response: #{inspect(res)}")