Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement measurements using decorator pattern #529

Closed
wants to merge 48 commits into from
Closed

Conversation

bassosimone
Copy link
Contributor

This also includes a new experiment called urlgetter that can
be used to perform URL measurements like:

./miniooni -i http://www.kernel.org urlgetter

./miniooni -OTLSServerName=x.org -i http://www.kernel.org urlgetter

./miniooni -OResolverURL=https://cloudflare-dns.com/dns-query \
           -i http://www.kernel.org urlgetter

Part of #509

@bassosimone bassosimone self-assigned this Apr 27, 2020
exit 1
}

if [ $# -ne 1 ]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer [[]] to []: https://google.github.io/styleguide/shellguide.html#s6.3-tests

BTW, that's a pretty good style guide. You may want to use it if you don't already have one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for letting me know about this style guide, I was not aware of that!

fi
}

require jq "sudo apt install jq"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend you put all statements that are executed inside a main() function, so it's easier to read and understand. Then you call main "$@" at the bottom.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

tail -n1 report.jsonl|jq -r ".test_keys.requests|.[0]|.response.body"
}

testdomain=${MINIOONI_TEST_DOMAIN:-example.org}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to organize the code below in functions, so it's easier to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

# XXX: maybe make these two checks separate checks for now?
urlgetter -OResolverURL=system:/// -ORejectDNSBogons=true -i dnslookup://$domain
if [ "$(getfailure)" = "dns_bogon_error" ]; then
output "MINIOONI_DNS_BOGONS=1"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really explain the censorship mechanism.
Was the bogon injected or did the resolver lie?
That's what matters the most. The bogon detection is just a way to validate the IP address, but the result should be DNS lie or DNS injection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I think this script was an initial experiment to understand how an higher level logic for running measurements (i.e. an improved web connectivity) could work. For this reason, I didn't bother with implementing an algorithm for providing output to users of the script. The goal is to understand a good algorithm and then implement it in Go.

@bassosimone bassosimone added priority/low Low priority research prototype Research required labels Aug 18, 2020
@bassosimone
Copy link
Contributor Author

This pull request has served its purpose of providing us with a PoC regarding how to implement better measurements. We should spend some time as part of Sprint 21 trying to understand if there is still valuable information that we can extract from here as a set of issues, or whether we can simply close this PR, delete the associated branch, and move on.

@bassosimone bassosimone added this to the Sprint 21 - Steve Z. milestone Aug 31, 2020
@bassosimone
Copy link
Contributor Author

Effort is 1 because we need to take a look.

@bassosimone bassosimone removed this from the Sprint 21 - Steve Z. milestone Aug 31, 2020
@bassosimone
Copy link
Contributor Author

So, the remaining part of this diff that has not been merged into master only exposes my lack of good shell writing skills and does not otherwise carry much meaningful content. The problem of improving Web Connectivity has not been solved yet but the place where to do that is clearly not this pull request. This is for many reasons, including that I'd like the improved domain checking code to be implemented in Go and to be callable as a OONI experiment. So, safe to close this PR.

@bassosimone bassosimone deleted the issue/509 branch August 31, 2020 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/low Low priority research prototype Research required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants