From a9635bb7132a87b6c610bdcb4012443aefe38acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 26 Mar 2022 22:23:06 +0100 Subject: [PATCH 1/6] README: improve "features at a glance" --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4ebc86f..3fb4f1f 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ of sub-implementations for different protocols: Features at a glance: +- Multithreaded design scales with large amounts of traffic +- No database needed (all state is stored in-memory) - IPv4 and IPv6 support -- Optional access control (info hash filtering) -- Built-in TLS support (HTTP and WebTorrent protocols) -- Multithreaded design for handling large amounts of traffic -- All data is stored in-memory, so there is no need to configure a database +- Supports only allowing certain torrents, or forbiddding certain torrents +- Built-in TLS support for HTTP and WebTorrent (no reverse proxy needed) ## Usage From b0f17633d55dd7f88fe8745e26a52b22c42b600c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 26 Mar 2022 22:27:41 +0100 Subject: [PATCH 2/6] README: move down architectural overview, other fixes --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3fb4f1f..3c7800b 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Features at a glance: - IPv4 and IPv6 support - Supports only allowing certain torrents, or forbiddding certain torrents - Built-in TLS support for HTTP and WebTorrent (no reverse proxy needed) +- Licensed under Apache-2.0 ## Usage @@ -84,7 +85,7 @@ Once done, run the tracker: ./target/release/aquatic_ws -c "aquatic-ws-config.toml" ``` -### Configuration values +### Notes on configuration values Starting more `socket_workers` than `request_workers` is recommended. All implementations are quite IO-bound and spend a lot of their time reading from @@ -111,10 +112,6 @@ parsing fails, the program exits. Later failures result in in emitting of an error-level log message, while successful updates of the access list result in emitting of an info-level log message. -## Architectural overview - -![Architectural overview of aquatic](./documents/aquatic-architecture-2022-02-02.svg) - ## Details on implementations ### aquatic_udp: UDP BitTorrent tracker @@ -195,9 +192,13 @@ corresponding load test binary: ./scripts/run-load-test-ws.sh ``` -To fairly compare HTTP performance to opentracker, set keepalive to false in +To fairly compare HTTP performance to opentracker, set `keep_alive` to false in `aquatic_http` settings. +## Architectural overview + +![Architectural overview of aquatic](./documents/aquatic-architecture-2022-02-02.svg) + ## Copyright and license Copyright (c) 2020-2022 Joakim FrostegÄrd From 56b08f09e6a5c392dbd6d89353623b828e91b09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 26 Mar 2022 22:41:45 +0100 Subject: [PATCH 3/6] README: rewrite usage section --- README.md | 67 +++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 3c7800b..d4399d5 100644 --- a/README.md +++ b/README.md @@ -21,24 +21,21 @@ of sub-implementations for different protocols: Features at a glance: -- Multithreaded design scales with large amounts of traffic -- No database needed (all state is stored in-memory) +- Multithreaded design for handling large amounts of traffic +- All data is stored in-memory (no database needed) - IPv4 and IPv6 support -- Supports only allowing certain torrents, or forbiddding certain torrents -- Built-in TLS support for HTTP and WebTorrent (no reverse proxy needed) +- Supports forbidding/allowing info hashes +- Built-in TLS support (no reverse proxy needed) - Licensed under Apache-2.0 ## Usage -### Prerequisites - -- Install Rust with [rustup](https://rustup.rs/) (stable is recommended) -- Install cmake with your package manager (e.g., `apt-get install cmake`) -- Clone this git repository and enter it - ### Compiling -Compile the implementations that you are interested in: +- Install Rust with [rustup](https://rustup.rs/) (latest stable release is recommended) +- Install cmake with your package manager (e.g., `apt-get install cmake`) +- Clone this git repository and enter the directory +- Build the implementations that you are interested in: ```sh # Tell Rust to enable support for all CPU extensions present on current CPU @@ -51,16 +48,7 @@ cargo build --release -p aquatic_http cargo build --release -p aquatic_ws ``` -### Running - -Unless you're planning to only run `aquatic_udp`, make sure locked memory -limits are sufficient. You can do this by adding the following lines to -`/etc/security/limits.conf`, and then logging out and back in: - -``` -* hard memlock 512 -* soft memlock 512 -``` +### Configuring Generate configuration files. They come with comments and differ between protocols. @@ -77,22 +65,8 @@ Note that both `aquatic_http` and `aquatic_ws` require configuring TLS certificate and private key files. More details are available in the respective configuration files. -Once done, run the tracker: - -```sh -./target/release/aquatic_udp -c "aquatic-udp-config.toml" -./target/release/aquatic_http -c "aquatic-http-config.toml" -./target/release/aquatic_ws -c "aquatic-ws-config.toml" -``` - -### Notes on configuration values - -Starting more `socket_workers` than `request_workers` is recommended. All -implementations are quite IO-bound and spend a lot of their time reading from -and writing to sockets. This is handled by the socket workers, which -also do parsing, serialisation and access control. They pass announce and -scrape requests to the request workers, which update internal tracker state -and pass back responses for sending. +For optimal performance, start at least as many `request_workers` as +`socket_workers`. #### Access control @@ -112,6 +86,25 @@ parsing fails, the program exits. Later failures result in in emitting of an error-level log message, while successful updates of the access list result in emitting of an info-level log message. +### Running + +If you're running `aquatic_http` or `aquatic_ws`, make sure locked memory +limits are sufficient. You can do this by adding the following lines to +`/etc/security/limits.conf`, and then logging out and back in: + +``` +* hard memlock 512 +* soft memlock 512 +``` + +Once done, start the application: + +```sh +./target/release/aquatic_udp -c "aquatic-udp-config.toml" +./target/release/aquatic_http -c "aquatic-http-config.toml" +./target/release/aquatic_ws -c "aquatic-ws-config.toml" +``` + ## Details on implementations ### aquatic_udp: UDP BitTorrent tracker From 05bbfbc879616a169ab26c0f6eabc1ace32412ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 26 Mar 2022 23:03:27 +0100 Subject: [PATCH 4/6] README: mention CI testing of full file transfers --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d4399d5..fffbb08 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Features at a glance: - IPv4 and IPv6 support - Supports forbidding/allowing info hashes - Built-in TLS support (no reverse proxy needed) +- Automated CI testing of full file transfers - Licensed under Apache-2.0 ## Usage From f20152f65813781204d68ac3578b0c08f7f882e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 26 Mar 2022 23:04:45 +0100 Subject: [PATCH 5/6] Fix comments in file transfer CI script --- .github/actions/test-transfer/entrypoint.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/test-transfer/entrypoint.sh b/.github/actions/test-transfer/entrypoint.sh index f9095ea..3b82149 100755 --- a/.github/actions/test-transfer/entrypoint.sh +++ b/.github/actions/test-transfer/entrypoint.sh @@ -1,8 +1,7 @@ #!/bin/bash # -# Test that file transfers work with aquatic_http (with and without TLS) -# aquatic_udp and experimentally aquatic_ws (with TLS). -# +# Test that file transfers work over all protocols. +# # IPv6 is unfortunately disabled by default in Docker # (see sysctl net.ipv6.conf.lo.disable_ipv6) From 3839fd7d4f854ab5595a81af11d3c99d519e7466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 26 Mar 2022 23:08:13 +0100 Subject: [PATCH 6/6] README: improve wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fffbb08..2664688 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Features at a glance: - Supports forbidding/allowing info hashes - Built-in TLS support (no reverse proxy needed) - Automated CI testing of full file transfers -- Licensed under Apache-2.0 +- Distributed under Apache-2.0 license ## Usage