snowflake/proxy
Cecylia Bocovich 9b470fbe4b Removed "janky" snowflake state machine
The only place it was used was in window.onpageunload, and we have a
better way of determining if the proxy is active there (through the ui).

I also removed that code from the webextension since the proxy won't
stop running unless you close the browser and after testing it looks
like that code doesn't notify the user anyway.
2019-10-31 11:59:13 -04:00
..
spec Removed "janky" snowflake state machine 2019-10-31 11:59:13 -04:00
static Include language name with along with code 2019-10-16 12:32:45 -04:00
translation@120578ec9d bump version to 0.0.13 2019-10-28 10:55:51 -04:00
webext bump version to 0.0.13 2019-10-28 10:55:51 -04:00
.eslintignore Cleanup lints identified by eslint 2019-07-10 10:58:29 +02:00
.eslintrc.json Enforce consistent indentation in js 2019-08-27 18:19:51 -04:00
broker.js Cleanup lints identified by eslint 2019-07-10 10:58:29 +02:00
config.js Increase proxy poll interval to 300 s. 2019-10-28 10:51:49 -04:00
init-badge.js Removed "janky" snowflake state machine 2019-10-31 11:59:13 -04:00
init-node.js Cleanup lints identified by eslint 2019-07-10 10:58:29 +02:00
init-testing.js Removed "janky" snowflake state machine 2019-10-31 11:59:13 -04:00
init-webext.js Removed "janky" snowflake state machine 2019-10-31 11:59:13 -04:00
make.js Include language name with along with code 2019-10-16 12:32:45 -04:00
package.json Include language name with along with code 2019-10-16 12:32:45 -04:00
proxypair.js Removed "janky" snowflake state machine 2019-10-31 11:59:13 -04:00
README.md Add --chown=:snowflake to rsync commands. 2019-10-11 10:37:06 -06:00
shims.js Bug 31126: Use URLSearchParams instead of Query.parse. 2019-07-18 18:29:59 -06:00
snowflake.js Removed "janky" snowflake state machine 2019-10-31 11:59:13 -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 Move probe to WS class for reuse in the badge 2019-09-30 18:42:57 -04: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 --chown=:snowflake --chmod ug=rw,D+x --perms --delete -crv build/ staticiforme:/srv/snowflake.torproject.org/htdocs/

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

rsync --chown=:snowflake --chmod ug=rw,D+x --perms --delete -crv build/ staticiforme:/srv/snowflake.torproject.org/htdocs/

You can ignore errors of the form rsync: failed to set permissions on "<dirname>/": Operation not permitted (1).

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/.