diff --git a/.gitignore b/.gitignore index 916fd3f26d..1565ee669c 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 1144914299..8d5aa73f11 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 f3d6ec2888..5530bfa21d 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 205a11f3e1..8d32db3fdb 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 7b653dc7d0..d757b5c29d 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 b223a22f43..cdcf7e264c 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 17cd75d28d..09974cdcb7 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 5339d8772e..99929eadd9 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 e95408c11f..4ade0560b1 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 ad1691897a..36fb842688 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 3a9ed8c711..78413032b5 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 b631d9757b..a7297bfffc 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 a7f9954fea..642c01b82c 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 f465d79b19..49d773fb0e 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 bff94a075c..4db420b96c 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 42a70f4d5d..c7ef32ef7b 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 897678c21c..14d5d8a479 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 c8f99e1e57..6d9fff6058 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 cbd20ccb91..8ec6fe0fa4 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 02aca186fd..b5e349d72e 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 b9cfafe403..bd3434644a 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 86e488dd64..8d74aca2db 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 87b5a476e9..09ca641e34 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 f8bb12a4b7..9171517f84 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 ac8e8c40d1..cfe240a69f 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 885adb9e11..ca92692725 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 9cd5a41347..7bedc452c8 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 f77c51526f..5ba3489a49 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 7fa2abe7c0..54831716d7 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 824a1e25b3..26ea0d5ea4 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 568c455403..7d7db8ef27 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 acbe1fc1f6..3102ddb722 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 dd7a3863fb..e0742b8cc8 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 03dc1f1e48..e182d64eb3 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 e98fd3e4ba..7bce7ab604 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/...