Git Product home page Git Product logo

Comments (10)

rm-Umar avatar rm-Umar commented on August 25, 2024 1

Thank you @ingria for reporting. Will look into it soon!

from mmdbctl.

UmanShahzad avatar UmanShahzad commented on August 25, 2024 1

We're going to implement this very soon, within a week or two. No worries!

from mmdbctl.

UmanShahzad avatar UmanShahzad commented on August 25, 2024

This is likely because of #2 - the geolite2/geoip2 datasets have nested structures which we don't yet support properly.

from mmdbctl.

ingria avatar ingria commented on August 25, 2024

Also it would be nice to be able to use ipinfo mmdbs as a drop-in replacement for maxmind datasets (I assume that they are generated with mmdbctl). The problem is that many existing services only supports the native โ€œnestedโ€ structure.

e.g. https://docs.nginx.com/nginx/admin-guide/dynamic-modules/geoip2/

from mmdbctl.

wyot1 avatar wyot1 commented on August 25, 2024

I realize you may not care as you sell your own, but can your tool verify the integrity of those dbs with nested structures such as mm's? That'd already be useful to make automation more robust in case of corrupted downloads.

Tried with one, and while lookups and metadata are broken as expected, after randomly changing a byte, the verify indeed recognizes it and fails.

from mmdbctl.

UmanShahzad avatar UmanShahzad commented on August 25, 2024

This is fixed - can anyone here who was looking for this use case check and provide feedback?

from mmdbctl.

ingria avatar ingria commented on August 25, 2024

I can confirm that maxmind dbs are now readable ๐Ÿ‘

Is it possible to write nested structured datat into mmdb with mmdbctl?

from mmdbctl.

UmanShahzad avatar UmanShahzad commented on August 25, 2024

@ingria Yes, if you have a JSON file with nested structures, it'll be written as a natively nested structure in the MMDB file too.

Lemme know if you face any issues, happy to debug.

from mmdbctl.

ingria avatar ingria commented on August 25, 2024

Understood, thanks!

from mmdbctl.

5721309 avatar 5721309 commented on August 25, 2024

Sorry if I'm missing something obvious. I try to import from .json (with nested structures) to .mmdb. It gives me such errors:

panic: interface conversion: interface {} is []interface {}, not map[string]interface {}

goroutine 1 [running]:
github.com/ipinfo/mmdbctl/lib.CmdImport({0x0, {0x7ffdcd4baed2, 0x14}, {0x7ffdcd4baeed, 0x1c}, 0x0, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
        /Users/ipinfo/Work/ipinfo_public/mmdbctl_master/lib/cmd_import.go:376 +0x1a85
main.cmdImport()
        /Users/ipinfo/Work/ipinfo_public/mmdbctl_master/cmd_import.go:150 +0xfd
main.main()
        /Users/ipinfo/Work/ipinfo_public/mmdbctl_master/main.go:36 +0xaf

Unfortunately, i don't know Go language and cannot understand this issue. Can anyone explain what I do wrong? JSON that I use looks like this:

[
  {
    "range": "10.0.1.0/24",
    "continent": {
      "geoname_id": 6255000
    },
    "country": {
      "geoname_id": 2017000
    },
    "subdivisions": [
      {
        "geoname_id": 536000
      }
    ],
    "city": {
      "geoname_id": 498000
    },
    "location": {
      "latitude": 63,
      "longitude": 28,
      "accuracy_radius": 5
    }
  },
  {
    "range": "10.0.3.0/25",
    "continent": {
      "geoname_id": 6255000
    },
    "country": {
      "geoname_id": 2017000
    },
    "subdivisions": [
      {
        "geoname_id": 1488000
      }
    ],
    "city": {
      "geoname_id": 1488000
    },
    "location": {
      "latitude": 45,
      "longitude": 55,
      "accuracy_radius": 1
    }
  },
  {
    "range": "10.0.3.128/25",
    "continent": {
      "geoname_id": 6255000
    },
    "country": {
      "geoname_id": 2017000
    },
    "subdivisions": [
      {
        "geoname_id": 1488000
      }
    ],
    "city": {
      "geoname_id": 1488000
    },
    "location": {
      "latitude": 52,
      "longitude": 62,
      "accuracy_radius": 1
    }
  }
]

And import cmd is the following:

mmdbctl import --in to-import-geoip.json --out imported-from-json-geoip.mmdb

from mmdbctl.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.