snowflake/proxy
Cecylia Bocovich e77baabdcf Add a timeout to check if datachannel opened
This is similar to the deadlock bug in the proxy-go instances. If the
proxy-pair sends an answer to the broker, it previously assumed that the
datachannel would be opened and the pair reused only once the
datachannel closed. However, sometimes the datachannel never opens due
to ICE errors or a misbehaving/buggy client causing the proxy to
infinitely loop and the proxy-pair to remain active.

This commit reuses the pair.running attribute to indicate whether or not
the datachannel has been opened and sets a timeout to close the
proxy-pair if it has not been opened by that time.
2019-08-08 10:36:28 -04:00
..
spec Remove tests referring to BadgeUI 2019-07-27 12:01:03 -04:00
static Control statusimg using CSS, rather than setting an img src. 2019-07-31 19:09:46 -06:00
webext Control statusimg using CSS, rather than setting an img src. 2019-07-31 19:09:46 -06:00
.eslintignore Cleanup lints identified by eslint 2019-07-10 10:58:29 +02:00
.eslintrc.json Cleanup lints identified by eslint 2019-07-10 10:58:29 +02:00
broker.js Cleanup lints identified by eslint 2019-07-10 10:58:29 +02:00
config.js Use freehaven.net domains for bridge and broker 2019-07-26 09:58:34 -04:00
init-badge.js Control statusimg using CSS, rather than setting an img src. 2019-07-31 19:09:46 -06:00
init-node.js Cleanup lints identified by eslint 2019-07-10 10:58:29 +02:00
init-testing.js Move more UI code to use specific sites 2019-07-27 12:01:03 -04:00
init-webext.js Move icons/ to assets/ 2019-07-31 17:59:48 -04:00
make.js Move icons/ to assets/ 2019-07-31 17:59:48 -04:00
package.json Lint with eslint 2019-07-10 10:58:29 +02:00
proxypair.js Add a timeout to check if datachannel opened 2019-08-08 10:36:28 -04:00
README.md Remove mentions of snowflake.html 2019-07-31 18:14:00 -04:00
shims.js Bug 31126: Use URLSearchParams instead of Query.parse. 2019-07-18 18:29:59 -06:00
snowflake.js Add a timeout to check if datachannel opened 2019-08-08 10:36:28 -04:00
ui.js Move more UI code to use specific sites 2019-07-27 12:01:03 -04:00
util.js Remove Util.mightBeTBB 2019-07-27 12:01:03 -04:00
websocket.js Use URLSearchParams.toString instead of Query.buildString. 2019-07-18 18:30:25 -06:00

This is the browser proxy component of Snowflake.

Embedding

See https://snowflake.torproject.org/ for more info:

<iframe src="https://snowflake.torproject.org/embed.html" width="88" height="16" frameborder="0" scrolling="no"></iframe>

Building

npm run build

Testing

Unit testing with Jasmine are available with:

npm install
npm test

To run locally, start an http server in build/ and navigate to /embed.html.

Preparing to deploy

Background information:

You need to be in LDAP group "snowflake" and have set up an SSH key with your LDAP account. In your ~/.ssh/config file, you should have something like:

Host staticiforme
HostName staticiforme.torproject.org
User <your user name>
ProxyJump people.torproject.org
IdentityFile ~/.ssh/tor

Deploying

npm run build

Do a "dry run" rsync with -n to check that only expected files are being changed. If you don't understand why a file would be updated, you can add the -i option to see the reason.

rsync -n --delete -crv build/ staticiforme:/srv/snowflake.torproject.org/htdocs/

If it looks good, then repeat the rsync without -n.

rsync --delete -crv build/ staticiforme:/srv/snowflake.torproject.org/htdocs/

Then run the command to copy the new files to the live web servers:

ssh staticiforme 'static-update-component snowflake.torproject.org'

Parameters

With no parameters, snowflake uses the default relay snowflake.freehaven.net:443 and uses automatic signaling with the default broker at https://snowflake-broker.freehaven.net/.