Add support for downloading legacy geoip databases

Pass the geoip databases to measurement-kit
This commit is contained in:
Arturo Filastò
2018-03-23 15:26:25 +01:00
parent e56ce73006
commit 749cc665af
3 changed files with 73 additions and 22 deletions
+4 -2
View File
@@ -3,6 +3,7 @@ package nettests
import (
"encoding/json"
"fmt"
"path/filepath"
"github.com/apex/log"
"github.com/measurement-kit/go-measurement-kit"
@@ -11,6 +12,7 @@ import (
"github.com/openobservatory/gooni/internal/colors"
"github.com/openobservatory/gooni/internal/database"
"github.com/openobservatory/gooni/internal/output"
"github.com/openobservatory/gooni/utils"
)
// Nettest interface. Every Nettest should implement this.
@@ -72,8 +74,8 @@ func (c *Controller) Init(nt *mk.Nettest) error {
SoftwareVersion: version.Version,
// XXX
GeoIPCountryPath: "",
GeoIPASNPath: "",
GeoIPCountryPath: filepath.Join(utils.GeoIPDir(c.Ctx.Home), "GeoIP.dat"),
GeoIPASNPath: filepath.Join(utils.GeoIPDir(c.Ctx.Home), "GeoIPASNum.dat"),
OutputPath: c.msmtPath,
CaBundlePath: "/etc/ssl/cert.pem",
}