Go to file
Simone Basso 95906fbcce
feat: use ooni/probe-engine@286613b74e and cleanup (#177)
* feat: use ooni/probe-engine@286613b74e and cleanup

1. zap unused configuration settings from the config file but do not
bump the version number because doing that _may_ interact in unexpected
ways with probe-desktop (hence https://github.com/ooni/probe/issues/1297)
and also because we've just _removed_ stuff for now, therefore any
previous configuration file will continue to work, except that we'll
be ignoring a bunch of options. In a future version of probe-cli I'll
spend some time to further improve config file management.

2. accordingly, make sure all current configuration files that are around
in the tree are current and only feature supported options.

3. update to ooni/probe-engine@286613b74e, which contains a bunch of
APIs that should allow us to simplify the interaction between the cli and
the engine, by sharing code more cleverly.

4. zap GetTestKeys because now we use code in probe-engine instead.

5. zap LogSummary because it was not being used.

6. the main change related to cleaning up the config and to the update
to the latest probe-engine is that include_{cc,asn,ip} settings are
gone and we now share the CC and the ASN and we never share the IP addr.

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

After this change is landed, there's a bunch more work to do to further
unify cli and engine. The final state will be that the cli uses ~the code
used by miniooni, so it will have a bunch of desirable options.

* fix: bindata after recent changes
2020-11-26 18:48:20 +01:00
.github/workflows fix(debian pkg): only package the master branch (#160) 2020-11-13 10:26:37 +01:00
CLI fix(build.sh): name macOS files after the darwin platform 2020-08-24 19:24:46 +02:00
cmd/ooniprobe Rename the binary as ooniprobe (#58) 2019-10-02 19:27:15 +02:00
data feat: use ooni/probe-engine@286613b74e and cleanup (#177) 2020-11-26 18:48:20 +01:00
debian Initial packaging (#117) 2020-11-13 09:59:30 +01:00
docs Address feedback from @bassosimone 2019-12-04 13:13:13 +02:00
internal feat: use ooni/probe-engine@286613b74e and cleanup (#177) 2020-11-26 18:48:20 +01:00
testdata feat: use ooni/probe-engine@286613b74e and cleanup (#177) 2020-11-26 18:48:20 +01:00
.gitignore WIP: Start preparing release v3.0.7 (#147) 2020-08-22 11:20:50 +02:00
build.sh turn off printing of each command in the help section of the build script (#155) 2020-10-14 11:42:10 +02:00
CODE_OF_CONDUCT.md doc: add code of conduct (#157) 2020-11-03 21:16:04 +01:00
go.mod feat: use ooni/probe-engine@286613b74e and cleanup (#177) 2020-11-26 18:48:20 +01:00
go.sum feat: use ooni/probe-engine@286613b74e and cleanup (#177) 2020-11-26 18:48:20 +01:00
LICENSE.md Add LICENSE.md 2018-07-11 18:06:27 +02:00
Readme.md refactor: version is now an internal package (#167) 2020-11-13 17:37:06 +01:00
smoketest.sh WIP: Start preparing release v3.0.7 (#147) 2020-08-22 11:20:50 +02:00
updatebindata.sh Release v3.0.7 (#152) 2020-09-30 10:54:58 +02:00

OONI Probe CLI

linux-debian-packages

The next generation OONI Probe Command Line Interface.

User setup

  1. Go into the releases and download the release for your architecture and platform

  2. Extract the tarball with tar xvzf ooniprobe_*.tar.gz

  3. Copy the ooniprobe binary into a location in your $PATH, for example /usr/local/bin/ooniprobe

  4. 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 and /PATH/TO/CONFIG/config-100sites.json with the location of a file which limits the testing to 100 URLs.

You may also want to adjust the locations of the logs.

<?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>Program</key>
    <string>/PATH/TO/BINARY/ooniprobe</string>
    <key>ProgramArguments</key>
    <array>
        <string>--config="/PATH/TO/CONFIG/config-100sites.json"</string>
        <string>--batch</string>
        <string>run</string>
    </array>

    <key>StartInterval</key>
    <integer>3600</integer>

    <key>StandardErrorPath</key>
    <string>/tmp/ooniprobe-cli.err</string>

    <key>StandardOutPath</key>
    <string>/tmp/ooniprobe-cli.out</string>
</dict>
</plist>

Once you have written the file, you can enable ooniprobe to run automatically by doing: launchctl load org.ooni.probe.cli.plist.

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

  1. update binary data as described above;

  2. update internal/version/version.go;

  3. make sure you have updated dependencies;

  4. run ./build.sh release and follow instructions.