Skip to content

Commit

Permalink
update doc for alpha.7 release (#85)
Browse files Browse the repository at this point in the history
Update for alpha.7.

Co-authored-by: Hendrik Eeckhaut <[email protected]>
  • Loading branch information
yuroitaki and heeckhau authored Oct 4, 2024
1 parent da5d10b commit 7e2974a
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 123 deletions.
48 changes: 26 additions & 22 deletions src/developers/notary_server.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Run a Notary Server

This guide shows you how to run a [notary server](https://github.com/tlsnotary/tlsn/tree/main/notary/server) in an Ubuntu server instance.
This guide shows you how to run a [notary server](https://github.com/tlsnotary/tlsn/tree/main/crates/notary/server) in an Ubuntu server instance.

## Configure Server Setting
All the following settings can be configured in the [config file](https://github.com/tlsnotary/tlsn/blob/main/notary/server/config/config.yaml).
All the following settings can be configured in the [config file](https://github.com/tlsnotary/tlsn/blob/main/crates/notary/server/config/config.yaml).

1. Before running a notary server you need the following files. The default dummy fixtures are for testing only and should never be used in production.
1. Before running a notary server you need the following files. ⚠️ The default dummy fixtures are for testing only and should never be used in production.

| File | Purpose | File Type | Compulsory to change | Sample Command |
----- | ------- | ------------------ | -------------------- | ------------- |
| TLS private key | The private key used for the notary server's TLS certificate to establish TLS connections with provers | TLS private key in PEM format | Yes unless TLS is turned off | <Generated when creating CSR for your Certificate Authority, e.g. using [Certbot](https://certbot.eff.org/)> |
| TLS certificate | The notary server's TLS certificate to establish TLS connections with provers | TLS certificate in PEM format | Yes unless TLS is turned off | <Obtained from your Certificate Authority, e.g. [Let's Encrypt](https://letsencrypt.org/)> |
| Notary signature private key | The private key used for the notary server's signature on the generated transcript of the TLS sessions with provers | A P256 elliptic curve private key in PKCS#8 PEM format | Yes | `openssl genpkey -algorithm EC -out eckey.pem -pkeyopt ec_paramgen_curve:P-256 -pkeyopt ec_param_enc:named_curve` |
| Notary signature public key | The public key used for the notary server's signature on the generated transcript of the TLS sessions with provers | A matching public key in PEM format | Yes | `openssl ec -in eckey.pem -pubout -out eckey.pub` |
2. Expose the notary server port (specified in the config file) on your server networking setting
3. Optionally one can turn on [authorization](https://github.com/tlsnotary/tlsn/tree/main/notary/server#authorization), or turn off [TLS](https://github.com/tlsnotary/tlsn/tree/main/notary/server#optional-tls) if TLS is handled by an external setup, e.g. reverse proxy, cloud setup
| File | Purpose | File Type | Compulsory to change | Sample Command |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ---------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| TLS private key | The private key used for the notary server's TLS certificate to establish TLS connections with provers | TLS private key in PEM format | Yes unless TLS is turned off | <Generated when creating CSR for your Certificate Authority, e.g. using [Certbot](https://certbot.eff.org/)> |
| TLS certificate | The notary server's TLS certificate to establish TLS connections with provers | TLS certificate in PEM format | Yes unless TLS is turned off | <Obtained from your Certificate Authority, e.g. [Let's Encrypt](https://letsencrypt.org/)> |
| Notary signature private key | The private key used for the notary server's signature on the generated transcript of the TLS sessions with provers | A K256 elliptic curve private key in PKCS#8 PEM format | Yes | `openssl genpkey -algorithm EC -out eckey.pem -pkeyopt ec_paramgen_curve:secp256k1 -pkeyopt ec_param_enc:named_curve` |
| Notary signature public key | The public key used for the notary server's signature on the generated transcript of the TLS sessions with provers | A matching public key in PEM format | Yes | `openssl ec -in eckey.pem -conv_form compressed -pubout -out eckey.pub` |

2. Expose the notary server port (specified in the config file) on your server networking setting
3. Optionally one can turn on [authorization](https://github.com/tlsnotary/tlsn/tree/main/crates/notary/server#authorization), or turn off [TLS](https://github.com/tlsnotary/tlsn/tree/main/crates/notary/server#optional-tls) if TLS is handled by an external setup, e.g. reverse proxy, cloud setup

## Using Cargo

Expand All @@ -38,24 +38,24 @@ source ~/.cargo/env
```bash
git checkout tags/<version>
```
5. To configure the [server setting](#configure-server-setting), please refer to the `Using Cargo` section in the repo's [readme](https://github.com/tlsnotary/tlsn/blob/main/notary/server/README.md#using-cargo)
5. To configure the [server setting](#configure-server-setting), please refer to the `Using Cargo` section in the repo's [readme](https://github.com/tlsnotary/tlsn/blob/main/crates/notary/server/README.md#using-cargo)
6. Run the server
```bash
cd tlsn/notary/server
cd crates/notary/server
cargo run --release
```

## Using Docker

1. Install docker following your preferred method [here](https://docs.docker.com/engine/install/ubuntu/)
2. To configure the [server setting](#configure-server-setting), please refer to the `Using Docker` section in the repo's [readme](https://github.com/tlsnotary/tlsn/blob/main/notary/server/README.md#using-docker)
2. To configure the [server setting](#configure-server-setting), please refer to the `Using Docker` section in the repo's [readme](https://github.com/tlsnotary/tlsn/blob/main/crates/notary/server/README.md#using-docker)
3. Run the notary server docker image of your desired version (⚠️ only prover of the same version is supported for now)
```bash
docker run --init -p 127.0.0.1:7047:7047 ghcr.io/tlsnotary/tlsn/notary-server:<version>
```

## API Endpoints
Please refer to the list of all HTTP APIs [here](./notary_server_api.html), and WebSocket APIs [here](https://github.com/tlsnotary/tlsn/tree/main/notary/server#websocket-apis).
Please refer to the list of all HTTP APIs [here](./notary_server_api.html), and WebSocket APIs [here](https://github.com/tlsnotary/tlsn/tree/main/crates/notary/server#websocket-apis).

## PSE Development Notary Server

Expand All @@ -65,12 +65,12 @@ The TLSNotary team hosts a public notary server for development, experimentation

We host multiple versions of the notary server:

| Version | Notary URL | Info/Status | GitHub | Note |
|---------------|---------------------------------------|----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|-----------------------------------------------|
| v0.1.0-alpha.6 | https://notary.pse.dev/v0.1.0-alpha.6 | [info](https://notary.pse.dev/v0.1.0-alpha.6/info)/[health](https://notary.pse.dev/v0.1.0-alpha.6/healthcheck) | [v0.1.0-alpha.6](https://github.com/tlsnotary/tlsn/tree/v0.1.0-alpha.6/notary/server) | [Release notes](https://github.com/tlsnotary/tlsn/releases/tag/v0.1.0-alpha.6) |
| v0.1.0-alpha.5 | https://notary.pse.dev/v0.1.0-alpha.5 | [info](https://notary.pse.dev/v0.1.0-alpha.5/info)/[health](https://notary.pse.dev/v0.1.0-alpha.5/healthcheck) | [v0.1.0-alpha.5](https://github.com/tlsnotary/tlsn/tree/v0.1.0-alpha.5/notary-server) | [Release notes](https://github.com/tlsnotary/tlsn/releases/tag/v0.1.0-alpha.5) |
| v0.1.0-alpha.4 | https://notary.pse.dev/v0.1.0-alpha.4 | [info](https://notary.pse.dev/v0.1.0-alpha.4/info)/[health](https://notary.pse.dev/v0.1.0-alpha.4/healthcheck) | [v0.1.0-alpha.4](https://github.com/tlsnotary/tlsn/tree/v0.1.0-alpha.4/notary-server) | [Release notes](https://github.com/tlsnotary/tlsn/releases/tag/v0.1.0-alpha.4) |
| nightly | https://notary.pse.dev/nightly | [info](https://notary.pse.dev/nightly/info)/[health](https://notary.pse.dev/nightly/healthcheck) | [dev](https://github.com/tlsnotary/tlsn/tree/dev/notary/server) | |
| Version | Notary URL | Info/Status | GitHub | Note |
| -------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| v0.1.0-alpha.7 | https://notary.pse.dev/v0.1.0-alpha.7 | [info](https://notary.pse.dev/v0.1.0-alpha.7/info)/[health](https://notary.pse.dev/v0.1.0-alpha.7/healthcheck) | [v0.1.0-alpha.7](https://github.com/tlsnotary/tlsn/tree/v0.1.0-alpha.7/crates/notary/server) | [Release notes](https://github.com/tlsnotary/tlsn/releases/tag/v0.1.0-alpha.7) |
| v0.1.0-alpha.6 | https://notary.pse.dev/v0.1.0-alpha.6 | [info](https://notary.pse.dev/v0.1.0-alpha.6/info)/[health](https://notary.pse.dev/v0.1.0-alpha.6/healthcheck) | [v0.1.0-alpha.6](https://github.com/tlsnotary/tlsn/tree/v0.1.0-alpha.6/notary/server) | [Release notes](https://github.com/tlsnotary/tlsn/releases/tag/v0.1.0-alpha.6) |
| v0.1.0-alpha.5 | https://notary.pse.dev/v0.1.0-alpha.5 | [info](https://notary.pse.dev/v0.1.0-alpha.5/info)/[health](https://notary.pse.dev/v0.1.0-alpha.5/healthcheck) | [v0.1.0-alpha.5](https://github.com/tlsnotary/tlsn/tree/v0.1.0-alpha.5/notary-server) | [Release notes](https://github.com/tlsnotary/tlsn/releases/tag/v0.1.0-alpha.5) |
| nightly | https://notary.pse.dev/nightly | [info](https://notary.pse.dev/nightly/info)/[health](https://notary.pse.dev/nightly/healthcheck) | [dev](https://github.com/tlsnotary/tlsn/tree/dev/crates/notary/server) | |

For more details on the deployment, refer to this [GitHub Action](https://github.com/tlsnotary/tlsn/blob/main/.github/workflows/cd-server.yml).

Expand All @@ -94,6 +94,10 @@ connect.garmin.com:443
uber.com:443
riders.uber.com:443
m.uber.com:443
wise.com:443
coinbase.com:443
accounts.coinbase.com:443
www.agoda.com:443
```

You can utilize this WebSocket proxy with the following syntax:
Expand Down Expand Up @@ -124,4 +128,4 @@ When running the Notary Server and WebSocket Proxy on Windows Subsystem for Linu

#### For Windows 11 22H2 and Later:

In newer versions of Windows (Windows 11 22H2 and above), networking has been simplified with the introduction of mirrored mode. This mode allows WSL instances to share the host’s network interface, eliminating the need for manual port forwarding configurations. You can enable mirrored mode as recommended by Microsoft [here](https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking).
In newer versions of Windows (Windows 11 22H2 and above), networking has been simplified with the introduction of mirrored mode. This mode allows WSL instances to share the host’s network interface, eliminating the need for manual port forwarding configurations. You can enable mirrored mode as recommended by Microsoft [here](https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking).
2 changes: 1 addition & 1 deletion src/developers/notary_server_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: 'https://raw.githubusercontent.com/tlsnotary/tlsn/main/notary/server/openapi.yaml#/',
url: 'https://raw.githubusercontent.com/tlsnotary/tlsn/main/crates/notary/server/openapi.yaml#/',
dom_id: '#swagger-ui',
});
};
Expand Down
18 changes: 9 additions & 9 deletions src/quick_start/browser_extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The easiest way to install the TLSN browser extension is to use **[Chrome Web St
![](images/chromewebstore.png)

Alternatively, you can install it manually:
1. Download the browser extension from <https://github.com/tlsnotary/tlsn-extension/releases/download/0.1.0.5/tlsn-extension-0.1.0.5.zip>
1. Download the browser extension from <https://github.com/tlsnotary/tlsn-extension/releases/download/0.1.0.700/tlsn-extension-0.1.0.700.zip>
2. Unzip
⚠️ This is a flat zip file, so be careful if you unzip from the command line, this zip file contains many file at the top level
3. Open **Manage Extensions**: <chrome://extensions/>
Expand All @@ -36,9 +36,8 @@ To use the TLSnotary hosted proxy:

To run your own websockify proxy **locally**, run:
```sh
git clone https://github.com/novnc/websockify && cd websockify
./docker/build.sh
docker run -it --rm -p 55688:80 novnc/websockify 80 api.x.com:443
cargo install websocat./docker/build.sh
websocat --binary -v ws-l:0.0.0.0:55688 tcp:api.x.com:443
```
Note the `api.x.com:443` argument on the last line.

Expand All @@ -51,7 +50,7 @@ To create a TLSNotary proof, the browser extension needs a TLSNotary notary serv
To use the TLSNotary team notary server:
1. Open the extension
2. Click **Options**
3. Update Notary API to: `https://notary.pse.dev/v0.1.0-alpha.5`
3. Update Notary API to: `https://notary.pse.dev/v0.1.0-alpha.7`
4. Click **Save**
5. Skip the next section and [continue with the notarization step](#notarize)

Expand All @@ -68,17 +67,17 @@ If you plan to run a local notary server:

1. Clone the TLSNotary repository (defaults to the `main` branch, which points to the latest release):
```shell
git clone --branch v0.1.0-alpha.5 https://github.com/tlsnotary/tlsn.git
git clone https://github.com/tlsnotary/tlsn.git
```
2. Edit the notary server config file (`notary-server/config/config.yaml`) to turn off TLS so that the browser extension can connect to the local notary server without requiring extra steps to accept self-signed certificates in the browser.
2. Edit the notary server config file (`crates/notary/server/config/config.yaml`) to turn off TLS so that the browser extension can connect to the local notary server without requiring extra steps to accept self-signed certificates in the browser (⚠️ this is only for local development purposes — TLS must be used in production).
```yaml
tls:
enabled: false
...
```
3. Run the notary server:
```shell
cd notary-server
cd crates/notary/server
cargo run --release
```

Expand Down Expand Up @@ -111,7 +110,8 @@ If you use the hosted notary server, notarization will take multiple seconds. Yo
When the notarization is ready, you can click **View Proof**. If you did close the UI, you can find the proof by clicking **History** and **View Proof**.
<img width="477" src="images/extension_history.png">

You also have the option to download the proof. You can view this proof later by using the **Verify** button or via <https://explorer.tlsnotary.org/>. You can get the Notary public key by visiting the Notary API specified [above](#notary-server).
<!-- TODO -->
<!-- You also have the option to download the proof. You can view this proof later by using the **Verify** button or via <https://explorer.tlsnotary.org/>. You can get the Notary public key by visiting the Notary API specified [above](#notary-server). -->

## Troubleshooting

Expand Down
Loading

0 comments on commit 7e2974a

Please sign in to comment.