Skip to content

Commit

Permalink
Release 3.6.0 (#239)
Browse files Browse the repository at this point in the history
* chore: update dependencies

* chore: update user agent for measurements

* chore: we're now at v3.6.0

* chore: update assets

* chore: update bundled CA

* fix: address some goreportcard.com warnings

* fix(debian/changelog): zap release that breaks out build scripts

We're forcing the content of changelog with `dch`, so it's fine to
not have any specific new release in there.

* fix: make sure tests are passing locally

Notably, I removed a chunk of code where we were checking for network
activity. Now we don't fetch the databases and it's not important. Before,
it was important because the databases are ~large.

* fix: temporarily comment out riseupvn integration tests

See ooni/probe#1354 for work aimed at
reducing the rate of false positives (thanks @cyBerta!)
  • Loading branch information
bassosimone authored Mar 3, 2021
1 parent 034db78 commit 0d4323a
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 109 deletions.
2 changes: 1 addition & 1 deletion cmd/ooniprobe/internal/nettests/nettests.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (c *Controller) Run(builder *engine.ExperimentBuilder, inputs []string) err
// Even with a failed measurement, we want to continue. We want to
// record and submit the information we have. Saving the information
// is useful for local inspection. Submitting it is useful to us to
// undertsand what went wrong (censorship? bug? anomaly?).
// understand what went wrong (censorship? bug? anomaly?).
}

saveToDisk := true
Expand Down
2 changes: 1 addition & 1 deletion cmd/ooniprobe/internal/utils/homedir/homedir.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ func Expand(path string) (string, error) {
return filepath.Join(dir, path[1:]), nil
}

// MustExpand expands path and panics on failure.
func MustExpand(path string) string {
str, err := Expand(path)
if err != nil {
panic(err)
}

return str
}

Expand Down
6 changes: 0 additions & 6 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
ooniprobe-cli (3.5.2-1) unstable; urgency=medium

* New release

-- Federico Ceratto <federico@openobservatory.org> Tue, 16 Feb 2021 12:40:20 +0000

ooniprobe-cli (3.0.9) unstable; urgency=medium

* Test release
Expand Down
19 changes: 10 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/alecthomas/kingpin v2.2.6+incompatible
github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15 // indirect
github.com/apex/log v1.9.0
github.com/creack/goselect v0.1.2 // indirect
github.com/cretz/bine v0.1.0
github.com/dchest/siphash v1.2.2 // indirect
github.com/fatih/color v1.10.0
Expand All @@ -18,25 +19,25 @@ require (
github.com/gorilla/websocket v1.4.2
github.com/iancoleman/strcase v0.1.3
github.com/lucas-clemente/quic-go v0.19.3
github.com/marten-seemann/qtls-go1-15 v0.1.2 // indirect
github.com/mattn/go-colorable v0.1.8
github.com/mattn/go-sqlite3 v1.14.6 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/miekg/dns v1.1.38
github.com/montanaflynn/stats v0.6.4
github.com/ooni/psiphon v0.4.0
github.com/oschwald/geoip2-golang v1.4.0
github.com/oschwald/maxminddb-golang v1.8.0 // indirect
github.com/miekg/dns v1.1.40
github.com/montanaflynn/stats v0.6.5
github.com/ooni/psiphon v0.5.0
github.com/oschwald/geoip2-golang v1.5.0
github.com/pborman/getopt/v2 v2.1.0
github.com/pion/stun v0.3.5
github.com/pkg/errors v0.9.1
github.com/rogpeppe/go-internal v1.7.0
github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351
github.com/rubenv/sql-migrate v0.0.0-20210215143335-f84234893558
github.com/sirupsen/logrus v1.7.0 // indirect
gitlab.com/yawning/obfs4.git v0.0.0-20201217005658-f638c33f6c6f
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 // indirect
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04
golang.org/x/text v0.3.5 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.25.0 // indirect
Expand Down
74 changes: 22 additions & 52 deletions go.sum

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion internal/engine/experiment/riseupvpn/riseupvpn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ func TestFailureGeoIpServiceBlocked(t *testing.T) {
}

func TestFailureGateway(t *testing.T) {
t.Skip("test currently not WAI - will restore after release")
var testCases = [...]string{"openvpn", "obfs4"}
eipService, err := fetchEipService()
if err != nil {
Expand Down Expand Up @@ -421,7 +422,7 @@ func runGatewayTest(t *testing.T, censoredGateway *SelfCensoredGateway) {
}

if tk.APIStatus == "blocked" {
t.Fatal("invalid ApiStatus")
t.Fatal("invalid ApiStatus", tk.APIStatus)
}

if tk.APIFailure != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/experiment/tor/tor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestMeasurerMeasureFetchTorTargetsEmptyList(t *testing.T) {

func TestMeasurerMeasureGoodWithMockedOrchestra(t *testing.T) {
// This test mocks orchestra to return a nil list of targets, so the code runs
// but we don't perform any actualy network actions.
// but we don't perform any actual network actions.
measurer := NewMeasurer(Config{})
measurer.newOrchestraClient = func(ctx context.Context, sess model.ExperimentSession) (model.ExperimentOrchestraClient, error) {
return new(probeservices.Client), nil
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/experiment/webconnectivity/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func Summarize(tk *TestKeys) (out Summary) {
tcpIP = "tcp_ip"
)
// If the measurement was for an HTTPS website and the HTTP experiment
// succeded, then either there is a compromised CA in our pool (which is
// succeeded, then either there is a compromised CA in our pool (which is
// certifi-go), or there is transparent proxying, or we are actually
// speaking with the legit server. We assume the latter. This applies
// also to cases in which we are redirected to HTTPS.
Expand All @@ -129,7 +129,7 @@ func Summarize(tk *TestKeys) (out Summary) {
if tk.DNSExperimentFailure != nil &&
*tk.DNSExperimentFailure == errorx.FailureDNSNXDOMAINError &&
tk.DNSConsistency != nil && *tk.DNSConsistency == DNSConsistent {
// TODO(bassosimone): MK flags this as accessible. This result is debateable. We
// TODO(bassosimone): MK flags this as accessible. This result is debatable. We
// are doing what MK does. But we most likely want to make it better later.
//
// See <https://github.com/ooni/probe-engine/issues/579>.
Expand All @@ -146,7 +146,7 @@ func Summarize(tk *TestKeys) (out Summary) {
out.Status |= StatusAnomalyDNS | StatusExperimentDNS
return
}
// If we tried to connect more than once and never succeded and we were
// If we tried to connect more than once and never succedeed and we were
// able to measure DNS consistency, then we can conclude something.
if tk.TCPConnectAttempts > 0 && tk.TCPConnectSuccesses <= 0 && tk.DNSConsistency != nil {
out.Status |= StatusAnomalyConnect | StatusExperimentConnect
Expand Down
4 changes: 2 additions & 2 deletions internal/engine/httpheader/useragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package httpheader

// UserAgent returns the User-Agent header used for measuring.
func UserAgent() string {
// 12.0% as of Jan 29, 2021 according to https://techblog.willshouse.com/2012/01/03/most-common-user-agents/
const ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
// 8.0% as of Mar 3, 2021 according to https://techblog.willshouse.com/2012/01/03/most-common-user-agents/
const ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
return ua
}

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/legacy/netx/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func testresolverquick(t *testing.T, network, address string) {
}
}
if !foundquad8 {
t.Fatalf("did not find 8.8.8.8 in ouput; output=%+v", addrs)
t.Fatalf("did not find 8.8.8.8 in output; output=%+v", addrs)
}
}

Expand Down
12 changes: 6 additions & 6 deletions internal/engine/legacy/oonitemplates/oonitemplates.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,27 +173,27 @@ func configureDNS(seed int64, network, address string) (modelx.DNSResolver, erro
return nil, err
}
fallbacks := []dnsFallback{
dnsFallback{
{
network: "doh",
address: "https://cloudflare-dns.com/dns-query",
},
dnsFallback{
{
network: "doh",
address: "https://dns.google/dns-query",
},
dnsFallback{
{
network: "dot",
address: "8.8.8.8:853",
},
dnsFallback{
{
network: "dot",
address: "8.8.4.4:853",
},
dnsFallback{
{
network: "dot",
address: "1.1.1.1:853",
},
dnsFallback{
{
network: "dot",
address: "9.9.9.9:853",
},
Expand Down
4 changes: 2 additions & 2 deletions internal/engine/legacy/oonitemplates/oonitemplates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ func obfs4config() OBFS4ConnectConfig {
Address: "109.105.109.165:10527",
StateBaseDir: "../../testdata/",
Params: map[string][]string{
"cert": []string{
"cert": {
"Bvg/itxeL4TWKLP6N1MaQzSOC6tcRIBv6q57DYAZc3b2AzuM+/TfB7mqTFEfXILCjEwzVA",
},
"iat-mode": []string{"1"},
"iat-mode": {"1"},
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/netx/dialer/errorwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (d ErrorWrapperDialer) DialContext(ctx context.Context, network, address st
conn, err := d.Dialer.DialContext(ctx, network, address)
err = errorx.SafeErrWrapperBuilder{
// ConnID does not make any sense if we've failed and the error
// does not make any sense (and is nil) if we succeded.
// does not make any sense (and is nil) if we succeeded.
DialID: dialID,
Error: err,
Operation: errorx.ConnectOperation,
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/netx/dialer/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func WithProxyURL(ctx context.Context, url *url.URL) context.Context {

// DialContext implements Dialer.DialContext
func (d ProxyDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) {
url := ContextProxyURL(ctx) // context URL takes precendence
url := ContextProxyURL(ctx) // context URL takes precedence
if url == nil {
url = d.ProxyURL
}
Expand Down
4 changes: 2 additions & 2 deletions internal/engine/netx/gocertifi/certifi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/engine/netx/quicdialer/errorwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (d ErrorWrapperDialer) DialContext(
sess, err := d.Dialer.DialContext(ctx, network, host, tlsCfg, cfg)
err = errorx.SafeErrWrapperBuilder{
// ConnID does not make any sense if we've failed and the error
// does not make any sense (and is nil) if we succeded.
// does not make any sense (and is nil) if we succeeded.
DialID: dialID,
Error: err,
Operation: errorx.QUICHandshakeOperation,
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/netx/quicdialer/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestSystemDialerSuccessWithReadWrite(t *testing.T) {
t.Fatal("unexpected Name")
}
if ev[idx].Time.Before(ev[idx-1].Time) {
t.Fatal("unexpected Time")
t.Fatal("unexpected Time", ev[idx].Time, ev[idx-1].Time)
}
}
}
2 changes: 1 addition & 1 deletion internal/engine/netx/resolver/encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func validate(t *testing.T, data []byte, qtype byte) {
t.Fatal("The name does not contain 1:x")
}
if data[14] != 3 || data[15] != byte('o') || data[16] != byte('r') || data[17] != byte('g') {
t.Fatal("The name does not containg 3:org")
t.Fatal("The name does not contain 3:org")
}
if data[18] != 0 {
t.Fatal("The name does not terminate where expected")
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/netx/resolver/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func testresolverquick(t *testing.T, reso resolver.Resolver) {
}
}
if !foundquad8 {
t.Fatalf("did not find 8.8.8.8 in ouput; output=%+v", addrs)
t.Fatalf("did not find 8.8.8.8 in output; output=%+v", addrs)
}
}

Expand Down
14 changes: 7 additions & 7 deletions internal/engine/resources/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package resources

const (
// Version contains the assets version.
Version = 20210129095811
Version = 20210303114512

// ASNDatabaseName is the ASN-DB file name
ASNDatabaseName = "asn.mmdb"
Expand Down Expand Up @@ -30,13 +30,13 @@ type ResourceInfo struct {
// All contains info on all known assets.
var All = map[string]ResourceInfo{
"asn.mmdb": {
URLPath: "/ooni/probe-assets/releases/download/20210129095811/asn.mmdb.gz",
GzSHA256: "ef1759bf8b77128723436c4ec5a3d7f2e695fb5a959e741ba39012ced325132c",
SHA256: "0afa5afc48ba913933f17b11213c3044499c8338cf63b8f9af2778faa5875474",
URLPath: "/ooni/probe-assets/releases/download/20210303114512/asn.mmdb.gz",
GzSHA256: "efafd5a165c5a4e6bf6258d87ed685254a2660669eb4557e25c5ed72e48d039a",
SHA256: "675dbaec3fa1e6f12957c4e4ddee03f50f5192507b5095ccb9ed057468c2441b",
},
"country.mmdb": {
URLPath: "/ooni/probe-assets/releases/download/20210129095811/country.mmdb.gz",
GzSHA256: "5d465224ab02242a8a79652161d2768e64dd91fc1ed840ca3d0746f4cd29a914",
SHA256: "b4aa1292d072d9b2631711e6d3ac69c1e89687b4d513d43a1c330a92b7345e4d",
URLPath: "/ooni/probe-assets/releases/download/20210303114512/country.mmdb.gz",
GzSHA256: "7f1db0e2903271258319834f26bbcdedd2d0641457a8c0a63b048a985b7d6e7b",
SHA256: "19e4d2c5cd31789da1a67baf883995f2ea03c4b8ba7342b69ef8ae2c2aa8409c",
},
}
8 changes: 8 additions & 0 deletions internal/engine/resourcesmanager/resourcesmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ type CopyWorker struct {
WriteFile func(filename string, data []byte, perm fs.FileMode) error // optional
}

// If you arrive here because of this error:
//
// internal/engine/resourcesmanager/resourcesmanager.go:39:12: pattern *.mmdb.gz: no matching files found
// internal/engine/resourcesmanager/resourcesmanager.go:39:12: pattern *.mmdb.gz: no matching files found
//
// then your problem is that you need to fetch resources _before_ compiling
// ooniprobe. See Readme.md for instructions on how to do that.

//go:embed *.mmdb.gz
var efs embed.FS

Expand Down
6 changes: 0 additions & 6 deletions internal/engine/session_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,6 @@ func TestSessionLocationLookup(t *testing.T) {
if sess.ResolverNetworkName() == geolocate.DefaultResolverNetworkName {
t.Fatal("unexpected ResolverNetworkName")
}
if sess.KibiBytesSent() <= 0 {
t.Fatal("unexpected KibiBytesSent")
}
if sess.KibiBytesReceived() <= 0 {
t.Fatal("unexpected KibiBytesReceived")
}
}

func TestSessionCloseCancelsTempDir(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package version

const (
// Version is the software version
Version = "3.5.2"
Version = "3.6.0"
)
7 changes: 5 additions & 2 deletions pkg/oonimkall/session_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ func TestMaybeUpdateResourcesWithCancelledContext(t *testing.T) {
ctx := sess.NewContext()
ctx.Cancel() // cause immediate failure
err = sess.MaybeUpdateResources(ctx)
if !errors.Is(err, context.Canceled) {
t.Fatalf("not the error we expected: %+v", err)
// Explaination: we embed resources. We should change the API
// and remove the context. Until we do that, let us just assert
// that we have embedding and the context does not matter.
if err != nil {
t.Fatal(err)
}
}

Expand Down

0 comments on commit 0d4323a

Please sign in to comment.