g-andrade

g-andrade

Hi forum,

I’m pleased to announce the release of locus 1.0.0, an Erlang/OTP library that allows you to pinpoint the country, city or ASN of IPv4 and IPv6 addresses, using MaxMind’s GeoLite2 databases.

The MaxMind databases you choose are downloaded on-demand, cached on the filesystem and updated automatically.

The databases are loaded into memory (mostly) as-is; reference counted binaries are shared with the application callers using ETS tables, and the original binary search tree is used to lookup addresses. The data for each entry is decoded on the fly upon successful lookups.

Showing Posts 1 to 10

g-andrade

g-andrade OP

Hi forum,

Locus 1.1.1 was released today.

Added:

  • OTP 18, 19.0, 19.1 and 19.2 support (version 1.0.x required 19.3 or higher)
  • ability of consulting database metadata, source and version through :get_info
  • ability of subscribing database loader events
  • ability of specifying connect, download start and idle download timeouts
  • ability of turning off caching

Documentation was moved to HexDocs and test coverage was substantially increased.

brightball

brightball

Great work! That’s a hugely useful dataset to have easy access too.

Without having looked heavily at what you’ve done, what is the size of the database?

g-andrade

g-andrade OP

Thanks! :slight_smile:

Without having looked heavily at what you’ve done, what is the size of the database?

It depends on the database you pick. MaxMind provides three databases for free:

  • Country database (~3 MiB when uncompressed)
  • City database (~60 MiB when uncompressed; conceptually similar to country database but with more precision)
  • ASN database (~6 MiB when uncompressed)

As the databases are, for the most part, used in their raw form, the expected memory consumption should correspond roughly one-to-one.

They’re not, however, included in the package; they’re downloaded on demand, and caching is leveraged to minimize likelihood of unavailability upon subsequent application boots. My main motivation for this was to avoid some of the shortcomings of egeoip, where database updates were committed to the repository, which grew ever larger.

I do plan to support explicit loading from local filesystem, with or without support for updating from network after having that as a starting point. But because the semantics of this, and all its edge cases, aren’t still quite clear in my head, I’ve been delaying it, as I want to keep things as simple as possible for now.

OvermindDL1

OvermindDL1

Whooo awesome there!

g-andrade

g-andrade OP

Hi forum,

Locus 1.3.0 was released today.

Added:

  • ability of loading databases from local file system
  • type spec of database entries

Fixed:

  • wrong handling of timezones on cached tarballs
  • wrong handling of daylight saving time on conditional HTTP requests

The timezone / DST fixes mentioned above were also backported to earlier versions and tagged under:

  • 1.0.1
  • 1.1.4
  • 1.2.2

Links:

g-andrade

g-andrade OP

Hello forum,

Locus 1.6.0 was released today.

Added:

  • new API method for validating loaded databases (locus:analyze/1)
  • new command line tool supporting database validation

Changed:

  • safety of database HTTPS downloads was substantially improved by now rejecting expired certificates, mismatched hostnames, self-signed certificates or unknown certificate authorities
  • test coverage using MaxMind’s test data was greatly extended
  • database decoder was thoroughly optimized
  • documentation was mildly improved

Fixed:

  • misguided rejection of UTF-8 strings with non-printable (but valid) codepoints
  • unnecessarily strict refusal to load 2.x database formats succeeding 2.0
  • infinite recursion in maliciously crafted databases due to circular paths

Links:

g-andrade

g-andrade OP

Hello again,

Locus 1.7.0 was released today.

Added

  • ability of loading databases from uncompressed tarballs (.tar files)
  • ability of loading unpacked databases (.mmdb and .mmdb.gz files)
  • stacktrace of caught exceptions to event reporting (including custom logger)
  • ability of launching database loaders under library consumers’ own supervisors
  • wait_for_loaders/2 API method for concurrently awaiting multiple database loaders

Changed

  • log level of HTTP and filesystem database loading failures from warning to error
  • HTTP and filesystem loaders into a common loader codebase
  • caching of HTTP databases as to store and load compressed .mmdb files rather than tarballs
  • supervision structure as to launch database loaders as transient processes under a new simple_one_for_one supervisor
  • dependency versions:
    • certifi [2.4.2 => 2.5.1]
    • ssl_verify_fun [1.1.4 => 1.1.5]

Removed

  • support for OTP 17.4 and 17.5
  • undocumented support for rebar 2
  • half-baked and unwarranted support for file://-prefixed URLs

Fixed

  • case-sensitive patterning of .mmdb file extensions within tarballs
  • overly verbose logger messages on OTP 21.1+
  • HTTPS certificate validation test cases on OTP 22

Links:

g-andrade

g-andrade OP

I’m pleased to announce the release of Locus 1.8.0 .

Added

  • support for returning types other than map upon successful lookups

Changed

  • MMDB decoder, which was split into separate tree, data section and analysis modules
  • imported stacktrace_compat version [1.0.2 => 1.1.1]

Removed

  • support for OTP 18

Fixed

  • incidents of locus managerial processes keeping references to old binaries, upon a database update, for a potentially unlimited time (OTP 20+ only)
  • broken logging of playground shell on OTP 21.1+

Links:

g-andrade

g-andrade OP

Locus 1.9.0, after one month in beta, has been released!

Added

  • support for downloading databases with full awareness of license keys (now mandatory)

Deprecated

  • the use of discontinued https://geolite.maxmind.com/download/geoip/database/GeoLite2-... database URLs

Links:

g-andrade

g-andrade OP

Locus 1.10.0 was released today (a rather short release cycle this time.)

Added

  • rejection of successful HTTP downloads if body size doesn’t match content-length header
  • checksum verification of databases downloaded directly from MaxMind
  • censorship of license key from database URLs mentioned in logs
  • :await_loader API function which, contrary to :wait_for_loader, will await readiness up to the entire specified interval (rather than return upon the first encountered failure)
  • purging of very large binaries from internally caught exceptions which are known error cases, as to lower the risk of the VM getting OOM-killed when logging formatters get their hands on those very large chunks of data

Changed

  • default behaviour upon failing to load a database, as to retry loading while exponentially backing off (using very short intervals at first)

Deprecated

  • :wait_for_loader and :wait_for_loaders API functions (use :await_loader and :await_loaders instead)

Fixed

  • incomplete spec for locus_loader:event() type
  • wrong spec for locus_maxmind_download:msg() and locus_maxmind_download:event() types

Links:

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews