Commit graph

673 commits

Author SHA1 Message Date
Antonela D
eeae741262 Update to popup UI and addition of toggle 2019-07-02 10:01:34 -04:00
Cecylia Bocovich
19244c7146 Merge branch 'ticket21315' 2019-06-28 17:31:02 -04:00
Arlo Breault
fdc10fd08a Bump the webextension to 0.0.1 2019-06-26 18:52:46 -04:00
Arlo Breault
055d5f1824 Appease validation warning about "Unsafe assignment to innerHTML"
This doesn't apply to the webextension but hasn't been factored out in
the build step yet.
2019-06-26 18:30:24 -04:00
Cecylia Bocovich
908cf3fc64 Updated tests to check new stats
Updated the tests to pass with our new snowflake-ips-total stat
2019-06-25 10:06:00 -04:00
Cecylia Bocovich
8f2dc3563b Added a metric that sums available snowflakes
Added another metrics item that counts the total availabel snowflakes
(unique by IP address)
2019-06-25 09:33:45 -04:00
Arlo Breault
ff6f91f3da Make the doorhanger narrower in FF 2019-06-24 16:07:03 -04:00
Arlo Breault
a70f5b9181 Use system font stack in the webextension 2019-06-24 13:25:51 -04:00
David Fifield
77aac03b7e Documentation links for loading an unpacked extension. 2019-06-21 15:02:24 -06:00
Arlo Breault
85625e19f9 Count the number of clients the webext has served 2019-06-19 17:50:05 -04:00
Cecylia Bocovich
f779013b2d Fixed small formatting errors of log output
- removed trailing ","s
- removed unecessary space before seconds
2019-06-14 17:09:06 -04:00
Cecylia Bocovich
0767a637c1 Changed variable names/types to be more reasonable
Also moved the geoip check to occur after we've make sure the proxy IP
hasn't yet been recorded. This is will cut down on unecessary
computation.
2019-06-14 17:00:31 -04:00
Cecylia Bocovich
92d61f2555 Added a comment for the metrics specification 2019-06-12 10:17:55 -04:00
Cecylia Bocovich
fe3356a54d Unit tests for metrics code
Added unit tests for metrics logging. Refactored the logMetrics()
function to allow for easier testing
2019-06-12 10:14:21 -04:00
Cecylia Bocovich
25f059f4c4 Log geoip stats of proxies by unique IP
Change it so that we log the geoip country code of proxies if they poll
within the current metrics epoch. We make sure we log by unique IP
address
2019-06-11 15:43:59 -04:00
Cecylia Bocovich
c782ebdcea Format output to meet specification
Output is now printed out in Tor Directory Protocol Format, as specified
in https://trac.torproject.org/projects/tor/ticket/21315#comment:19.
2019-06-11 15:01:05 -04:00
Cecylia Bocovich
175b8efb04 Bin metrics to nearest mult of 8 2019-06-11 14:27:42 -04:00
Cecylia Bocovich
0293674e38 Zero out counts for next time step 2019-06-11 14:19:14 -04:00
Cecylia Bocovich
d57cd07599 Implemented count metrics for broker events
Added three new metrics:
- proxyIdleCount counts the number of times a proxy polls and receives
no snowflakes
- clientDeniedCount counts the number of times a client requested a
snowflake but none were available
- clientProxyMatchCount counts the number of times a client successfully
received a snowflake
2019-06-11 14:16:01 -04:00
Cecylia Bocovich
64ce7dff1b Changed time resolution for metrics collection
Set the resolution of metrics data collection to be every 24 hours
2019-06-11 13:44:59 -04:00
Arlo Breault
91255463c6 Start on popup 2019-06-06 12:17:11 -04:00
Philipp Winter
11efa42e4c
Cache certificates across program restarts.
So far, we request a certificate each time we start the broker.  Let's
Encrypt maintains several rate limiters and if we exceed one of them, we
won't get a certificate.  Worse, since we don't store certificates, we
won't even be able to use an old one.

This patch uses autocert's DirCache structure to cache certificates on
disk.

This patch fixes <https://bugs.torproject.org/30512>.
2019-06-03 15:50:35 -07:00
Cecylia Bocovich
cd650fa009 Keyed composite literal to avoid go vet warning 2019-05-28 13:58:16 -04:00
Cecylia Bocovich
254e6b9a3d Simplified limitedReader by reading one extra byte 2019-05-28 13:29:59 -04:00
Cecylia Bocovich
0842dad38e Added tests to check large read guards 2019-05-28 13:29:59 -04:00
Cecylia Bocovich
1d76d3ca2e Implement limitedRead function for client side
MaxBytesReader is only documented for server side reads, so we're using
a local limitedRead function instead that uses an io.LimitedReader.

Declared limits in a commented constant
2019-05-28 13:29:59 -04:00
Cecylia Bocovich
ce3101d016 Guard against large reads
This is a fix for #26348
2019-05-28 13:29:59 -04:00
Arlo Breault
5380aaca8c Use OnIceGatheringStateChange instead of OnIceComplete in client
Amounts to the same thing as currently implemented in go-webrtc
2019-05-21 14:34:40 -04:00
Arlo Breault
d7676d2b9e Stop using OnIceComplete in server-webrtc
Similar to c28c8ca for proxy-goc
2019-05-21 14:34:40 -04:00
Arlo Breault
2e4383434f Move datachannel timeout to after sendAnswer return 2019-05-20 15:43:55 -04:00
Arlo Breault
dd927050d9 Appease go vets complaints about passing locks by value 2019-05-16 12:58:25 -04:00
Arlo Breault
b77a99b565 Fix broker tests
NewBrokerContext now requires a logger so give it one to discard the
logs.
2019-05-16 12:34:21 -04:00
Arlo Breault
762a52aee6 Prefer a background script to a page in the webext
Now that the page is no longer necessary.
2019-05-16 12:07:06 -04:00
Arlo Breault
dad53932a2 Fix some linting warnings for "Line exceeds maximum allowed length." 2019-05-16 12:07:06 -04:00
Arlo Breault
5384ef9d16 Fix some linting warnings for "Unnecessary fat arrow." 2019-05-16 12:07:06 -04:00
Arlo Breault
4d40f17487 Separate build per use 2019-05-16 12:07:06 -04:00
Arlo Breault
2d8a1690ba Initialize snowflake instance with a config 2019-05-16 12:07:06 -04:00
Arlo Breault
edbbea1d03 Move querystring access to init 2019-05-16 12:07:06 -04:00
Arlo Breault
3839c2e0b1 Initialize arrays when constructing
Otherwise, this is set on the prototype and shared across instances :/

Note the change to the test that highlights this bug.  A proxy pair was
already created when an earlier test called `beginWebRTC()` but a new
Snowflake instance should start with an empty array.
2019-05-16 12:07:06 -04:00
Arlo Breault
9df66b15b1 Make MODE a class constant 2019-05-16 12:07:06 -04:00
Cecylia Bocovich
6b002c5f22 Merge branch 'geoip_squashed' 2019-05-15 11:07:33 -04:00
Cecylia Bocovich
1133e01363 Added an option to use a conventional certificate 2019-05-14 17:14:39 -04:00
Cecylia Bocovich
ba4fe1a73e Added an option to specify metrics log file
Previously the metrics log file was hardcoded and the broker wasn't
behaving properly if it was unable to open the file for logging.

Added a commandline option to specify the logfile that defaults to
Stdout.

Fixed up some documentation and log output formatting
2019-05-14 12:53:01 -04:00
Cecylia Bocovich
72e54bdc2e Remove geoip metrics from /debug
For now we can just log the proxy geoip statistics locally
2019-05-09 18:13:48 -04:00
Cecylia Bocovich
d865b7c252 Merge branch 'ticket30434' 2019-05-08 17:48:05 -04:00
Cecylia Bocovich
3844122809 Merge branch 'ticket30206' 2019-05-08 17:46:33 -04:00
Cecylia Bocovich
695dd10b2c Fix for ticket #30206
This fixes a bug introduced by the deadlock patch for ticket #25688.
2019-05-08 17:45:55 -04:00
Cecylia Bocovich
83fb5df260 Fixed log scrubber to not scrub timestamps
Our log scrubber was a bit over-zealous and was scrubbing timestamps as
well. While we're still over-scrubbing, we're now more precise and
ensure that compressed IPv6 addresses have "::"
2019-05-08 12:31:53 -04:00
Arlo Breault
e7f3ade068 Add a WebExtUI the makes use of the new assests
The browser icon shows the on/off state.
2019-05-08 11:23:49 -04:00
Arlo Breault
2b1852c1a5 Make badge and debug extend ui
Permits further ui extension
2019-05-08 11:23:49 -04:00