Closed MaurUppi closed 6 months ago
目前没有这个打算。你可以借助本项目,构建自己的数据库文件,参考本项目 README。
目前没有这个打算。你可以借助本项目,构建自己的数据库文件,参考本项目 README。
虽然Issue closed 但,可否询问一下,当前项目程序是否同样支持 db-ip的CSV或者mmdb呢?
支持 MaxMind 的 MMDB 格式作为输入端(input)
支持 MaxMind 的 MMDB 格式作为输入端(input)
我看到 plugin/maxmind/mmdb_in.go
有用到 github.com/oschwald/maxminddb-golang
库,这个是库是可以支持读取db-IP mmdb的。
另外config.json只有 maxmindGeoLite2CountryCSV ,mmdb格式是否更改为 maxmindGeoLite2CountryMMDB
还是怎样?
{
"type": "maxmindGeoLite2CountryCSV",
"action": "add",
"args": {
"country": "./geolite2/GeoLite2-Country-Locations-en.csv",
"ipv4": "./geolite2/GeoLite2-Country-Blocks-IPv4.csv",
"ipv6": "./geolite2/GeoLite2-Country-Blocks-IPv6.csv"
}
}
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"strings"
"github.com/Loyalsoldier/geoip/lib"
"github.com/oschwald/maxminddb-golang"
)
@MaurUppi 我这边有一份替换maxmind数据库为ipinfo.io 数据库的commit修改 你可以拿去用,准确度比maxmind的数据准确很多
https://github.com/JohnnySun/geoip/commit/b4f6f9b7f0e8409fa1f84e0883172adfa1aa8484
https://github.com/cnartlu/geoip2/issues/1#issuecomment-1865975263
用下来,感觉 DB-IP ip-to-city-lite 比MaxMind GeoLite2-City数据质量更好,也丰富