99b28c1d95
* refactor: start building an Android package Part of https://github.com/ooni/probe/issues/1335. This seems also a good moment to move some packages out of the engine, e.g., oonimkall. This package, for example, is a consumer of the engine, so it makes sense it's not _inside_ it. * fix: committed some stuff I didn't need to commit * fix: oonimkall needs to be public to build The side effect is that we will probably need to bump the major version number every time we change one of these APIs. (We can also of course choose to violate the basic guidelines of Go software, but I believe this is bad form.) I have no problem in bumping the major quite frequently and in any case this monorepo solution is convinving me more than continuing to keep a split between engine and cli. The need to embed assets to make the probe more reliable trumps the negative effects of having to ~frequently bump major because we expose a public API. * fix: let's not forget about libooniffi Honestly, I don't know what to do with this library. I added it to provide a drop in replacement for MK but I have no idea whether it's used and useful. I would not feel comfortable exposing it, unlike oonimkall, since we're not using it. It may be that the right thing to do here is just to delete the package and reduce the amount of code we're maintaining? * woops, we're still missing the publish android script * fix(publish-android.bash): add proper API key * ouch fix another place where the name changed |
||
---|---|---|
.github/workflows | ||
CLI | ||
cmd/ooniprobe | ||
data | ||
debian | ||
docs | ||
internal | ||
MOBILE | ||
pkg/oonimkall | ||
.gitignore | ||
build-android.bash | ||
build-miniooni.sh | ||
build.sh | ||
CODE_OF_CONDUCT.md | ||
go.mod | ||
go.sum | ||
LICENSE.md | ||
publish-android.bash | ||
Readme.md | ||
smoketest.sh | ||
updatebindata.sh |
OONI Probe CLI
The next generation OONI Probe Command Line Interface.
User setup
-
Go into the releases and download the release for your architecture and platform
-
Extract the tarball with
tar xvzf ooniprobe_*.tar.gz
-
Copy the
ooniprobe
binary into a location in your$PATH
, for example/usr/local/bin/ooniprobe
-
Run
ooniprobe run
to perform all the tests
Optional:
Add a crontab entry (on linux) to run ooniprobe
daily at a random time:
(crontab -l 2>/dev/null; echo "$(( ( RANDOM % 60 ) + 1 )) $(( ( RANDOM % 24 ) + 1 )) * * * ooniprobe run") | crontab -
On macOS you can configure OONI Probe to run automatically using launchd.
Below is a sample launchd script, that should be placed inside of
~/Library/LaunchAgents/org.ooni.probe.cli.plist
.
Be sure to replace /PATH/TO/BINARY/ooniprobe
with the actual install location of the
ooniprobe
binary.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.ooni.probe.daily-run</string>
<key>KeepAlive</key>
<false/>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/PATH/TO/BINARY/ooniprobe</string>
<string>--log-handler=syslog</string>
<string>run</string>
<string>unattended</string>
</array>
<key>StartInterval</key>
<integer>86400</integer>
</dict>
</plist>
Once you have written the file, you can enable ooniprobe
to run automatically by
doing: launchctl load org.ooni.probe.cli.plist
.
Reporting issues
Please, report issues with this codebase at https://github.com/ooni/probe. Please, make
sure you tag such issues using the ooni/probe-cli
label.
Development setup
Be sure you have golang >= 1.14 and a C compiler (when developing for Windows, you need Mingw-w64 installed). The most basic build command is:
go build -v ./cmd/ooniprobe
To compile a release used the build.sh
script. For more information
./build.sh help
The output generated by this command should provide you with updated information
regarding the pre-requisites for building (and cross-building) ooniprobe
as well
as useful information regarding cross compiling.
To update bundled binary data use:
./updatebindata.sh
Updating dependencies
go get -u -v ./... && go mod tidy
Releasing
-
update binary data as described above;
-
update
internal/version/version.go
; -
make sure you have updated dependencies;
-
run
./build.sh release
and follow instructions.