Skip to content

Commit

Permalink
indicate that country db is gzipped in the filename
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Nov 12, 2022
1 parent 898978c commit 1cf5f54
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ plausible-report.xml

# Geolocation databases
/priv/geodb/*.mmdb
/priv/geodb/*.mmdb.gz

# Auto-generated tracker files
/priv/tracker/js/*.js
2 changes: 1 addition & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,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)
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/download_country_database.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)}")
Expand Down

0 comments on commit 1cf5f54

Please sign in to comment.