diff --git a/.gitignore b/.gitignore index 8e8da87..f57e825 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,15 @@ /*.jsonl /*.tar.gz /*.zip +/apitool +/apitool.exe /coverage.cov /miniooni /miniooni.exe +/oohelper +/oohelper.exe +/oohelperd +/oohelperd.exe /ooniprobe /ooniprobe.exe /ooniprobe_checksums.txt diff --git a/cmd/ooniprobe/internal/autorun/autorun_darwin.go b/cmd/ooniprobe/internal/autorun/autorun_darwin.go index 805a32a..4c0c424 100644 --- a/cmd/ooniprobe/internal/autorun/autorun_darwin.go +++ b/cmd/ooniprobe/internal/autorun/autorun_darwin.go @@ -13,7 +13,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" "golang.org/x/sys/unix" ) diff --git a/internal/cmd/README.md b/internal/cmd/README.md new file mode 100644 index 0000000..827f2ad --- /dev/null +++ b/internal/cmd/README.md @@ -0,0 +1,4 @@ +# Directory github.com/ooni/probe-cli/internal/cmd + +This directory contains the source code for the CLI tools we build +but we don't want to expose to the outside world. diff --git a/internal/engine/cmd/apitool/README.md b/internal/cmd/apitool/README.md similarity index 100% rename from internal/engine/cmd/apitool/README.md rename to internal/cmd/apitool/README.md diff --git a/internal/engine/cmd/apitool/main.go b/internal/cmd/apitool/main.go similarity index 95% rename from internal/engine/cmd/apitool/main.go rename to internal/cmd/apitool/main.go index 8db01af..d2762dd 100644 --- a/internal/engine/cmd/apitool/main.go +++ b/internal/cmd/apitool/main.go @@ -17,8 +17,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/engine/version" diff --git a/internal/engine/cmd/apitool/main_test.go b/internal/cmd/apitool/main_test.go similarity index 100% rename from internal/engine/cmd/apitool/main_test.go rename to internal/cmd/apitool/main_test.go diff --git a/internal/cmd/jafar/.gitignore b/internal/cmd/jafar/.gitignore new file mode 100644 index 0000000..8e4647b --- /dev/null +++ b/internal/cmd/jafar/.gitignore @@ -0,0 +1 @@ +/badproxy.pem diff --git a/internal/engine/cmd/jafar/README.md b/internal/cmd/jafar/README.md similarity index 100% rename from internal/engine/cmd/jafar/README.md rename to internal/cmd/jafar/README.md diff --git a/internal/engine/cmd/jafar/badproxy/badproxy.go b/internal/cmd/jafar/badproxy/badproxy.go similarity index 100% rename from internal/engine/cmd/jafar/badproxy/badproxy.go rename to internal/cmd/jafar/badproxy/badproxy.go diff --git a/internal/engine/cmd/jafar/badproxy/badproxy_test.go b/internal/cmd/jafar/badproxy/badproxy_test.go similarity index 100% rename from internal/engine/cmd/jafar/badproxy/badproxy_test.go rename to internal/cmd/jafar/badproxy/badproxy_test.go diff --git a/internal/engine/cmd/jafar/flagx/stringarray.go b/internal/cmd/jafar/flagx/stringarray.go similarity index 100% rename from internal/engine/cmd/jafar/flagx/stringarray.go rename to internal/cmd/jafar/flagx/stringarray.go diff --git a/internal/engine/cmd/jafar/flagx/stringarray_test.go b/internal/cmd/jafar/flagx/stringarray_test.go similarity index 96% rename from internal/engine/cmd/jafar/flagx/stringarray_test.go rename to internal/cmd/jafar/flagx/stringarray_test.go index f605ca6..256d1ed 100644 --- a/internal/engine/cmd/jafar/flagx/stringarray_test.go +++ b/internal/cmd/jafar/flagx/stringarray_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/flagx" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/flagx" ) func TestStringArray(t *testing.T) { diff --git a/internal/engine/cmd/jafar/httpproxy/httpproxy.go b/internal/cmd/jafar/httpproxy/httpproxy.go similarity index 100% rename from internal/engine/cmd/jafar/httpproxy/httpproxy.go rename to internal/cmd/jafar/httpproxy/httpproxy.go diff --git a/internal/engine/cmd/jafar/httpproxy/httpproxy_test.go b/internal/cmd/jafar/httpproxy/httpproxy_test.go similarity index 97% rename from internal/engine/cmd/jafar/httpproxy/httpproxy_test.go rename to internal/cmd/jafar/httpproxy/httpproxy_test.go index db1849b..8318ade 100644 --- a/internal/engine/cmd/jafar/httpproxy/httpproxy_test.go +++ b/internal/cmd/jafar/httpproxy/httpproxy_test.go @@ -8,7 +8,7 @@ import ( "net/http" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" ) func TestPass(t *testing.T) { diff --git a/internal/engine/cmd/jafar/iptables/iptables.go b/internal/cmd/jafar/iptables/iptables.go similarity index 100% rename from internal/engine/cmd/jafar/iptables/iptables.go rename to internal/cmd/jafar/iptables/iptables.go diff --git a/internal/engine/cmd/jafar/iptables/iptables_integration_test.go b/internal/cmd/jafar/iptables/iptables_integration_test.go similarity index 97% rename from internal/engine/cmd/jafar/iptables/iptables_integration_test.go rename to internal/cmd/jafar/iptables/iptables_integration_test.go index afdef2a..13c73ac 100644 --- a/internal/engine/cmd/jafar/iptables/iptables_integration_test.go +++ b/internal/cmd/jafar/iptables/iptables_integration_test.go @@ -14,9 +14,9 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/resolver" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/resolver" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" ) func init() { diff --git a/internal/engine/cmd/jafar/iptables/iptables_linux.go b/internal/cmd/jafar/iptables/iptables_linux.go similarity index 98% rename from internal/engine/cmd/jafar/iptables/iptables_linux.go rename to internal/cmd/jafar/iptables/iptables_linux.go index 7f53f3b..058c9b6 100644 --- a/internal/engine/cmd/jafar/iptables/iptables_linux.go +++ b/internal/cmd/jafar/iptables/iptables_linux.go @@ -3,8 +3,8 @@ package iptables import ( - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" ) type linuxShell struct{} diff --git a/internal/engine/cmd/jafar/iptables/iptables_unsupported.go b/internal/cmd/jafar/iptables/iptables_unsupported.go similarity index 100% rename from internal/engine/cmd/jafar/iptables/iptables_unsupported.go rename to internal/cmd/jafar/iptables/iptables_unsupported.go diff --git a/internal/engine/cmd/jafar/main.go b/internal/cmd/jafar/main.go similarity index 93% rename from internal/engine/cmd/jafar/main.go rename to internal/cmd/jafar/main.go index a1404bc..514df4f 100644 --- a/internal/engine/cmd/jafar/main.go +++ b/internal/cmd/jafar/main.go @@ -18,15 +18,15 @@ import ( "github.com/apex/log" "github.com/apex/log/handlers/cli" "github.com/miekg/dns" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/badproxy" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/flagx" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/httpproxy" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/iptables" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/resolver" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/tlsproxy" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/badproxy" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/flagx" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/httpproxy" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/iptables" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/resolver" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/tlsproxy" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" ) var ( diff --git a/internal/engine/cmd/jafar/main_test.go b/internal/cmd/jafar/main_test.go similarity index 92% rename from internal/engine/cmd/jafar/main_test.go rename to internal/cmd/jafar/main_test.go index 49c6f29..5c356f1 100644 --- a/internal/engine/cmd/jafar/main_test.go +++ b/internal/cmd/jafar/main_test.go @@ -6,8 +6,8 @@ import ( "runtime" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/iptables" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/iptables" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" ) func ensureWeStartOverWithIPTables() { diff --git a/internal/engine/cmd/jafar/resolver/resolver.go b/internal/cmd/jafar/resolver/resolver.go similarity index 100% rename from internal/engine/cmd/jafar/resolver/resolver.go rename to internal/cmd/jafar/resolver/resolver.go diff --git a/internal/engine/cmd/jafar/resolver/resolver_test.go b/internal/cmd/jafar/resolver/resolver_test.go similarity index 98% rename from internal/engine/cmd/jafar/resolver/resolver_test.go rename to internal/cmd/jafar/resolver/resolver_test.go index 254aaa3..1d363ec 100644 --- a/internal/engine/cmd/jafar/resolver/resolver_test.go +++ b/internal/cmd/jafar/resolver/resolver_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/miekg/dns" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" ) func TestPass(t *testing.T) { diff --git a/internal/engine/cmd/jafar/tlsproxy/tlsproxy.go b/internal/cmd/jafar/tlsproxy/tlsproxy.go similarity index 100% rename from internal/engine/cmd/jafar/tlsproxy/tlsproxy.go rename to internal/cmd/jafar/tlsproxy/tlsproxy.go diff --git a/internal/engine/cmd/jafar/tlsproxy/tlsproxy_test.go b/internal/cmd/jafar/tlsproxy/tlsproxy_test.go similarity index 98% rename from internal/engine/cmd/jafar/tlsproxy/tlsproxy_test.go rename to internal/cmd/jafar/tlsproxy/tlsproxy_test.go index f7b1e38..5282ed9 100644 --- a/internal/engine/cmd/jafar/tlsproxy/tlsproxy_test.go +++ b/internal/cmd/jafar/tlsproxy/tlsproxy_test.go @@ -7,7 +7,7 @@ import ( "sync" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" ) func TestPass(t *testing.T) { diff --git a/internal/engine/cmd/jafar/uncensored/uncensored.go b/internal/cmd/jafar/uncensored/uncensored.go similarity index 100% rename from internal/engine/cmd/jafar/uncensored/uncensored.go rename to internal/cmd/jafar/uncensored/uncensored.go diff --git a/internal/engine/cmd/jafar/uncensored/uncensored_test.go b/internal/cmd/jafar/uncensored/uncensored_test.go similarity index 100% rename from internal/engine/cmd/jafar/uncensored/uncensored_test.go rename to internal/cmd/jafar/uncensored/uncensored_test.go diff --git a/internal/engine/cmd/oohelper/README.md b/internal/cmd/oohelper/README.md similarity index 100% rename from internal/engine/cmd/oohelper/README.md rename to internal/cmd/oohelper/README.md diff --git a/internal/engine/cmd/oohelper/internal/client.go b/internal/cmd/oohelper/internal/client.go similarity index 98% rename from internal/engine/cmd/oohelper/internal/client.go rename to internal/cmd/oohelper/internal/client.go index 10160f8..7da96d9 100644 --- a/internal/engine/cmd/oohelper/internal/client.go +++ b/internal/cmd/oohelper/internal/client.go @@ -13,7 +13,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/webconnectivity" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/version" diff --git a/internal/engine/cmd/oohelper/internal/client_test.go b/internal/cmd/oohelper/internal/client_test.go similarity index 99% rename from internal/engine/cmd/oohelper/internal/client_test.go rename to internal/cmd/oohelper/internal/client_test.go index bace44a..f663408 100644 --- a/internal/engine/cmd/oohelper/internal/client_test.go +++ b/internal/cmd/oohelper/internal/client_test.go @@ -8,7 +8,7 @@ import ( "reflect" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelper/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelper/internal" ) func TestMakeTCPEndpoints(t *testing.T) { diff --git a/internal/engine/cmd/oohelper/internal/fake_test.go b/internal/cmd/oohelper/internal/fake_test.go similarity index 100% rename from internal/engine/cmd/oohelper/internal/fake_test.go rename to internal/cmd/oohelper/internal/fake_test.go diff --git a/internal/engine/cmd/oohelper/oohelper.go b/internal/cmd/oohelper/oohelper.go similarity index 95% rename from internal/engine/cmd/oohelper/oohelper.go rename to internal/cmd/oohelper/oohelper.go index 38376c6..c63620c 100644 --- a/internal/engine/cmd/oohelper/oohelper.go +++ b/internal/cmd/oohelper/oohelper.go @@ -10,7 +10,7 @@ import ( "net/http" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelper/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelper/internal" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" ) diff --git a/internal/engine/cmd/oohelper/oohelper_test.go b/internal/cmd/oohelper/oohelper_test.go similarity index 100% rename from internal/engine/cmd/oohelper/oohelper_test.go rename to internal/cmd/oohelper/oohelper_test.go diff --git a/internal/engine/cmd/oohelperd/README.md b/internal/cmd/oohelperd/README.md similarity index 100% rename from internal/engine/cmd/oohelperd/README.md rename to internal/cmd/oohelperd/README.md diff --git a/internal/engine/cmd/oohelperd/internal/dns.go b/internal/cmd/oohelperd/internal/dns.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/dns.go rename to internal/cmd/oohelperd/internal/dns.go diff --git a/internal/engine/cmd/oohelperd/internal/fake_test.go b/internal/cmd/oohelperd/internal/fake_test.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/fake_test.go rename to internal/cmd/oohelperd/internal/fake_test.go diff --git a/internal/engine/cmd/oohelperd/internal/http.go b/internal/cmd/oohelperd/internal/http.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/http.go rename to internal/cmd/oohelperd/internal/http.go diff --git a/internal/engine/cmd/oohelperd/internal/http_test.go b/internal/cmd/oohelperd/internal/http_test.go similarity index 95% rename from internal/engine/cmd/oohelperd/internal/http_test.go rename to internal/cmd/oohelperd/internal/http_test.go index 8022079..cca2d47 100644 --- a/internal/engine/cmd/oohelperd/internal/http_test.go +++ b/internal/cmd/oohelperd/internal/http_test.go @@ -8,7 +8,7 @@ import ( "sync" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelperd/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelperd/internal" ) func TestHTTPDoWithInvalidURL(t *testing.T) { diff --git a/internal/engine/cmd/oohelperd/internal/internal.go b/internal/cmd/oohelperd/internal/internal.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/internal.go rename to internal/cmd/oohelperd/internal/internal.go diff --git a/internal/engine/cmd/oohelperd/internal/internal_test.go b/internal/cmd/oohelperd/internal/internal_test.go similarity index 98% rename from internal/engine/cmd/oohelperd/internal/internal_test.go rename to internal/cmd/oohelperd/internal/internal_test.go index b7bdecb..1064f24 100644 --- a/internal/engine/cmd/oohelperd/internal/internal_test.go +++ b/internal/cmd/oohelperd/internal/internal_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelperd/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelperd/internal" "github.com/ooni/probe-cli/v3/internal/engine/netx/resolver" ) diff --git a/internal/engine/cmd/oohelperd/internal/measure.go b/internal/cmd/oohelperd/internal/measure.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/measure.go rename to internal/cmd/oohelperd/internal/measure.go diff --git a/internal/engine/cmd/oohelperd/internal/tcpconnect.go b/internal/cmd/oohelperd/internal/tcpconnect.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/tcpconnect.go rename to internal/cmd/oohelperd/internal/tcpconnect.go diff --git a/internal/engine/cmd/oohelperd/oohelperd.go b/internal/cmd/oohelperd/oohelperd.go similarity index 95% rename from internal/engine/cmd/oohelperd/oohelperd.go rename to internal/cmd/oohelperd/oohelperd.go index 48bc3c7..6b95ce0 100644 --- a/internal/engine/cmd/oohelperd/oohelperd.go +++ b/internal/cmd/oohelperd/oohelperd.go @@ -9,7 +9,7 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelperd/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelperd/internal" "github.com/ooni/probe-cli/v3/internal/engine/netx" ) diff --git a/internal/engine/cmd/oohelperd/oohelperd_test.go b/internal/cmd/oohelperd/oohelperd_test.go similarity index 100% rename from internal/engine/cmd/oohelperd/oohelperd_test.go rename to internal/cmd/oohelperd/oohelperd_test.go diff --git a/internal/engine/.gitignore b/internal/engine/.gitignore index 3757255..4969276 100644 --- a/internal/engine/.gitignore +++ b/internal/engine/.gitignore @@ -2,9 +2,7 @@ /.vscode /apitool /asn.mmdb -/badproxy.pem /ca-bundle.pem -/cmd/jafar/badproxy.pem /country.mmdb /example.org /jafar diff --git a/internal/engine/cmd/README.md b/internal/engine/cmd/README.md deleted file mode 100644 index 1e27b73..0000000 --- a/internal/engine/cmd/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Directory github.com/ooni/probe-engine/cmd - -This directory contains the source code for the CLI tools we build. diff --git a/internal/engine/experiment/hhfm/hhfm.go b/internal/engine/experiment/hhfm/hhfm.go index 464362e..dce7924 100644 --- a/internal/engine/experiment/hhfm/hhfm.go +++ b/internal/engine/experiment/hhfm/hhfm.go @@ -16,7 +16,7 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/internal/randx" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx" diff --git a/internal/engine/experiment/tor/tor.go b/internal/engine/experiment/tor/tor.go index eab83d9..53396b0 100644 --- a/internal/engine/experiment/tor/tor.go +++ b/internal/engine/experiment/tor/tor.go @@ -13,7 +13,7 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/legacy/netxlogger" "github.com/ooni/probe-cli/v3/internal/engine/legacy/oonidatamodel" diff --git a/internal/engine/experiment/urlgetter/runner.go b/internal/engine/experiment/urlgetter/runner.go index 15b09c1..ed94b09 100644 --- a/internal/engine/experiment/urlgetter/runner.go +++ b/internal/engine/experiment/urlgetter/runner.go @@ -10,7 +10,7 @@ import ( "net/http/cookiejar" "net/url" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/netx/errorx" diff --git a/internal/engine/experiment/urlgetter/runner_test.go b/internal/engine/experiment/urlgetter/runner_test.go index a9852d0..fa02c4e 100644 --- a/internal/engine/experiment/urlgetter/runner_test.go +++ b/internal/engine/experiment/urlgetter/runner_test.go @@ -11,7 +11,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/atomicx" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestRunnerWithInvalidURLScheme(t *testing.T) { diff --git a/internal/engine/experiment/webconnectivity/control.go b/internal/engine/experiment/webconnectivity/control.go index fecf6e9..8d4b3ab 100644 --- a/internal/engine/experiment/webconnectivity/control.go +++ b/internal/engine/experiment/webconnectivity/control.go @@ -4,7 +4,7 @@ import ( "context" "github.com/ooni/probe-cli/v3/internal/engine/geolocate" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx/errorx" ) diff --git a/internal/engine/experiment/webconnectivity/webconnectivity.go b/internal/engine/experiment/webconnectivity/webconnectivity.go index 50419ac..9788e49 100644 --- a/internal/engine/experiment/webconnectivity/webconnectivity.go +++ b/internal/engine/experiment/webconnectivity/webconnectivity.go @@ -12,7 +12,7 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/experiment/webconnectivity/internal" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx/archival" ) diff --git a/internal/engine/geolocate/avast.go b/internal/engine/geolocate/avast.go index 26c2445..fb6f7fd 100644 --- a/internal/engine/geolocate/avast.go +++ b/internal/engine/geolocate/avast.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) type avastResponse struct { diff --git a/internal/engine/geolocate/avast_test.go b/internal/engine/geolocate/avast_test.go index c16f138..69c7f68 100644 --- a/internal/engine/geolocate/avast_test.go +++ b/internal/engine/geolocate/avast_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestIPLookupWorksUsingAvast(t *testing.T) { diff --git a/internal/engine/geolocate/ipconfig.go b/internal/engine/geolocate/ipconfig.go index 37f8cb3..b6baa8c 100644 --- a/internal/engine/geolocate/ipconfig.go +++ b/internal/engine/geolocate/ipconfig.go @@ -5,8 +5,8 @@ import ( "net/http" "strings" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) func ipConfigIPLookup( diff --git a/internal/engine/geolocate/ipconfig_test.go b/internal/engine/geolocate/ipconfig_test.go index 0fbde20..ed9b262 100644 --- a/internal/engine/geolocate/ipconfig_test.go +++ b/internal/engine/geolocate/ipconfig_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestIPLookupWorksUsingIPConfig(t *testing.T) { diff --git a/internal/engine/geolocate/ipinfo.go b/internal/engine/geolocate/ipinfo.go index 773322e..5f43427 100644 --- a/internal/engine/geolocate/ipinfo.go +++ b/internal/engine/geolocate/ipinfo.go @@ -4,8 +4,8 @@ import ( "context" "net/http" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) type ipInfoResponse struct { diff --git a/internal/engine/geolocate/ipinfo_test.go b/internal/engine/geolocate/ipinfo_test.go index 1b257c4..64f798d 100644 --- a/internal/engine/geolocate/ipinfo_test.go +++ b/internal/engine/geolocate/ipinfo_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestIPLookupWorksUsingIPInfo(t *testing.T) { diff --git a/internal/engine/geolocate/stun_test.go b/internal/engine/geolocate/stun_test.go index ba0c62c..70d188a 100644 --- a/internal/engine/geolocate/stun_test.go +++ b/internal/engine/geolocate/stun_test.go @@ -9,7 +9,7 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/pion/stun" ) diff --git a/internal/engine/geolocate/ubuntu.go b/internal/engine/geolocate/ubuntu.go index 63260a2..6fecded 100644 --- a/internal/engine/geolocate/ubuntu.go +++ b/internal/engine/geolocate/ubuntu.go @@ -5,7 +5,7 @@ import ( "encoding/xml" "net/http" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) type ubuntuResponse struct { diff --git a/internal/engine/geolocate/ubuntu_test.go b/internal/engine/geolocate/ubuntu_test.go index 4575fd3..c972a50 100644 --- a/internal/engine/geolocate/ubuntu_test.go +++ b/internal/engine/geolocate/ubuntu_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestUbuntuParseError(t *testing.T) { diff --git a/internal/engine/internal/httpheader/accept.go b/internal/engine/httpheader/accept.go similarity index 100% rename from internal/engine/internal/httpheader/accept.go rename to internal/engine/httpheader/accept.go diff --git a/internal/engine/internal/httpheader/acceptlanguage.go b/internal/engine/httpheader/acceptlanguage.go similarity index 100% rename from internal/engine/internal/httpheader/acceptlanguage.go rename to internal/engine/httpheader/acceptlanguage.go diff --git a/internal/engine/internal/httpheader/useragent.go b/internal/engine/httpheader/useragent.go similarity index 100% rename from internal/engine/internal/httpheader/useragent.go rename to internal/engine/httpheader/useragent.go diff --git a/internal/engine/internal/httpx/fake_test.go b/internal/engine/httpx/fake_test.go similarity index 100% rename from internal/engine/internal/httpx/fake_test.go rename to internal/engine/httpx/fake_test.go diff --git a/internal/engine/internal/httpx/fetch.go b/internal/engine/httpx/fetch.go similarity index 100% rename from internal/engine/internal/httpx/fetch.go rename to internal/engine/httpx/fetch.go diff --git a/internal/engine/internal/httpx/fetch_test.go b/internal/engine/httpx/fetch_test.go similarity index 98% rename from internal/engine/internal/httpx/fetch_test.go rename to internal/engine/httpx/fetch_test.go index c7086aa..df55874 100644 --- a/internal/engine/internal/httpx/fetch_test.go +++ b/internal/engine/httpx/fetch_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) func TestFetchResourceIntegration(t *testing.T) { diff --git a/internal/engine/internal/httpx/jsonapi.go b/internal/engine/httpx/jsonapi.go similarity index 100% rename from internal/engine/internal/httpx/jsonapi.go rename to internal/engine/httpx/jsonapi.go diff --git a/internal/engine/internal/httpx/jsonapi_test.go b/internal/engine/httpx/jsonapi_test.go similarity index 99% rename from internal/engine/internal/httpx/jsonapi_test.go rename to internal/engine/httpx/jsonapi_test.go index d7a8fec..2e41a98 100644 --- a/internal/engine/internal/httpx/jsonapi_test.go +++ b/internal/engine/httpx/jsonapi_test.go @@ -11,7 +11,7 @@ import ( "github.com/apex/log" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" "github.com/ooni/probe-cli/v3/internal/engine/netx/dialer" ) diff --git a/internal/engine/inputloader_integration_test.go b/internal/engine/inputloader_integration_test.go index 28af8b4..c289256 100644 --- a/internal/engine/inputloader_integration_test.go +++ b/internal/engine/inputloader_integration_test.go @@ -9,7 +9,7 @@ import ( "github.com/apex/log" "github.com/google/go-cmp/cmp" engine "github.com/ooni/probe-cli/v3/internal/engine" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/model" ) diff --git a/internal/engine/internal/mockable/mockable.go b/internal/engine/internal/mockable/mockable.go index 57e6796..4ef0379 100644 --- a/internal/engine/internal/mockable/mockable.go +++ b/internal/engine/internal/mockable/mockable.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/internal/psiphonx" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/internal/torx" diff --git a/internal/engine/internal/kvstore/kvstore.go b/internal/engine/kvstore/kvstore.go similarity index 100% rename from internal/engine/internal/kvstore/kvstore.go rename to internal/engine/kvstore/kvstore.go diff --git a/internal/engine/internal/kvstore/kvstore_test.go b/internal/engine/kvstore/kvstore_test.go similarity index 100% rename from internal/engine/internal/kvstore/kvstore_test.go rename to internal/engine/kvstore/kvstore_test.go diff --git a/internal/engine/netx/resolver/dnsoverhttps.go b/internal/engine/netx/resolver/dnsoverhttps.go index 50f10bc..8041024 100644 --- a/internal/engine/netx/resolver/dnsoverhttps.go +++ b/internal/engine/netx/resolver/dnsoverhttps.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) // DNSOverHTTPS is a DNS over HTTPS RoundTripper. Requests are submitted over diff --git a/internal/engine/netx/resolver/dnsoverhttps_test.go b/internal/engine/netx/resolver/dnsoverhttps_test.go index f02727f..7747ad6 100644 --- a/internal/engine/netx/resolver/dnsoverhttps_test.go +++ b/internal/engine/netx/resolver/dnsoverhttps_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/netx/resolver" ) diff --git a/internal/engine/probeservices/checkreportid.go b/internal/engine/probeservices/checkreportid.go index 4d53ddf..262f236 100644 --- a/internal/engine/probeservices/checkreportid.go +++ b/internal/engine/probeservices/checkreportid.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) type checkReportIDResponse struct { diff --git a/internal/engine/probeservices/checkreportid_test.go b/internal/engine/probeservices/checkreportid_test.go index 292e439..d3fce64 100644 --- a/internal/engine/probeservices/checkreportid_test.go +++ b/internal/engine/probeservices/checkreportid_test.go @@ -8,8 +8,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" ) diff --git a/internal/engine/probeservices/measurementmeta.go b/internal/engine/probeservices/measurementmeta.go index de9cfbf..5024b87 100644 --- a/internal/engine/probeservices/measurementmeta.go +++ b/internal/engine/probeservices/measurementmeta.go @@ -5,7 +5,7 @@ import ( "net/url" "time" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) // MeasurementMetaConfig contains configuration for GetMeasurementMeta. diff --git a/internal/engine/probeservices/measurementmeta_test.go b/internal/engine/probeservices/measurementmeta_test.go index cd92d5a..c777d5d 100644 --- a/internal/engine/probeservices/measurementmeta_test.go +++ b/internal/engine/probeservices/measurementmeta_test.go @@ -9,8 +9,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" ) diff --git a/internal/engine/probeservices/probeservices.go b/internal/engine/probeservices/probeservices.go index 10a1388..ecbecdc 100644 --- a/internal/engine/probeservices/probeservices.go +++ b/internal/engine/probeservices/probeservices.go @@ -29,7 +29,7 @@ import ( "net/url" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" "github.com/ooni/probe-cli/v3/internal/engine/model" ) diff --git a/internal/engine/probeservices/statefile_test.go b/internal/engine/probeservices/statefile_test.go index d6bfc88..d274fbf 100644 --- a/internal/engine/probeservices/statefile_test.go +++ b/internal/engine/probeservices/statefile_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" ) diff --git a/internal/engine/resources/resources.go b/internal/engine/resources/resources.go index d41ba8e..d4afbaa 100644 --- a/internal/engine/resources/resources.go +++ b/internal/engine/resources/resources.go @@ -13,7 +13,7 @@ import ( "os" "path/filepath" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" "github.com/ooni/probe-cli/v3/internal/engine/model" ) diff --git a/internal/engine/session.go b/internal/engine/session.go index 1fda2d2..6431f7b 100644 --- a/internal/engine/session.go +++ b/internal/engine/session.go @@ -13,7 +13,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/atomicx" "github.com/ooni/probe-cli/v3/internal/engine/geolocate" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/internal/platform" "github.com/ooni/probe-cli/v3/internal/engine/internal/sessionresolver" "github.com/ooni/probe-cli/v3/internal/engine/internal/tunnel" diff --git a/internal/engine/cmd/jafar/shellx/shellx.go b/internal/engine/shellx/shellx.go similarity index 100% rename from internal/engine/cmd/jafar/shellx/shellx.go rename to internal/engine/shellx/shellx.go diff --git a/internal/engine/cmd/jafar/shellx/shellx_test.go b/internal/engine/shellx/shellx_test.go similarity index 100% rename from internal/engine/cmd/jafar/shellx/shellx_test.go rename to internal/engine/shellx/shellx_test.go diff --git a/pkg/.gitignore b/pkg/.gitignore new file mode 100644 index 0000000..ace1063 --- /dev/null +++ b/pkg/.gitignore @@ -0,0 +1 @@ +/testdata