From 37b3aea81a95a24a348fa18d7d59239d924967e6 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Wed, 8 Nov 2023 15:47:14 -0500 Subject: [PATCH] Update READMEs for distributor and wasm crates --- crates/lox-distributor/README.md | 40 ++++++++++++++++++------------ crates/lox-distributor/config.json | 2 +- crates/lox-wasm/README.md | 3 +++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/crates/lox-distributor/README.md b/crates/lox-distributor/README.md index 884f417..7fbacbf 100644 --- a/crates/lox-distributor/README.md +++ b/crates/lox-distributor/README.md @@ -38,7 +38,7 @@ The rdsys request `rtype` has the following fields: "name": "lox", "token": "LoxApiTokenPlaceholder", "types": [ - "obfs2", + "obfs4", "scramblesuit" ] } @@ -73,28 +73,36 @@ Rolling back to a previous version of the database is possible by passing the `roll_back_date` flag at runtime and providing the date/time as a `%Y-%m-%d_%H:%M:%S` string. This argument should be passed if the `LoxContext` should be rolled back to a previous state due to, for example, a mass blocking event that is likely not due to Lox user behaviour. If the exact roll back date/time is not known, the last db entry within 24 hours from the passed `roll_back_date` will be used or else the program will fail gracefully. -## Test Run +## Distributor Staging Environnment -For testing purposes, you will need a running instance of [rdsys](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) as well as a running Lox client. +The lox distributor is currently deployed for testing on `rdsys-frontend-01`. +Client requests can be made to this distributor by following the instructions in the [`lox-wasm` README](../lox-wasm/README.md/#testing) + +## Running the Lox Distributor Locally + +For testing purposes, you will need a locally running instance of [rdsys](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) as well as a running [Lox client](../lox-wasm/). ### Run rdsys locally -First clone rdsys from [here](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) then change into the backend directory: - -``` -cd rdsys/cmd/backend -``` - -Finally run rdsys: - -``` - ./backend --config config.json -``` +First clone rdsys from [here](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) then follow the instructions in the [README](https://gitlab.torproject.org/tpo/anti-censorship/rdsys/-/blob/main/README.md) to create a locally running rdsys instance with fake bridge descriptors. ### Run Lox Distributor locally -Simply run `cargo run -- config.json` :) +The easiest way to test with rdsys is to adjust the [config.json](config.json) so that the `rtype` reads as follows: +``` + "rtype": { + "endpoint": "http://127.0.0.1:7100/resources", + "name": "https", + "token": "HttpsApiTokenPlaceholder", + "types": [ + "obfs4", + "snowflake" + ] + } +``` + +Then simply run `cargo run -- config.json` :) ### Run a Lox client locally -First clone lox-wasm from [here](https://gitlab.torproject.org/tpo/anti-censorship/lox/lox-wasm). Follow the instructions in the [README](https://gitlab.torproject.org/tpo/anti-censorship/lox/lox-wasm/-/blob/main/README.md) to build and test the Lox client. +First clone lox-wasm from [here](https://gitlab.torproject.org/tpo/anti-censorship/lox/lox-wasm). Follow the instructions in the [README](../lox-wasm/README.md) to build and test the Lox client. diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index 90538e2..a6feb7e 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -13,7 +13,7 @@ "token": "LoxApiTokenPlaceholder", "types": [ "obfs4", - "scramblesuit" + "snowflake" ] } } \ No newline at end of file diff --git a/crates/lox-wasm/README.md b/crates/lox-wasm/README.md index 3f0ffb7..ac8fc3b 100644 --- a/crates/lox-wasm/README.md +++ b/crates/lox-wasm/README.md @@ -16,6 +16,9 @@ wasm-pack build --target web # Testing + +### Testing Locally + The provided `index.html` file can be used for testing the lox bindings. First, follow the instructions to [run a lox server](https://gitlab.torproject.org/cohosh/lox-server). Then, spin up a simple local webserver in the current directory: