-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: add support for passing proxy command line parameter (#981)
This implements the bare minimum needed to have circumvention proxy support in OONI Probe CLI. The reference issue is ooni/probe#1955. (Most of that issue is implemented, save for the fact that currently we do not have support for `http` and `https` proxies.) While there, add to `Makefile` a rule for correctly building `ooniprobe` and `miniooni` for "this system" (i.e., the default `GOOS` and `GOARCH` on a system), because we needed this for testing this patch and we needed to figure out the commands instead.
- Loading branch information
Showing
6 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if [[ $# -ne 1 ]]; then | ||
echo "" 1>&2 | ||
echo "Compiler for a Go PACKAGE producing GOOS/GOARCH binaries in the" 1>&2 | ||
echo "top-level directory (should not be used for releasing)." 1>&2 | ||
echo "" 1>&2 | ||
echo "usage: $0 PACKAGE..." 1>&2 | ||
echo "" 1>&2 | ||
echo "Features:" 1>&2 | ||
echo "" 1>&2 | ||
echo "* automatically sets -tags=ooni_psiphon_config when possible;" 1>&2 | ||
echo "" 1>&2 | ||
echo "* if GOLANG_EXTRA_FLAGS is set, pass it to the Go compiler." 1>&2 | ||
echo "" 1>&2 | ||
echo "Example:" 1>&2 | ||
echo "" 1>&2 | ||
echo " ./CLI/go-build-generic ./internal/cmd/miniooni" 1>&2 | ||
echo "" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
if [[ -f ./internal/engine/psiphon-config.json.age && | ||
-f ./internal/engine/psiphon-config.key ]]; then | ||
OONI_PSIPHON_TAGS=ooni_psiphon_config | ||
else | ||
OONI_PSIPHON_TAGS="" | ||
fi | ||
|
||
set -x | ||
for pkg in "$@"; do | ||
go build -tags=$OONI_PSIPHON_TAGS -ldflags="-s -w" ${GOLANG_EXTRA_FLAGS:-} $pkg | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters