Commit graph

588 commits

Author SHA1 Message Date
David Fifield
d0686b1c8d Use Manager.HTTPHandler for automatic TLS support in the server.
As with commit fcc274ac68 for the broker,
we need to start using the HTTP-01 challenge type in the Snowflake
websocket server transport plugin.
https://bugs.torproject.org/25346
2018-03-05 21:16:51 -08:00
Arlo Breault
c62111c507 Freeze jasmine until tests are updated for newer version 2018-03-05 20:40:47 -05:00
Arlo Breault
10ad59fc9d Appease go fmt after fcc274a 2018-03-05 19:35:54 -05:00
Arlo Breault
f6301197cc Call explicit frees in client 2018-03-05 18:59:08 -05:00
David Fifield
ee4e0aa160 Trivial doc update: we do report the USERADDR now. 2018-03-05 15:27:27 -08:00
David Fifield
fcc274ac68 Use Manager.HTTPHandler for automatic TLS support.
This is needed since the recent removal of the TLS-SNI challenge types.
https://community.letsencrypt.org/t/tls-sni-challenges-disabled-for-most-new-issuance/50316
The HTTP-01 challenge type requires an additional listener on port 80.
2018-02-24 11:40:02 -08:00
David Fifield
9ab8ea3df4 Use %.f not %.g to format stats interval.
fmt.Sprintf("%.g", 86400.4) → "9e+04"
fmt.Sprintf("%.f", 86400.4) → "86400"
2017-10-20 12:26:44 -07:00
David Fifield
085f253757 Fix periodic stats reporting.
The time interval was being reset every time a new connection came in.
2017-10-19 00:00:26 -07:00
Arlo Breault
99604ff15a Downgrade coffeelint line lengths to a "warning" 2017-10-18 11:39:17 -04:00
Arlo Breault
da8b37e866 Fix go vet complaint
"net.IPAddr composite literal uses unkeyed fields"
2017-10-18 11:34:00 -04:00
Arlo Breault
def423f5c6 torrc-manuel deserves a -log 2017-10-18 11:21:57 -04:00
Arlo Breault
bbb5a6aca2 webrtc.NewIceServer already does this split / validation
It also expects to be called with a non-empty string, which isn't
the case with this Split which always envokes the loop at least
once.  If -ice was omitted, an error was logged.
2017-10-18 11:15:53 -04:00
David Fifield
58556dc07b Keep track of clientAddr in statsChannel. 2017-10-17 22:19:43 -07:00
David Fifield
4697746120 Actually call clientAddr. 2017-10-17 22:19:23 -07:00
David Fifield
1ef6211c6c Rough tests for the clientAddr function. 2017-10-17 22:13:56 -07:00
David Fifield
d9e8f8f647 Log once a day how many connections had client_ip.
This is a sanity check against any catastrophic failure of our parsing
code.
2017-10-17 22:12:21 -07:00
David Fifield
c84e1a2e03 Add a dummy port number to USERADDR.
Current versions of tor accept USERADDR with or without a port number,
but future versions may become more strict and require the port number.
https://bugs.torproject.org/23080
2017-10-17 22:12:21 -07:00
David Fifield
83f8712078 Factor out a function to extract the client IP address. 2017-10-17 22:12:21 -07:00
David Fifield
9e5eb7f5ee Pass the incoming client_ip into the ExtORPort. 2017-10-14 15:06:36 -04:00
David Fifield
eca7ebb265 Bug 18628: Pass the client_ip parameter in the JavaScript proxy as well. 2017-10-14 15:06:36 -04:00
David Fifield
0c7ddeb1d0 Parse.ipFromSDP function. 2017-10-14 15:06:36 -04:00
Hooman
ae0643320e Pass client IP from proxy-go to server by parsing SDP
Call conn.RemoteAddr() before entering the datachannelHandler goroutine.
This is a workaround for the hang described at
https://bugs.torproject.org/18628#comment:8
2017-10-14 15:06:33 -04:00
Arlo Breault
82d7f16bab Use the "context" package in go 1.7
* Since we're now assuming >= 1.8.3
2017-10-12 18:39:03 -04:00
Arlo Breault
13b31f6494 Bump go version on travis to 1.8.3
* Same as currently used in TB,
   https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/go/config?id=8c4c05ddcfc30107b967b204d491523685460226

 * Also, necessary for the "context" import in acme/autocert
2017-10-12 18:34:46 -04:00
Arlo Breault
fea9df7540 Use context.WithTimeout instead of transport.Deadline
* The field was removed in,
   11ed51af43
2017-10-12 18:20:33 -04:00
Arlo Breault
ab4bd77cb4 Go get another missing dep in travis 2017-10-12 17:32:47 -04:00
Arlo Breault
3b9a4624bd Add missing import removed in 0c02af3 2017-10-12 17:26:32 -04:00
Arlo Breault
66509e6af3 Go get missing dep in travis 2017-10-12 17:24:30 -04:00
Arlo Breault
441cd8c80f Update for the latest go-webrtc
* From https://github.com/keroserene/go-webrtc/pull/59
2017-10-12 17:17:57 -04:00
Arlo Breault
fd217ffaab Updating from legacy (import "appengine") packages
* Ran, `go get google.golang.org/appengine/cmd/aefix`
   from https://github.com/golang/appengine
2017-10-12 17:15:08 -04:00
David Fifield
0c02af35d0 Move handling of -ice option into main.
Rather than having it happen as a side effect of flag parsing.

Having it happen as a side effect of flag parsing caused log messages
related to handling the option (e.g. "IceServerList:") to always go to
stderr, despite the presence of a -log option. This is because the
requested log file had not been opened yet.
2017-08-14 12:33:28 -07:00
David Fifield
8dcd337ce4 Re-remove ipHandler function.
Had been removed in 2a46db2c01 and was
erroneously restored in the merge
36debdfdd2.
2017-08-11 13:08:36 -07:00
David Fifield
36debdfdd2 Merge branch 'standalone-broker' 2017-08-02 19:34:00 -07:00
David Fifield
3e3e4b8dd9 Deglobalize some flag-controlled variables.
Remove global opt struct.
2017-08-01 15:53:36 -07:00
David Fifield
1eb5c66428 Stop writing to global opt.brokerURL variable.
This variable was being written to by multiple goroutines, overwriting
the Path to either "/proxy" or "/answer" as necessary, which was racy.
2017-08-01 15:51:34 -07:00
David Fifield
461dbeba80 Make capacity a uint.
This prohibits some nonsense like "./proxy-go -capacity -550", which
otherwise results in a panic like:

INFO: configuration.go:174: Created Configuration at  &{[{[stun:stun.l.google.com:19302]  }] All Balanced }
panic: makechan: size out of range
2017-08-01 15:06:53 -07:00
David Fifield
dbe1ef4fa5 Remove unused stunURL and relayURL, unused except for parsing tests. 2017-08-01 10:55:14 -07:00
David Fifield
5440a4ba16 fmt 2017-07-25 18:59:15 -07:00
David Fifield
db2251345d Close the log file in server. 2017-07-16 15:03:56 -07:00
David Fifield
9ebde38b3f Add a -log option to server-webrtc. 2017-07-16 15:02:41 -07:00
David Fifield
86a244c39e Make client and server-webrtc log in UTC. 2017-07-16 14:58:34 -07:00
David Fifield
0ccb4b7cc8 Have embed.html refresh itself once a day.
This is a hedge against any bugs that may cause the badge to hang when
left running for a long time, and it also means that badges will
effectively check for updated code once a day.
2017-07-15 14:38:01 -07:00
David Fifield
2a46db2c01 Remove broker /ip endpoint.
Doesn't seem to be used anywhere; may have been inherited from flash
proxy.
2017-07-15 14:34:18 -07:00
David Fifield
827972e2bf Customize reflect.go for Snowflake broker.
Don't need Meek-IP.
2017-07-15 14:33:00 -07:00
David Fifield
a150a991d0 Copy appengine directory from meek commit 6057a9e9d6. 2017-07-15 13:45:26 -07:00
David Fifield
afe7716903 Replace --webPort and --tlsPort with a single --addr option. 2017-07-14 20:33:42 -07:00
David Fifield
2d89aa0b7b autocert (Let's Encrypt) for broker.
Replaces --cert and --key with --acme-hostnames and --acme-email.
2017-07-14 20:33:30 -07:00
David Fifield
2242be7a55 Have the broker log in UTC. 2017-07-14 20:07:50 -07:00
David Fifield
1966612113 go fmt 2017-07-14 20:06:00 -07:00
David Fifield
eaa82b8f9a Move flag code out of init into main. 2017-07-14 20:00:25 -07:00