8eada581c2
Copied from github.com/ooni/ooni.org |
||
---|---|---|
.github/workflows | ||
CLI | ||
cmd/ooniprobe | ||
config | ||
data | ||
docs | ||
internal | ||
nettests | ||
testdata | ||
utils | ||
version | ||
.gitignore | ||
build.sh | ||
CODE_OF_CONDUCT.md | ||
go.mod | ||
go.sum | ||
LICENSE.md | ||
ooni_test.go | ||
ooni.go | ||
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 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
- update every direct dependency in
go.mod
exceptprobe-engine
usinggo get -u -v $dependency
:
for name in `grep -v indirect go.mod | grep -v probe-engine | awk '/^\t/{print $1}'`; do \
go get -u -v $name; \
done
-
pin to the latest version of the
probe-engine
withgo get -v github.com/ooni/probe-engine@TAG
-
remove all indirect dependencies from
go.mod
and merge the content ofprobe-engine
'sgo.mod
into ourgo.mod
-
go mod tidy
The rationale of this procedure is that we want to pin exactly to a specific version of psiphon and of its dependencies.
Releasing
-
update binary data as described above;
-
update
version/version.go
; -
make sure you have updated dependencies;
-
run
./build.sh release
and follow instructions.