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 vet
s 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
Arlo Breault
5b18729e77
Add new assets
...
From https://trac.torproject.org/projects/tor/ticket/23888#comment:5
2019-05-08 11:23:49 -04:00
Arlo Breault
49dedf3a2f
Start a webextension
2019-05-08 11:23:49 -04:00
Arlo Breault
5aca6028f9
Stop logging debug message while counting down
2019-05-08 11:23:49 -04:00
Arlo Breault
898ba57070
Make a few object literals classes
2019-05-08 11:23:49 -04:00
Arlo Breault
7ce3c83a31
Use some class vars in broker to eliminate globals
2019-05-08 11:23:49 -04:00
Arlo Breault
bd5887a876
Make a WS class to eliminate globals
2019-05-08 11:23:49 -04:00
Arlo Breault
f3254e3402
Remove Modernizr dependency
...
And inline its only use site.
2019-05-08 11:23:49 -04:00
Arlo Breault
25dac378ee
Move init into its own file
2019-05-08 11:23:49 -04:00
Arlo Breault
622005c79e
Remove copy/paste signalling
2019-05-08 11:21:56 -04:00
Arlo Breault
79c84509fc
Follow go-webrtc commit 6c3076c and switch to xenial in .travis.yaml
2019-04-30 15:31:30 -04:00
Cecylia Bocovich
171c55a9b1
Implemented geoip lookups for the snowflake broker. This heavily based off of how tor maps IP addresses to country codes, and relies on the provided ipv4 and ipv6 files.
2019-04-29 17:10:15 -04:00
Cecylia Bocovich
d11e55aabe
Merge branch 'ticket30125'
2019-04-16 12:59:56 -04:00
Cecylia Bocovich
d4c5d4e65b
Updated robots.txt handler on broker
...
Updated robots.txt file to disallow crawling as in ticket #29565 .
2019-04-15 16:43:21 -04:00
Cecylia Bocovich
b4a4a256db
Ported log sanitization to client
2019-04-12 09:52:23 -04:00
Cecylia Bocovich
482d60d9d3
Use safelog scrubber in broker and proxy-go
2019-04-11 14:47:31 -04:00
Cecylia Bocovich
49042511a3
Refactored server log scrubber into package
...
The server log scrubbing code from ticket #21304 is now refactored into
a safelog package, along with the appropriate tests
2019-04-11 14:43:59 -04:00
Cecylia Bocovich
6399ef9d4f
Merge branch 'deadlock'
2019-04-11 09:57:38 -04:00
Cecylia Bocovich
62fddab153
Moved data channel timeout to constant
2019-04-05 10:40:11 -04:00
Cecylia Bocovich
08f5205461
Added check to see if peer connection succeeded
...
This is related to the proxy-go deadlock bug #25688 . If a client doesn't
do anything with the SDP answer, a token will get lost. Added a timeout
after a minute that checks the PeerConnection state and destroys the
peer connection and returns a token if did not yet succeed
2019-04-03 15:59:47 -04:00
Cecylia Bocovich
c28c8ca489
Fix for proxy deadlock bug
...
This is a fix for the proxy-go deadlock bug (ticket #25688 ). The
assumption that OnIceComplete is always followed by a successful
connection where OnDataChannel has been called turns out not to occur in
practice. OnICEComplete looks like it is being deprecated in other
libraries anyway, so it's safer to just remove it.
2019-04-03 13:44:48 -04:00
Cecylia Bocovich
3eb9064438
Removed unecessary output from logs
...
Removed raw bytes of ICE answers from broker logs and the SDP stanzas
from the client logs
2019-03-25 15:15:22 -04:00