From b1ce300c8da7d6cdd65ac12df8dd469717bc1691 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Tue, 2 Feb 2021 10:32:46 +0100 Subject: [PATCH] fix: import path should be github.com/ooni/probe-cli/v3 (#200) See https://github.com/ooni/probe/issues/1335#issuecomment-771499511 --- .gitignore | 1 + .../ooniprobe/internal}/autorun/autorun.go | 0 .../internal}/autorun/autorun_darwin.go | 2 +- .../ooniprobe/internal}/bindata/bindata.go | 0 .../ooniprobe/internal}/cli/app/app.go | 4 +-- .../internal}/cli/autorun/autorun.go | 6 ++--- .../ooniprobe/internal}/cli/geoip/geoip.go | 6 ++--- .../internal}/cli/geoip/geoip_test.go | 4 +-- .../ooniprobe/internal}/cli/info/info.go | 4 +-- .../ooniprobe/internal}/cli/info/info_test.go | 4 +-- .../ooniprobe/internal}/cli/list/list.go | 6 ++--- .../internal}/cli/onboard/onboard.go | 8 +++--- .../ooniprobe/internal}/cli/reset/reset.go | 2 +- .../ooniprobe/internal}/cli/rm/rm.go | 4 +-- .../ooniprobe/internal}/cli/root/root.go | 12 ++++----- .../ooniprobe/internal}/cli/run/run.go | 8 +++--- .../ooniprobe/internal}/cli/show/show.go | 6 ++--- .../ooniprobe/internal}/cli/upload/upload.go | 2 +- .../internal}/cli/version/version.go | 4 +-- .../ooniprobe/internal}/config/parser.go | 4 +-- .../ooniprobe/internal}/config/parser_test.go | 0 .../ooniprobe/internal}/config/settings.go | 0 .../internal}/config/testdata/config-v0.json | 0 .../config/testdata/valid-config.json | 0 .../internal}/crashreport/crashreport.go | 0 .../ooniprobe/internal}/database/actions.go | 4 +-- .../internal}/database/actions_test.go | 0 .../ooniprobe/internal}/database/database.go | 2 +- .../internal}/database/database_test.go | 0 .../ooniprobe/internal}/database/models.go | 0 .../ooniprobe/internal}/enginex/enginex.go | 0 .../internal}/log/handlers/batch/batch.go | 0 .../internal}/log/handlers/cli/cli.go | 2 +- .../log/handlers/cli/measurements.go | 2 +- .../log/handlers/cli/progress/progress.go | 0 .../internal}/log/handlers/cli/results.go | 4 +-- .../internal}/log/handlers/syslog/syslog.c | 0 .../internal}/log/handlers/syslog/syslog.go | 0 .../ooniprobe/internal}/nettests/dash.go | 0 .../internal}/nettests/facebook_messenger.go | 0 .../ooniprobe/internal}/nettests/groups.go | 0 .../http_header_field_manipulation.go | 0 .../nettests/http_invalid_request_line.go | 0 .../ooniprobe/internal}/nettests/ndt.go | 0 .../ooniprobe/internal}/nettests/nettests.go | 6 ++--- .../internal}/nettests/nettests_test.go | 6 ++--- .../ooniprobe/internal}/nettests/psiphon.go | 0 .../ooniprobe/internal}/nettests/riseupvpn.go | 0 .../ooniprobe/internal}/nettests/run.go | 4 +-- .../ooniprobe/internal}/nettests/telegram.go | 0 .../ooniprobe/internal}/nettests/tor.go | 0 .../internal}/nettests/web_connectivity.go | 2 +- .../ooniprobe/internal}/nettests/whatsapp.go | 0 .../ooniprobe/internal}/ooni/ooni.go | 10 +++---- .../ooniprobe/internal}/ooni/ooni_test.go | 0 .../ooniprobe/internal}/oonitest/oonitest.go | 4 +-- .../ooniprobe/internal}/output/output.go | 4 +-- .../internal}/utils/homedir/homedir.go | 0 .../ooniprobe/internal}/utils/paths.go | 2 +- .../internal}/utils/shutil/shutil.go | 0 .../ooniprobe/internal}/utils/util_test.go | 0 .../ooniprobe/internal}/utils/utils.go | 0 .../ooniprobe/internal}/version/version.go | 0 cmd/ooniprobe/main.go | 26 +++++++++---------- .../ooniprobe/testdata}/testing-config.json | 0 go.mod | 2 +- smoketest.sh | 2 +- updatebindata.sh | 2 +- 68 files changed, 86 insertions(+), 85 deletions(-) rename {internal => cmd/ooniprobe/internal}/autorun/autorun.go (100%) rename {internal => cmd/ooniprobe/internal}/autorun/autorun_darwin.go (98%) rename {internal => cmd/ooniprobe/internal}/bindata/bindata.go (100%) rename {internal => cmd/ooniprobe/internal}/cli/app/app.go (69%) rename {internal => cmd/ooniprobe/internal}/cli/autorun/autorun.go (92%) rename {internal => cmd/ooniprobe/internal}/cli/geoip/geoip.go (85%) rename {internal => cmd/ooniprobe/internal}/cli/geoip/geoip_test.go (96%) rename {internal => cmd/ooniprobe/internal}/cli/info/info.go (86%) rename {internal => cmd/ooniprobe/internal}/cli/info/info_test.go (93%) rename {internal => cmd/ooniprobe/internal}/cli/list/list.go (95%) rename {internal => cmd/ooniprobe/internal}/cli/onboard/onboard.go (95%) rename {internal => cmd/ooniprobe/internal}/cli/reset/reset.go (92%) rename {internal => cmd/ooniprobe/internal}/cli/rm/rm.go (94%) rename {internal => cmd/ooniprobe/internal}/cli/root/root.go (84%) rename {internal => cmd/ooniprobe/internal}/cli/run/run.go (91%) rename {internal => cmd/ooniprobe/internal}/cli/show/show.go (75%) rename {internal => cmd/ooniprobe/internal}/cli/upload/upload.go (82%) rename {internal => cmd/ooniprobe/internal}/cli/version/version.go (64%) rename {internal => cmd/ooniprobe/internal}/config/parser.go (94%) rename {internal => cmd/ooniprobe/internal}/config/parser_test.go (100%) rename {internal => cmd/ooniprobe/internal}/config/settings.go (100%) rename {internal => cmd/ooniprobe/internal}/config/testdata/config-v0.json (100%) rename {internal => cmd/ooniprobe/internal}/config/testdata/valid-config.json (100%) rename {internal => cmd/ooniprobe/internal}/crashreport/crashreport.go (100%) rename {internal => cmd/ooniprobe/internal}/database/actions.go (98%) rename {internal => cmd/ooniprobe/internal}/database/actions_test.go (100%) rename {internal => cmd/ooniprobe/internal}/database/database.go (94%) rename {internal => cmd/ooniprobe/internal}/database/database_test.go (100%) rename {internal => cmd/ooniprobe/internal}/database/models.go (100%) rename {internal => cmd/ooniprobe/internal}/enginex/enginex.go (100%) rename {internal => cmd/ooniprobe/internal}/log/handlers/batch/batch.go (100%) rename {internal => cmd/ooniprobe/internal}/log/handlers/cli/cli.go (98%) rename {internal => cmd/ooniprobe/internal}/log/handlers/cli/measurements.go (98%) rename {internal => cmd/ooniprobe/internal}/log/handlers/cli/progress/progress.go (100%) rename {internal => cmd/ooniprobe/internal}/log/handlers/cli/results.go (97%) rename {internal => cmd/ooniprobe/internal}/log/handlers/syslog/syslog.c (100%) rename {internal => cmd/ooniprobe/internal}/log/handlers/syslog/syslog.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/dash.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/facebook_messenger.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/groups.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/http_header_field_manipulation.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/http_invalid_request_line.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/ndt.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/nettests.go (97%) rename {internal => cmd/ooniprobe/internal}/nettests/nettests_test.go (84%) rename {internal => cmd/ooniprobe/internal}/nettests/psiphon.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/riseupvpn.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/run.go (94%) rename {internal => cmd/ooniprobe/internal}/nettests/telegram.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/tor.go (100%) rename {internal => cmd/ooniprobe/internal}/nettests/web_connectivity.go (96%) rename {internal => cmd/ooniprobe/internal}/nettests/whatsapp.go (100%) rename {internal => cmd/ooniprobe/internal}/ooni/ooni.go (95%) rename {internal => cmd/ooniprobe/internal}/ooni/ooni_test.go (100%) rename {internal => cmd/ooniprobe/internal}/oonitest/oonitest.go (96%) rename {internal => cmd/ooniprobe/internal}/output/output.go (97%) rename {internal => cmd/ooniprobe/internal}/utils/homedir/homedir.go (100%) rename {internal => cmd/ooniprobe/internal}/utils/paths.go (97%) rename {internal => cmd/ooniprobe/internal}/utils/shutil/shutil.go (100%) rename {internal => cmd/ooniprobe/internal}/utils/util_test.go (100%) rename {internal => cmd/ooniprobe/internal}/utils/utils.go (100%) rename {internal => cmd/ooniprobe/internal}/version/version.go (100%) rename {testdata => cmd/ooniprobe/testdata}/testing-config.json (100%) diff --git a/.gitignore b/.gitignore index 916fd3f..1565ee6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/ooniprobe.exe /ooniprobe /coverage.cov /testdata/gotmp diff --git a/internal/autorun/autorun.go b/cmd/ooniprobe/internal/autorun/autorun.go similarity index 100% rename from internal/autorun/autorun.go rename to cmd/ooniprobe/internal/autorun/autorun.go diff --git a/internal/autorun/autorun_darwin.go b/cmd/ooniprobe/internal/autorun/autorun_darwin.go similarity index 98% rename from internal/autorun/autorun_darwin.go rename to cmd/ooniprobe/internal/autorun/autorun_darwin.go index 1144914..8d5aa73 100644 --- a/internal/autorun/autorun_darwin.go +++ b/cmd/ooniprobe/internal/autorun/autorun_darwin.go @@ -12,7 +12,7 @@ import ( "text/template" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" "github.com/ooni/probe-engine/cmd/jafar/shellx" "golang.org/x/sys/unix" ) diff --git a/internal/bindata/bindata.go b/cmd/ooniprobe/internal/bindata/bindata.go similarity index 100% rename from internal/bindata/bindata.go rename to cmd/ooniprobe/internal/bindata/bindata.go diff --git a/internal/cli/app/app.go b/cmd/ooniprobe/internal/cli/app/app.go similarity index 69% rename from internal/cli/app/app.go rename to cmd/ooniprobe/internal/cli/app/app.go index f3d6ec2..5530bfa 100644 --- a/internal/cli/app/app.go +++ b/cmd/ooniprobe/internal/cli/app/app.go @@ -4,8 +4,8 @@ import ( "os" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/version" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/version" ) // Run the app. This is the main app entry point diff --git a/internal/cli/autorun/autorun.go b/cmd/ooniprobe/internal/cli/autorun/autorun.go similarity index 92% rename from internal/cli/autorun/autorun.go rename to cmd/ooniprobe/internal/cli/autorun/autorun.go index 205a11f..8d32db3 100644 --- a/internal/cli/autorun/autorun.go +++ b/cmd/ooniprobe/internal/cli/autorun/autorun.go @@ -6,9 +6,9 @@ import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/autorun" - "github.com/ooni/probe-cli/internal/cli/onboard" - "github.com/ooni/probe-cli/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/autorun" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/onboard" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" ) var errNotImplemented = errors.New("autorun: not implemented on this platform") diff --git a/internal/cli/geoip/geoip.go b/cmd/ooniprobe/internal/cli/geoip/geoip.go similarity index 85% rename from internal/cli/geoip/geoip.go rename to cmd/ooniprobe/internal/cli/geoip/geoip.go index 7b653dc..d757b5c 100644 --- a/internal/cli/geoip/geoip.go +++ b/cmd/ooniprobe/internal/cli/geoip/geoip.go @@ -3,9 +3,9 @@ package geoip import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/ooni" - "github.com/ooni/probe-cli/internal/output" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/output" ) func init() { diff --git a/internal/cli/geoip/geoip_test.go b/cmd/ooniprobe/internal/cli/geoip/geoip_test.go similarity index 96% rename from internal/cli/geoip/geoip_test.go rename to cmd/ooniprobe/internal/cli/geoip/geoip_test.go index b223a22..cdcf7e2 100644 --- a/internal/cli/geoip/geoip_test.go +++ b/cmd/ooniprobe/internal/cli/geoip/geoip_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/ooni" - "github.com/ooni/probe-cli/internal/oonitest" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/oonitest" ) func TestNewProbeCLIFailed(t *testing.T) { diff --git a/internal/cli/info/info.go b/cmd/ooniprobe/internal/cli/info/info.go similarity index 86% rename from internal/cli/info/info.go rename to cmd/ooniprobe/internal/cli/info/info.go index 17cd75d..09974cd 100644 --- a/internal/cli/info/info.go +++ b/cmd/ooniprobe/internal/cli/info/info.go @@ -3,8 +3,8 @@ package info import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" ) func init() { diff --git a/internal/cli/info/info_test.go b/cmd/ooniprobe/internal/cli/info/info_test.go similarity index 93% rename from internal/cli/info/info_test.go rename to cmd/ooniprobe/internal/cli/info/info_test.go index 5339d87..99929ea 100644 --- a/internal/cli/info/info_test.go +++ b/cmd/ooniprobe/internal/cli/info/info_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/ooni" - "github.com/ooni/probe-cli/internal/oonitest" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/oonitest" ) func TestNewProbeCLIFailed(t *testing.T) { diff --git a/internal/cli/list/list.go b/cmd/ooniprobe/internal/cli/list/list.go similarity index 95% rename from internal/cli/list/list.go rename to cmd/ooniprobe/internal/cli/list/list.go index e95408c..4ade056 100644 --- a/internal/cli/list/list.go +++ b/cmd/ooniprobe/internal/cli/list/list.go @@ -3,9 +3,9 @@ package list import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/database" - "github.com/ooni/probe-cli/internal/output" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/output" ) func init() { diff --git a/internal/cli/onboard/onboard.go b/cmd/ooniprobe/internal/cli/onboard/onboard.go similarity index 95% rename from internal/cli/onboard/onboard.go rename to cmd/ooniprobe/internal/cli/onboard/onboard.go index ad16918..36fb842 100644 --- a/internal/cli/onboard/onboard.go +++ b/cmd/ooniprobe/internal/cli/onboard/onboard.go @@ -6,10 +6,10 @@ import ( "github.com/alecthomas/kingpin" "github.com/apex/log" "github.com/fatih/color" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/config" - "github.com/ooni/probe-cli/internal/ooni" - "github.com/ooni/probe-cli/internal/output" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/config" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/output" "github.com/pkg/errors" "gopkg.in/AlecAivazis/survey.v1" ) diff --git a/internal/cli/reset/reset.go b/cmd/ooniprobe/internal/cli/reset/reset.go similarity index 92% rename from internal/cli/reset/reset.go rename to cmd/ooniprobe/internal/cli/reset/reset.go index 3a9ed8c..7841303 100644 --- a/internal/cli/reset/reset.go +++ b/cmd/ooniprobe/internal/cli/reset/reset.go @@ -5,7 +5,7 @@ import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" ) func init() { diff --git a/internal/cli/rm/rm.go b/cmd/ooniprobe/internal/cli/rm/rm.go similarity index 94% rename from internal/cli/rm/rm.go rename to cmd/ooniprobe/internal/cli/rm/rm.go index b631d97..a7297bf 100644 --- a/internal/cli/rm/rm.go +++ b/cmd/ooniprobe/internal/cli/rm/rm.go @@ -6,8 +6,8 @@ import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" survey "gopkg.in/AlecAivazis/survey.v1" db "upper.io/db.v3" "upper.io/db.v3/lib/sqlbuilder" diff --git a/internal/cli/root/root.go b/cmd/ooniprobe/internal/cli/root/root.go similarity index 84% rename from internal/cli/root/root.go rename to cmd/ooniprobe/internal/cli/root/root.go index a7f9954..642c01b 100644 --- a/internal/cli/root/root.go +++ b/cmd/ooniprobe/internal/cli/root/root.go @@ -3,12 +3,12 @@ package root import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/log/handlers/batch" - "github.com/ooni/probe-cli/internal/log/handlers/cli" - "github.com/ooni/probe-cli/internal/log/handlers/syslog" - "github.com/ooni/probe-cli/internal/ooni" - "github.com/ooni/probe-cli/internal/utils" - "github.com/ooni/probe-cli/internal/version" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/log/handlers/batch" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/log/handlers/cli" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/log/handlers/syslog" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/version" ) // Cmd is the root command diff --git a/internal/cli/run/run.go b/cmd/ooniprobe/internal/cli/run/run.go similarity index 91% rename from internal/cli/run/run.go rename to cmd/ooniprobe/internal/cli/run/run.go index f465d79..49d773f 100644 --- a/internal/cli/run/run.go +++ b/cmd/ooniprobe/internal/cli/run/run.go @@ -6,10 +6,10 @@ import ( "github.com/alecthomas/kingpin" "github.com/apex/log" "github.com/fatih/color" - "github.com/ooni/probe-cli/internal/cli/onboard" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/nettests" - "github.com/ooni/probe-cli/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/onboard" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/nettests" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" ) func init() { diff --git a/internal/cli/show/show.go b/cmd/ooniprobe/internal/cli/show/show.go similarity index 75% rename from internal/cli/show/show.go rename to cmd/ooniprobe/internal/cli/show/show.go index bff94a0..4db420b 100644 --- a/internal/cli/show/show.go +++ b/cmd/ooniprobe/internal/cli/show/show.go @@ -3,9 +3,9 @@ package nettest import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/database" - "github.com/ooni/probe-cli/internal/output" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/output" ) func init() { diff --git a/internal/cli/upload/upload.go b/cmd/ooniprobe/internal/cli/upload/upload.go similarity index 82% rename from internal/cli/upload/upload.go rename to cmd/ooniprobe/internal/cli/upload/upload.go index 42a70f4..c7ef32e 100644 --- a/internal/cli/upload/upload.go +++ b/cmd/ooniprobe/internal/cli/upload/upload.go @@ -3,7 +3,7 @@ package upload import ( "github.com/alecthomas/kingpin" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" ) func init() { diff --git a/internal/cli/version/version.go b/cmd/ooniprobe/internal/cli/version/version.go similarity index 64% rename from internal/cli/version/version.go rename to cmd/ooniprobe/internal/cli/version/version.go index 897678c..14d5d8a 100644 --- a/internal/cli/version/version.go +++ b/cmd/ooniprobe/internal/cli/version/version.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/alecthomas/kingpin" - "github.com/ooni/probe-cli/internal/cli/root" - "github.com/ooni/probe-cli/internal/version" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/version" ) func init() { diff --git a/internal/config/parser.go b/cmd/ooniprobe/internal/config/parser.go similarity index 94% rename from internal/config/parser.go rename to cmd/ooniprobe/internal/config/parser.go index c8f99e1..6d9fff6 100644 --- a/internal/config/parser.go +++ b/cmd/ooniprobe/internal/config/parser.go @@ -6,8 +6,8 @@ import ( "sync" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/crashreport" - "github.com/ooni/probe-cli/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/crashreport" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" "github.com/pkg/errors" ) diff --git a/internal/config/parser_test.go b/cmd/ooniprobe/internal/config/parser_test.go similarity index 100% rename from internal/config/parser_test.go rename to cmd/ooniprobe/internal/config/parser_test.go diff --git a/internal/config/settings.go b/cmd/ooniprobe/internal/config/settings.go similarity index 100% rename from internal/config/settings.go rename to cmd/ooniprobe/internal/config/settings.go diff --git a/internal/config/testdata/config-v0.json b/cmd/ooniprobe/internal/config/testdata/config-v0.json similarity index 100% rename from internal/config/testdata/config-v0.json rename to cmd/ooniprobe/internal/config/testdata/config-v0.json diff --git a/internal/config/testdata/valid-config.json b/cmd/ooniprobe/internal/config/testdata/valid-config.json similarity index 100% rename from internal/config/testdata/valid-config.json rename to cmd/ooniprobe/internal/config/testdata/valid-config.json diff --git a/internal/crashreport/crashreport.go b/cmd/ooniprobe/internal/crashreport/crashreport.go similarity index 100% rename from internal/crashreport/crashreport.go rename to cmd/ooniprobe/internal/crashreport/crashreport.go diff --git a/internal/database/actions.go b/cmd/ooniprobe/internal/database/actions.go similarity index 98% rename from internal/database/actions.go rename to cmd/ooniprobe/internal/database/actions.go index cbd20cc..8ec6fe0 100644 --- a/internal/database/actions.go +++ b/cmd/ooniprobe/internal/database/actions.go @@ -13,8 +13,8 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/enginex" - "github.com/ooni/probe-cli/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/enginex" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" "github.com/pkg/errors" db "upper.io/db.v3" "upper.io/db.v3/lib/sqlbuilder" diff --git a/internal/database/actions_test.go b/cmd/ooniprobe/internal/database/actions_test.go similarity index 100% rename from internal/database/actions_test.go rename to cmd/ooniprobe/internal/database/actions_test.go diff --git a/internal/database/database.go b/cmd/ooniprobe/internal/database/database.go similarity index 94% rename from internal/database/database.go rename to cmd/ooniprobe/internal/database/database.go index 02aca18..b5e349d 100644 --- a/internal/database/database.go +++ b/cmd/ooniprobe/internal/database/database.go @@ -4,7 +4,7 @@ import ( "database/sql" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/bindata" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/bindata" migrate "github.com/rubenv/sql-migrate" "upper.io/db.v3/lib/sqlbuilder" "upper.io/db.v3/sqlite" diff --git a/internal/database/database_test.go b/cmd/ooniprobe/internal/database/database_test.go similarity index 100% rename from internal/database/database_test.go rename to cmd/ooniprobe/internal/database/database_test.go diff --git a/internal/database/models.go b/cmd/ooniprobe/internal/database/models.go similarity index 100% rename from internal/database/models.go rename to cmd/ooniprobe/internal/database/models.go diff --git a/internal/enginex/enginex.go b/cmd/ooniprobe/internal/enginex/enginex.go similarity index 100% rename from internal/enginex/enginex.go rename to cmd/ooniprobe/internal/enginex/enginex.go diff --git a/internal/log/handlers/batch/batch.go b/cmd/ooniprobe/internal/log/handlers/batch/batch.go similarity index 100% rename from internal/log/handlers/batch/batch.go rename to cmd/ooniprobe/internal/log/handlers/batch/batch.go diff --git a/internal/log/handlers/cli/cli.go b/cmd/ooniprobe/internal/log/handlers/cli/cli.go similarity index 98% rename from internal/log/handlers/cli/cli.go rename to cmd/ooniprobe/internal/log/handlers/cli/cli.go index b9cfafe..bd34346 100644 --- a/internal/log/handlers/cli/cli.go +++ b/cmd/ooniprobe/internal/log/handlers/cli/cli.go @@ -11,7 +11,7 @@ import ( "github.com/apex/log" "github.com/fatih/color" colorable "github.com/mattn/go-colorable" - "github.com/ooni/probe-cli/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" ) // Default handler outputting to stderr. diff --git a/internal/log/handlers/cli/measurements.go b/cmd/ooniprobe/internal/log/handlers/cli/measurements.go similarity index 98% rename from internal/log/handlers/cli/measurements.go rename to cmd/ooniprobe/internal/log/handlers/cli/measurements.go index 86e488d..8d74aca 100644 --- a/internal/log/handlers/cli/measurements.go +++ b/cmd/ooniprobe/internal/log/handlers/cli/measurements.go @@ -9,7 +9,7 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" ) func statusIcon(ok bool) string { diff --git a/internal/log/handlers/cli/progress/progress.go b/cmd/ooniprobe/internal/log/handlers/cli/progress/progress.go similarity index 100% rename from internal/log/handlers/cli/progress/progress.go rename to cmd/ooniprobe/internal/log/handlers/cli/progress/progress.go diff --git a/internal/log/handlers/cli/results.go b/cmd/ooniprobe/internal/log/handlers/cli/results.go similarity index 97% rename from internal/log/handlers/cli/results.go rename to cmd/ooniprobe/internal/log/handlers/cli/results.go index 87b5a47..09ca641 100644 --- a/internal/log/handlers/cli/results.go +++ b/cmd/ooniprobe/internal/log/handlers/cli/results.go @@ -8,8 +8,8 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/database" - "github.com/ooni/probe-cli/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" ) func formatSpeed(speed float64) string { diff --git a/internal/log/handlers/syslog/syslog.c b/cmd/ooniprobe/internal/log/handlers/syslog/syslog.c similarity index 100% rename from internal/log/handlers/syslog/syslog.c rename to cmd/ooniprobe/internal/log/handlers/syslog/syslog.c diff --git a/internal/log/handlers/syslog/syslog.go b/cmd/ooniprobe/internal/log/handlers/syslog/syslog.go similarity index 100% rename from internal/log/handlers/syslog/syslog.go rename to cmd/ooniprobe/internal/log/handlers/syslog/syslog.go diff --git a/internal/nettests/dash.go b/cmd/ooniprobe/internal/nettests/dash.go similarity index 100% rename from internal/nettests/dash.go rename to cmd/ooniprobe/internal/nettests/dash.go diff --git a/internal/nettests/facebook_messenger.go b/cmd/ooniprobe/internal/nettests/facebook_messenger.go similarity index 100% rename from internal/nettests/facebook_messenger.go rename to cmd/ooniprobe/internal/nettests/facebook_messenger.go diff --git a/internal/nettests/groups.go b/cmd/ooniprobe/internal/nettests/groups.go similarity index 100% rename from internal/nettests/groups.go rename to cmd/ooniprobe/internal/nettests/groups.go diff --git a/internal/nettests/http_header_field_manipulation.go b/cmd/ooniprobe/internal/nettests/http_header_field_manipulation.go similarity index 100% rename from internal/nettests/http_header_field_manipulation.go rename to cmd/ooniprobe/internal/nettests/http_header_field_manipulation.go diff --git a/internal/nettests/http_invalid_request_line.go b/cmd/ooniprobe/internal/nettests/http_invalid_request_line.go similarity index 100% rename from internal/nettests/http_invalid_request_line.go rename to cmd/ooniprobe/internal/nettests/http_invalid_request_line.go diff --git a/internal/nettests/ndt.go b/cmd/ooniprobe/internal/nettests/ndt.go similarity index 100% rename from internal/nettests/ndt.go rename to cmd/ooniprobe/internal/nettests/ndt.go diff --git a/internal/nettests/nettests.go b/cmd/ooniprobe/internal/nettests/nettests.go similarity index 97% rename from internal/nettests/nettests.go rename to cmd/ooniprobe/internal/nettests/nettests.go index f8bb12a..9171517 100644 --- a/internal/nettests/nettests.go +++ b/cmd/ooniprobe/internal/nettests/nettests.go @@ -7,9 +7,9 @@ import ( "github.com/apex/log" "github.com/fatih/color" - "github.com/ooni/probe-cli/internal/database" - "github.com/ooni/probe-cli/internal/ooni" - "github.com/ooni/probe-cli/internal/output" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/output" engine "github.com/ooni/probe-engine" "github.com/ooni/probe-engine/model" "github.com/pkg/errors" diff --git a/internal/nettests/nettests_test.go b/cmd/ooniprobe/internal/nettests/nettests_test.go similarity index 84% rename from internal/nettests/nettests_test.go rename to cmd/ooniprobe/internal/nettests/nettests_test.go index ac8e8c4..cfe240a 100644 --- a/internal/nettests/nettests_test.go +++ b/cmd/ooniprobe/internal/nettests/nettests_test.go @@ -5,9 +5,9 @@ import ( "path" "testing" - "github.com/ooni/probe-cli/internal/database" - "github.com/ooni/probe-cli/internal/ooni" - "github.com/ooni/probe-cli/internal/utils/shutil" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils/shutil" ) func newOONIProbe(t *testing.T) *ooni.Probe { diff --git a/internal/nettests/psiphon.go b/cmd/ooniprobe/internal/nettests/psiphon.go similarity index 100% rename from internal/nettests/psiphon.go rename to cmd/ooniprobe/internal/nettests/psiphon.go diff --git a/internal/nettests/riseupvpn.go b/cmd/ooniprobe/internal/nettests/riseupvpn.go similarity index 100% rename from internal/nettests/riseupvpn.go rename to cmd/ooniprobe/internal/nettests/riseupvpn.go diff --git a/internal/nettests/run.go b/cmd/ooniprobe/internal/nettests/run.go similarity index 94% rename from internal/nettests/run.go rename to cmd/ooniprobe/internal/nettests/run.go index 885adb9..ca92692 100644 --- a/internal/nettests/run.go +++ b/cmd/ooniprobe/internal/nettests/run.go @@ -2,8 +2,8 @@ package nettests import ( "github.com/apex/log" - "github.com/ooni/probe-cli/internal/database" - "github.com/ooni/probe-cli/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" "github.com/pkg/errors" ) diff --git a/internal/nettests/telegram.go b/cmd/ooniprobe/internal/nettests/telegram.go similarity index 100% rename from internal/nettests/telegram.go rename to cmd/ooniprobe/internal/nettests/telegram.go diff --git a/internal/nettests/tor.go b/cmd/ooniprobe/internal/nettests/tor.go similarity index 100% rename from internal/nettests/tor.go rename to cmd/ooniprobe/internal/nettests/tor.go diff --git a/internal/nettests/web_connectivity.go b/cmd/ooniprobe/internal/nettests/web_connectivity.go similarity index 96% rename from internal/nettests/web_connectivity.go rename to cmd/ooniprobe/internal/nettests/web_connectivity.go index 9cd5a41..7bedc45 100644 --- a/internal/nettests/web_connectivity.go +++ b/cmd/ooniprobe/internal/nettests/web_connectivity.go @@ -4,7 +4,7 @@ import ( "context" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" engine "github.com/ooni/probe-engine" ) diff --git a/internal/nettests/whatsapp.go b/cmd/ooniprobe/internal/nettests/whatsapp.go similarity index 100% rename from internal/nettests/whatsapp.go rename to cmd/ooniprobe/internal/nettests/whatsapp.go diff --git a/internal/ooni/ooni.go b/cmd/ooniprobe/internal/ooni/ooni.go similarity index 95% rename from internal/ooni/ooni.go rename to cmd/ooniprobe/internal/ooni/ooni.go index f77c515..5ba3489 100644 --- a/internal/ooni/ooni.go +++ b/cmd/ooniprobe/internal/ooni/ooni.go @@ -8,11 +8,11 @@ import ( "syscall" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/bindata" - "github.com/ooni/probe-cli/internal/config" - "github.com/ooni/probe-cli/internal/database" - "github.com/ooni/probe-cli/internal/enginex" - "github.com/ooni/probe-cli/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/bindata" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/config" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/enginex" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" engine "github.com/ooni/probe-engine" "github.com/pkg/errors" "upper.io/db.v3/lib/sqlbuilder" diff --git a/internal/ooni/ooni_test.go b/cmd/ooniprobe/internal/ooni/ooni_test.go similarity index 100% rename from internal/ooni/ooni_test.go rename to cmd/ooniprobe/internal/ooni/ooni_test.go diff --git a/internal/oonitest/oonitest.go b/cmd/ooniprobe/internal/oonitest/oonitest.go similarity index 96% rename from internal/oonitest/oonitest.go rename to cmd/ooniprobe/internal/oonitest/oonitest.go index 7fa2abe..5483171 100644 --- a/internal/oonitest/oonitest.go +++ b/cmd/ooniprobe/internal/oonitest/oonitest.go @@ -5,8 +5,8 @@ import ( "sync" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/config" - "github.com/ooni/probe-cli/internal/ooni" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/config" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" "upper.io/db.v3/lib/sqlbuilder" ) diff --git a/internal/output/output.go b/cmd/ooniprobe/internal/output/output.go similarity index 97% rename from internal/output/output.go rename to cmd/ooniprobe/internal/output/output.go index 824a1e2..26ea0d5 100644 --- a/internal/output/output.go +++ b/cmd/ooniprobe/internal/output/output.go @@ -7,8 +7,8 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/internal/database" - "github.com/ooni/probe-cli/internal/utils" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" ) // MeasurementJSON prints the JSON of a measurement diff --git a/internal/utils/homedir/homedir.go b/cmd/ooniprobe/internal/utils/homedir/homedir.go similarity index 100% rename from internal/utils/homedir/homedir.go rename to cmd/ooniprobe/internal/utils/homedir/homedir.go diff --git a/internal/utils/paths.go b/cmd/ooniprobe/internal/utils/paths.go similarity index 97% rename from internal/utils/paths.go rename to cmd/ooniprobe/internal/utils/paths.go index 568c455..7d7db8e 100644 --- a/internal/utils/paths.go +++ b/cmd/ooniprobe/internal/utils/paths.go @@ -7,7 +7,7 @@ import ( "path/filepath" "time" - "github.com/ooni/probe-cli/internal/utils/homedir" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils/homedir" ) // RequiredDirs returns the required ooni home directories diff --git a/internal/utils/shutil/shutil.go b/cmd/ooniprobe/internal/utils/shutil/shutil.go similarity index 100% rename from internal/utils/shutil/shutil.go rename to cmd/ooniprobe/internal/utils/shutil/shutil.go diff --git a/internal/utils/util_test.go b/cmd/ooniprobe/internal/utils/util_test.go similarity index 100% rename from internal/utils/util_test.go rename to cmd/ooniprobe/internal/utils/util_test.go diff --git a/internal/utils/utils.go b/cmd/ooniprobe/internal/utils/utils.go similarity index 100% rename from internal/utils/utils.go rename to cmd/ooniprobe/internal/utils/utils.go diff --git a/internal/version/version.go b/cmd/ooniprobe/internal/version/version.go similarity index 100% rename from internal/version/version.go rename to cmd/ooniprobe/internal/version/version.go diff --git a/cmd/ooniprobe/main.go b/cmd/ooniprobe/main.go index acbe1fc..3102ddb 100644 --- a/cmd/ooniprobe/main.go +++ b/cmd/ooniprobe/main.go @@ -2,19 +2,19 @@ package main import ( "github.com/apex/log" - "github.com/ooni/probe-cli/internal/cli/app" - _ "github.com/ooni/probe-cli/internal/cli/autorun" - _ "github.com/ooni/probe-cli/internal/cli/geoip" - _ "github.com/ooni/probe-cli/internal/cli/info" - _ "github.com/ooni/probe-cli/internal/cli/list" - _ "github.com/ooni/probe-cli/internal/cli/onboard" - _ "github.com/ooni/probe-cli/internal/cli/reset" - _ "github.com/ooni/probe-cli/internal/cli/rm" - _ "github.com/ooni/probe-cli/internal/cli/run" - _ "github.com/ooni/probe-cli/internal/cli/show" - _ "github.com/ooni/probe-cli/internal/cli/upload" - _ "github.com/ooni/probe-cli/internal/cli/version" - "github.com/ooni/probe-cli/internal/crashreport" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/app" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/autorun" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/geoip" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/info" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/list" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/onboard" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/reset" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/rm" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/run" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/show" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/upload" + _ "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/version" + "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/crashreport" ) func main() { diff --git a/testdata/testing-config.json b/cmd/ooniprobe/testdata/testing-config.json similarity index 100% rename from testdata/testing-config.json rename to cmd/ooniprobe/testdata/testing-config.json diff --git a/go.mod b/go.mod index dd7a386..e0742b8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/ooni/probe-cli +module github.com/ooni/probe-cli/v3 go 1.14 diff --git a/smoketest.sh b/smoketest.sh index 03dc1f1..e182d64 100755 --- a/smoketest.sh +++ b/smoketest.sh @@ -6,4 +6,4 @@ if [ "$#" != 1 ]; then fi $1 onboard --yes # Important! DO NOT run performance from CI b/c it will overload m-lab servers -$1 run websites --config testdata/testing-config.json -v --no-collector +$1 run websites --config cmd/ooniprobe/testdata/testing-config.json -v --no-collector diff --git a/updatebindata.sh b/updatebindata.sh index e98fd3e..7bce7ab 100755 --- a/updatebindata.sh +++ b/updatebindata.sh @@ -7,4 +7,4 @@ if [ "$version" != "4.0.0" ]; then echo "FATAL: unexpected go-bindata version" 1>&2 exit 1 fi -$gobindata -nometadata -o internal/bindata/bindata.go -pkg bindata data/... +$gobindata -nometadata -o cmd/ooniprobe/internal/bindata/bindata.go -pkg bindata data/...