2016-01-11 10:30:49 -08:00
This is the browser proxy component of Snowflake.
2016-02-10 13:54:07 -08:00
### Embedding
2018-04-15 16:43:08 -07:00
See https://snowflake.torproject.org/ for more info:
2016-02-10 13:54:07 -08:00
```
2018-04-15 16:43:08 -07:00
< iframe src = "https://snowflake.torproject.org/embed.html" width = "88" height = "16" frameborder = "0" scrolling = "no" > < / iframe >
2016-02-10 13:54:07 -08:00
```
2018-04-15 17:12:55 -07:00
### Building
```
2019-07-06 16:41:56 +02:00
npm run build
2018-04-15 17:12:55 -07:00
```
2016-02-10 13:54:07 -08:00
### Testing
2016-01-11 10:30:49 -08:00
2016-02-04 14:13:03 -08:00
Unit testing with Jasmine are available with:
2016-01-11 10:30:49 -08:00
```
2016-03-14 20:46:52 -07:00
npm install
npm test
2016-01-11 10:30:49 -08:00
```
2019-07-31 18:14:00 -04:00
To run locally, start an http server in `build/` and navigate to `/embed.html` .
2016-01-11 10:30:49 -08:00
2019-07-27 09:53:09 -06:00
### Preparing to deploy
Background information:
* https://bugs.torproject.org/23947#comment:8
* https://help.torproject.org/tsa/doc/static-sites/
* https://help.torproject.org/tsa/doc/ssh-jump-host/
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.
```
2019-10-11 10:37:06 -06:00
rsync -n --chown=:snowflake --chmod ug=rw,D+x --perms --delete -crv build/ staticiforme:/srv/snowflake.torproject.org/htdocs/
2019-07-27 09:53:09 -06:00
```
If it looks good, then repeat the rsync without `-n` .
```
2019-10-11 10:37:06 -06:00
rsync --chown=:snowflake --chmod ug=rw,D+x --perms --delete -crv build/ staticiforme:/srv/snowflake.torproject.org/htdocs/
2019-07-27 09:53:09 -06:00
```
2019-10-11 10:37:06 -06:00
You can ignore errors of the form `rsync: failed to set permissions on "<dirname>/": Operation not permitted (1)` .
2019-07-27 09:53:09 -06:00
Then run the command to copy the new files to the live web servers:
```
ssh staticiforme 'static-update-component snowflake.torproject.org'
```
2016-01-23 09:27:23 -08:00
### Parameters
With no parameters,
2019-07-27 09:30:29 -06:00
snowflake uses the default relay `snowflake.freehaven.net:443` and
2016-01-23 09:27:23 -08:00
uses automatic signaling with the default broker at
2019-07-27 09:30:29 -06:00
`https://snowflake-broker.freehaven.net/` .