Skip to content

[master] Fix database update - #26

Merged
davide-scola merged 7 commits into
bitfinexcom:masterfrom
davide-scola:master-database_update_fix
Jul 30, 2025
Merged

[master] Fix database update#26
davide-scola merged 7 commits into
bitfinexcom:masterfrom
davide-scola:master-database_update_fix

Conversation

@davide-scola

Copy link
Copy Markdown
Contributor

This set of changes fixes several long-standing issues; here is a list of all the most notable changes:

:~$ grenache-request -s '1.1.1.1' 'rest:util:net' 'getIpGeo'
ERR_API_ACTION: The value of "offset" is out of range. It must be >= 0 and <= 11664748. Received 377_957_121_965
:~$ 
  • maxmind dependency has been updated to the latest version available; this fix an issue with the file watcher in older versions (see Unhandled rejection when watching for updates runk/node-maxmind#238). However, openSync is no longer available, hence a slight worker refactoring was needed
  • updatedb.js script is now the same as the latest version available, published by the geoip-lite project, with the minimum set of changes needed to use premium databases; this makes it easier to keep track of changes (linting is disabled for this file)
  • several fixes to the update-asn-db.sh script:
    • maxmind license key is now taken from a file if it's not supplied via an environment variable
    • destination directory is automatically created if it does not exist
    • conditional download has been restored (see [master] Update the ASN database only if it is newer than the local copy #7); database is downloaded only if it is newer than local version
    • database is copied to its final destination from a temporary location, as atomic replacement does not seem to trigger the file watcher
  • several fixes to the update-geo-db.sh script:
    • maxmind license key is now taken from a file if it's not supplied via an environment variable
    • destination directory is automatically created if it does not exist
    • databases are copied to their final destination from a temporary location for integrity, as update process takes time to complete

@davide-scola
davide-scola merged commit a4eb1bf into bitfinexcom:master Jul 30, 2025
@davide-scola
davide-scola deleted the master-database_update_fix branch July 30, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant