Commit Graph

949 Commits

Author SHA1 Message Date
Simone Basso b2209bb637 refactor: replace ./make (python3) with ./mk (makefile) (#343)
This pull request fixes https://github.com/ooni/probe/issues/1471. We have replaced the original build script (`./make`) with the `./mk` makefile (executable using `#!/usr/bin/make -f`). We concluded supporting direct builds from Windows is not worth the effort and halving the code we need to maintain is probably a good plus. Both macOS and Linux install GNU make at `/usr/bin/make`, so we should be okay in the common use cases.

I significantly simplified the management of Go versioning by requiring the user to manage it and by enforcing that we are using the desired Go version. This speeds up builds and works in sane operating systems that use the last version of a specific package. Otherwise, it's possible to use the `go get golang.org/dl/go${version}` feature.

The remaining question mark was related to updating the Android SDK. I have determined that a good course of action is pinning to the latest CLI tools and always forcing the CLI tools to install the latest required packages (e.g., the NDK).
2021-05-11 16:15:13 +02:00
Simone Basso 6841db6cb0 Merge pull request #340 from ooni/release/3.10.0-beta.2
chore: bump to 3.10.0-beta.2
2021-05-07 14:37:32 +02:00
Simone Basso 2344690960 chore: bump to 3.10.0-beta.2 2021-05-07 12:19:51 +02:00
Simone Basso ad73fef757 fix(./make): chdir before signing for Android (#339)
More cleanup after https://github.com/ooni/probe/issues/1466
2021-05-07 12:18:40 +02:00
Simone Basso 2c0cef4b1a refactor(./make): better way to discover deps (#338)
Cleanup after https://github.com/ooni/probe/issues/1466
2021-05-07 12:11:08 +02:00
Simone Basso e753e57da3 feat(gha/linux): upload deb packages for arm64 (#337)
We're still working on https://github.com/ooni/probe/issues/1466. The idea here is to teach the GH action for Linux to publish the debian package for arm64. When this is done, we can cleanup legacy build scripts and GH actions, because there is no remaining use case for them: we now build everything using the `./make` tool.
2021-05-07 09:22:46 +02:00
Simone Basso 3109d56aef feat(gha): build debian package using ./make (#331)
Part of https://github.com/ooni/probe/issues/1466. We're building both `arm64` and `amd64`. We are still not publishing `arm64` packages, which is what is asked in the original issue, but we're really close to doing that.
2021-05-06 22:13:09 +02:00
Simone Basso c258a0fedd CLI, debian, make: misc cleanup and changes (#336)
This PR	groups misc cleanup and changes from https://github.com/ooni/probe-cli/pull/331.

* CLI/linux/build: add documentation

* debian/.gitignore: ignore generated files

* debian/TODO: unnecessary at this point

* debian/ooniprobe-cli.service: remove commented out lines

* debian/rules: remove unnecessary actions

* make: reindent and fix spelling

* smoketest.sh: don't run in verbose mode

Part of https://github.com/ooni/probe/issues/1466
2021-05-06 21:20:45 +02:00
Simone Basso 1ea760cb5f refactor(make): simplify the implementation of backticks (#335)
See https://github.com/ooni/probe/issues/1466
2021-05-06 20:57:17 +02:00
Simone Basso 6b88730cc4 refactor(.github/workflows): linux: use ./make, run less frequently (#334)
While there, flush `print`s in `./make` to have more understandable logging.

Also part of https://github.com/ooni/probe/issues/1466
2021-05-06 20:44:56 +02:00
Simone Basso b5ba1e743f refactor(.github/workflows): macos, windows: use ./make, run less frequently (#333)
Like in the previous PR, here we make macos and windows builds only run when we're preparing a release. While there, migrate the code to use the `./make` script. Tested in https://github.com/ooni/probe-cli/pull/331.

Reference issue is https://github.com/ooni/probe/issues/1466
2021-05-06 20:08:18 +02:00
Simone Basso fd333bad16 refactor(.github/workflows): reorganize many builds (#332)
1. reduce the number of periodic builds

2. just build as part of the release process in most cases

3. shorttests duplicates coverage

Preliminary changes as part of https://github.com/ooni/probe/issues/1466
2021-05-06 19:56:55 +02:00
Simone Basso 0f98caf3b4 feat(make): sign more generated binaries (#330)
* doc(make): add not about qemu-user-static

While still investigating https://github.com/ooni/probe/issues/1466

* feat(make): sign more generated binaries

While there, fix an annoying bug where the context manager
was suppressing exceptions that occurred.

Work part of https://github.com/ooni/probe/issues/1466.
2021-05-05 14:26:19 +02:00
Simone Basso 6a998545e9 refactor(make): always use _name instead of __name (#329)
Just consistency. There was no clear semantic regarding why
sometimes I was using __name and sometimes _name.

So prefer _name everywhere.

Occurred to me while working on https://github.com/ooni/probe/issues/1466.
2021-05-05 12:32:45 +02:00
Simone Basso eb43c7994a feat(make): build ooniprobe for darwin, windows, and linux (#328)
In https://github.com/ooni/probe/issues/1466, a user is asking
about arm64 builds for Debian. We already had some code for that
in https://github.com/ooni/probe-cli/pull/311. Let us adapt the
code to the `./make` script to have arm64 builds.

While there, also adapt the code for darwin and windows.
2021-05-05 12:12:34 +02:00
Simone Basso 5738c07aff refactor(make): better checks for tool existence and paths (#327)
After all the refactoring done so far, we can run checks directly
inside of `make`, because we have auto-cleanup, temporary environments
and we don't need wrapper scripts anymore.

Part of https://github.com/ooni/probe/issues/1466.
2021-05-05 11:33:51 +02:00
Simone Basso 4bd1533c86 refactor(make): easier unified environment management (#326)
Further simplifies working with the environment.

Part of https://github.com/ooni/probe/issues/1466.
2021-05-05 11:03:48 +02:00
Simone Basso 42dd9cb55e refactor(make): backticks: return output directly (#325)
The previous fix allowed us to return values directly from
implementations of Engine. Here we take advantage of this
possibility by immediately refactoring how backticks work.

Part of https://github.com/ooni/probe/issues/1466.
2021-05-05 10:42:39 +02:00
Simone Basso 80ef3e4b1b fix(make): compose runner and dry runner directly (#324)
The previous composition strategy was such that it was difficult
to compose functions returning a value.

This new composition strategy is better because it allows us to
return values, which is definitely going to help us.

Part of https://github.com/ooni/probe/issues/1466.
2021-05-05 10:30:27 +02:00
Simone Basso a9b3a3b3a5 fix(tunnel): pass /absolute/path/to/tor to cretz/bine (#323)
* fix(tunnel): pass /absolute/path/to/tor to cretz/bine

It seems cretz/bine is not aware of https://blog.golang.org/path-security
for now. I am planning to send over a diff for that later today.

In the meanwhile, do the right thing here, and make sure that we obtain
the absolute path to the tor binary before we continue.

This work is part of https://github.com/ooni/probe-engine/issues/283.

* fix tests when tor is not installed
2021-05-04 08:14:25 +02:00
Federico Ceratto 2539a17ff9 Switch .deb package publishing to S3 (#314)
This PR switches the` .deb` package publishing to s3 because Bintray has been shut down.
2021-05-03 16:50:27 +02:00
Arturo Filastò ac7d7dc8a3 Add support for tracking the is_uploaded status in the results table (#312)
* Add support for tracking the is_uploaded status in the results table

* Add unit tests for measurement upload status

This implements: https://github.com/ooni/probe/issues/1457

* Update cmd/ooniprobe/internal/database/actions.go

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2021-04-30 17:08:16 +02:00
Simone Basso 764293795e feat(make): build miniooni (#322)
This change is useful to move forward with blessing a new
release (https://github.com/ooni/probe/issues/1439).
2021-04-29 19:24:25 +02:00
Simone Basso 9d5a3321af chore: link new TODOs with the relevant issues (#321)
Part of https://github.com/ooni/probe/issues/985
2021-04-29 18:43:31 +02:00
Simone Basso 1d70b81187 More progress towards release v3.10.0 (#320)
* chore: unvendor github.com/mitchellh/go-wordwrap

The library seems reasonably maintained and tested.

Part of https://github.com/ooni/probe/issues/1439

* fix(netx/quicdialer): ensure we handle all errors

Part of https://github.com/ooni/probe/issues/1439

* fix previous

* cleanup: remove unnecessary shutil fork

Part of https://github.com/ooni/probe/issues/1439

* doc: documented some undocumented functions

Part of https://github.com/ooni/probe/issues/1439

* fix(ooniprobe): rename mis-named function

Part of https://github.com/ooni/probe/issues/1439
2021-04-29 15:59:53 +02:00
Simone Basso de60fb0588 Release v3.10.0-beta.1 (#319)
* fix(make): correctly write oonimkall.podspec

Part of https://github.com/ooni/probe/issues/1439

* chore: set version number to v3.10.0-beta.1

* fix(ios): don't build a target that requires git
2021-04-29 11:55:30 +02:00
Simone Basso 958c3fec58 Merge pull request #318 from ooni/issue/1440c
cleanup: remove mobile-staging and legacy build scripts
2021-04-29 10:46:43 +02:00
Simone Basso 4f52794ab9 cleanup: remove all references to mobile-staging
Part of https://github.com/ooni/probe/issues/1440
2021-04-29 10:35:44 +02:00
Simone Basso 70499edabe Merge remote-tracking branch 'origin/mobile-staging' into issue/1440c
This commit merges the mobile-staging branch into the main history so that
we are not losing track of what it happened during its lifetime.

We're going to not need this branch anymore, because we're now going to
build releases on a special purpose build machine.

At the same time, we don't want to loose track of the history of such a
branch because it tells a story of how we build for mobile.

This work is part of https://github.com/ooni/probe/issues/1440.
2021-04-29 10:33:08 +02:00
Simone Basso 62fd07374f cleanup: remove legacy scripts and update readme
Part of https://github.com/ooni/probe/issues/1440
2021-04-29 10:32:25 +02:00
Simone Basso 77973301ac feat(make): implement iOS build (#316)
Part of https://github.com/ooni/probe/issues/1440.

Basically, let us continue to update our build infrastructure so that we can release v3.10.0-beta.

Now, it's the turn of iOS.
2021-04-29 10:30:39 +02:00
Simone Basso a88d2f35a8 Prepare 3.10.0-beta release (#313)
This diff implements part of the release checklist at https://github.com/ooni/probe/issues/1439. The plan is to bless a beta release and use it for further testing on Android devices. Afterward, we need to apply some extra changes to the `cli` (including https://github.com/ooni/probe-cli/pull/314 and https://github.com/ooni/probe-cli/pull/312). Finally, we will bless a full 3.10.0 release.
2021-04-28 09:34:14 +02:00
Simone Basso 514ad8d0f5 ./make: script to create android builds (#315)
This PR introduces the `./make` script. For now, this script knows how to make Android releases. We have code in https://github.com/ooni/probe-cli/pull/311 that builds other artifacts in this repository.

Because our current concern is https://github.com/ooni/probe/issues/1444, in this PR, I have chosen to keep the Android code necessary to fix https://github.com/ooni/probe/issues/1444.

Additionally, this PR removes the script to publish to Bintray. This change part of the https://github.com/ooni/probe/issues/1440 cleanup effort.
2021-04-27 16:36:57 +02:00
Simone Basso 11087db51a chore: we're now at 3.10.0-alpha.1 (#310)
Part of https://github.com/ooni/probe/issues/1440
2021-04-20 09:20:04 +02:00
Simone Basso 85755e35f5 feat(ios): adapt build to post bintray world (#309)
Part of https://github.com/ooni/probe/issues/1437
2021-04-08 17:00:51 +02:00
Simone Basso f5d0a1fa1a Merge pull request #308 from ooni/stable
Merge v3.9.2 back into master
2021-04-08 00:17:44 +02:00
Simone Basso 2fd277af22 Merge tag 'v3.9.2' into stable
ooni/probe-cli v3.9.2
2021-04-08 00:09:17 +02:00
Simone Basso 04ea3fca43 chore: adapt android scripts to use maven central (#307)
The main changes here are two. First, tweak some bits of the POM template
to make sure it's current, including referencing the correct repo. (We were
still referencing probe-engine in there, weirdly enough).

Second, change the android build script to create the same bundle that
mavan would build. What remains to do is uploading manually.

(Because it seems my PGP key is required, I guess this development rules
out automatically generating releases at GitHub. We will see about it
later on and possibly zap the publish-android.sh script.)

Reference issue: https://github.com/ooni/probe/issues/1437.

The release 2021.04.07-180801 has been created by me using this
diff from the v3.9.0 tag. I will update the release notes as soon
as this new release becomes available from Maven Central.
2021-04-07 20:46:11 +02:00
Simone Basso 54e590b776 fix(geolocate): do resolver lookup with proxy (#306)
The use cases for using a proxy become more clear over time. When I
originally wrote the proxy code the idea was to use the proxy to proxy
both the communication with the backend and measurements.

It become increasingly clear that we _only_ want to proxy the
communication with the backends. Therefore, there's no point in
skipping the resolver lookup step when we use a proxy.

Part of https://github.com/ooni/probe/issues/985
2021-04-07 18:48:02 +02:00
Simone Basso c5f52d51e3 fix: disable maxRuntime with --input or --input-file (#305)
When this happens, the user is expressing the intention of
explicitly testing all the input they provided.

So, disable maxRuntime in these cases.

Part of https://github.com/ooni/probe/issues/1436.
2021-04-07 14:56:43 +02:00
Simone Basso 4578df0a2b fix: disable maxRuntime with --input or --input-file (#305)
When this happens, the user is expressing the intention of
explicitly testing all the input they provided.

So, disable maxRuntime in these cases.

Part of https://github.com/ooni/probe/issues/1436.
2021-04-07 14:55:04 +02:00
Simone Basso 654441f5cd fix: move preventMistakes in InputLoader (#304)
This fixes an issue where URLs provided with --input are not
accepted by the preventMistakes filter.

The filter itself needs to execute _only_ on URLs returned
by the checkIn API, rather than on URLs returned by the
InputLoader, which may instead be user provided.

Reference issue: https://github.com/ooni/probe/issues/1435
2021-04-07 14:14:25 +02:00
Simone Basso f48115a2c9 chore: set version to v3.9.2 2021-04-07 13:57:28 +02:00
Simone Basso 818bf2cba5 fix: move preventMistakes in InputLoader
This fixes an issue where URLs provided with --input are not
accepted by the preventMistakes filter.

The filter itself needs to execute _only_ on URLs returned
by the checkIn API, rather than on URLs returned by the
InputLoader, which may instead be user provided.

Reference issue: https://github.com/ooni/probe/issues/1435
2021-04-07 13:54:56 +02:00
Simone Basso 46d19f47ec fix: disable maxRuntime when not WebConnectivity (#302)
This commit cherry-picks https://github.com/ooni/probe-cli/commit/6306c09963c3e05f5a1eb1a48ae226baa40ff3a1

See https://github.com/ooni/probe/issues/1433

Conflicts:
	internal/version/version.go
2021-04-06 20:48:56 +02:00
Simone Basso 5d8cf60f55 fix(oonimkall): allow Android app to set proxy (#303)
Part of https://github.com/ooni/probe/issues/985
2021-04-06 14:53:58 +02:00
Simone Basso 6306c09963 fix: disable maxRuntime when not WebConnectivity
See https://github.com/ooni/probe/issues/1433
2021-04-06 13:03:50 +02:00
Simone Basso 7172e750dd fix(session): make sure tunnel code is tested (#301)
* fix(session): make sure tunnel code is tested

Part of https://github.com/ooni/probe/issues/985

* fix: add missing TunnelDir for correctness
2021-04-05 19:51:41 +02:00
Simone Basso 8b92037ae3 fix(tunnel/tor): keep tunneldir clean (#300)
* fix(tunnel/tor): keep tunneldir clean

This diff ensures that we don't keep the log file growing and
we also remove the temporary files created by the library we
are currently using for running tor from golang.

Part of https://github.com/ooni/probe/issues/985

* fix(session.go): tell use we're using a tunnel
2021-04-05 19:18:00 +02:00
Simone Basso 6aa2551c43 urlgetter: fix tunnel test (#299)
* urlgetter: fix tunnel test

This diff fixes the urlgetter test suite to make sure we
are correctly testing for tunnel creation.

While there, improve the way in which we create a testing
directory and add a test for that.

Part of https://github.com/ooni/probe/issues/985.

* fix comment

* fix comment
2021-04-05 18:25:43 +02:00