diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..378203c457 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,29 @@ +name: Deploy docs +on: + push: + branches: + - main + - pr/** # just for testing + tags: + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - run: echo snapshot=$(echo ${{ github.ref }} | sed -E 's|refs/[^/]+/||') >> $GITHUB_ENV + - run: echo docs_dir=docs-build/${{ env.snapshot }} >> $GITHUB_ENV + - run: echo documentation directory=${{ env.docs_dir }} + - run: brew install mdbook + - run: mkdir -p ${{ env.docs_dir }} + - run: $(cd docs && mdbook build -d ../${{ env.docs_dir }}/book) + - run: cargo doc --workspace --no-deps + - run: mv target/doc ${{ env.docs_dir }}/api + - uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: docs-build + CLEAN: false diff --git a/.gitignore b/.gitignore index cc372f1969..ef208580e5 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ dependencies-src.zip quilkin-*.zip /quilkin.yaml +/docs/book ### Rust template # Generated by Cargo diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 0000000000..420102ca06 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,7 @@ +[book] +language = "en" +multilingual = false +src = "src" +title = "Quilkin Book" + +[output.html] diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md new file mode 100644 index 0000000000..e4c0be2a76 --- /dev/null +++ b/docs/src/SUMMARY.md @@ -0,0 +1,22 @@ +# Summary + +- [Introduction](./introduction.md) +- [Quickstart]() + - [Netcat](./quickstart-netcat.md) + - [Agones + Xonotic](./quickstart-agones-xonotic.md) +- [Usage](./using.md) +- [Session](./session.md) +- [Proxy](./proxy.md) + - [Proxy Configuration](./proxy-configuration.md) +- [Filters](./filters.md) + - [Capture Bytes](./filters/capture_bytes.md) + - [Compress](./filters/compress.md) + - [Debug](./filters/debug.md) + - [Load Balancer](./filters/load_balancer.md) + - [Local Rate Limit](./filters/local_rate_limit.md) + - [Token Router](./filters/token_router.md) + - [Writing Custom Filters](./filters/writing_custom_filters.md) +- [Integrations](./integrations.md) +- [Administration](./admin.md) +- [FAQ](./FAQ.md) +- [xDS](./xds.md) diff --git a/docs/admin.md b/docs/src/admin.md similarity index 100% rename from docs/admin.md rename to docs/src/admin.md diff --git a/docs/faq.md b/docs/src/faq.md similarity index 100% rename from docs/faq.md rename to docs/src/faq.md diff --git a/docs/extensions/filters/filters.md b/docs/src/filters.md similarity index 100% rename from docs/extensions/filters/filters.md rename to docs/src/filters.md diff --git a/docs/extensions/filters/capture_bytes.md b/docs/src/filters/capture_bytes.md similarity index 100% rename from docs/extensions/filters/capture_bytes.md rename to docs/src/filters/capture_bytes.md diff --git a/docs/extensions/filters/compress.md b/docs/src/filters/compress.md similarity index 100% rename from docs/extensions/filters/compress.md rename to docs/src/filters/compress.md diff --git a/docs/extensions/filters/concatenate_bytes.md b/docs/src/filters/concatenate_bytes.md similarity index 100% rename from docs/extensions/filters/concatenate_bytes.md rename to docs/src/filters/concatenate_bytes.md diff --git a/docs/extensions/filters/debug.md b/docs/src/filters/debug.md similarity index 100% rename from docs/extensions/filters/debug.md rename to docs/src/filters/debug.md diff --git a/docs/extensions/filters/load_balancer.md b/docs/src/filters/load_balancer.md similarity index 100% rename from docs/extensions/filters/load_balancer.md rename to docs/src/filters/load_balancer.md diff --git a/docs/extensions/filters/local_rate_limit.md b/docs/src/filters/local_rate_limit.md similarity index 100% rename from docs/extensions/filters/local_rate_limit.md rename to docs/src/filters/local_rate_limit.md diff --git a/docs/extensions/filters/token_router.md b/docs/src/filters/token_router.md similarity index 100% rename from docs/extensions/filters/token_router.md rename to docs/src/filters/token_router.md diff --git a/docs/extensions/filters/writing_custom_filters.md b/docs/src/filters/writing_custom_filters.md similarity index 99% rename from docs/extensions/filters/writing_custom_filters.md rename to docs/src/filters/writing_custom_filters.md index a594b96835..6db1b727b7 100644 --- a/docs/extensions/filters/writing_custom_filters.md +++ b/docs/src/filters/writing_custom_filters.md @@ -1,3 +1,5 @@ +# Writing Custom Filters + Quilkin provides an extensible implementation of [Filters] that allows us to plug in custom implementations to fit our needs. This document provides an overview of the API and how we can go about writing our own [Filters]. diff --git a/docs/integrations.md b/docs/src/integrations.md similarity index 97% rename from docs/integrations.md rename to docs/src/integrations.md index 18629b0ffb..9a041e8fc2 100644 --- a/docs/integrations.md +++ b/docs/src/integrations.md @@ -8,7 +8,7 @@ on how you can use Quilkin in your multiplayer game networking architecture. ## Server Proxy as a Sidecar -``` +```text + | Internet @@ -49,7 +49,7 @@ and metric information that comes with Quilkin. ## Client Proxy to Sidecar Server Proxy -``` +```text + | Internet @@ -85,7 +85,7 @@ advantage of Client Proxy functionality. ## Client Proxy to Separate Server Proxies Pools -``` +```text + + | | Internet Private @@ -134,9 +134,9 @@ while also providing the most redundancy and security for your dedicated game se ## What Next? -* Have a look at the [example configurations](../examples) for basic configuration examples. +* Have a look at the [example configurations](https://github.com/googleforgames/quilkin/blob/main/examples) for basic configuration examples. * Review the [set of filters](./extensions/filters/filters.md) that are available. --- -Diagrams powered by http://asciiflow.com/ \ No newline at end of file +Diagrams powered by http://asciiflow.com/ diff --git a/docs/README.md b/docs/src/introduction.md similarity index 89% rename from docs/README.md rename to docs/src/introduction.md index 24998ba26a..3385cd0120 100644 --- a/docs/README.md +++ b/docs/src/introduction.md @@ -11,7 +11,7 @@ It is designed to be used behind game clients as well as in front of dedicated g Quilkin's aim is to pull the above functionality out of bespoke, monolithic dedicated game servers and clients, and provide standard, composable modules that can be reused across a wide set of multiplayer games, so that game -developers can instead focus on their game specific aspects of building a multiplayer game. +developers can instead focus on their game specific aspects of building a multiplayer game. ## Why use Quilkin? @@ -33,12 +33,12 @@ Quilkin incorporates these abilities: * Non-transparent proxying of UDP data, the internal state of your game architecture is not visible to bad actors. * Out of the box metrics for UDP packet information. * Composable tools for access control and security. -* Able to be utilised as a standalone binary, with no client/server changes required or as a Rust library +* Able to be utilised as a standalone binary, with no client/server changes required or as a Rust library depending on how deep an integration you wish for your system. * Can be integrated with C/C++ code bases via FFI. ## What Next? * Read the [usage guide](./using.md) -* Have a look at the [example configurations](../examples) for basic configuration examples. +* Have a look at the [example configurations](https://github.com/googleforgames/quilkin/blob/main/examples) for basic configuration examples. * Check out the [example integration patterns](./integrations.md). diff --git a/docs/proxy-configuration.md b/docs/src/proxy-configuration.md similarity index 97% rename from docs/proxy-configuration.md rename to docs/src/proxy-configuration.md index a0263285cc..cd4e9177bd 100644 --- a/docs/proxy-configuration.md +++ b/docs/src/proxy-configuration.md @@ -108,5 +108,5 @@ definitions: - address ``` -[examples]: ../examples +[examples]: https://github.com/googleforgames/quilkin/blob/main/examples diff --git a/docs/proxy.md b/docs/src/proxy.md similarity index 100% rename from docs/proxy.md rename to docs/src/proxy.md diff --git a/docs/quickstart-agones-xonotic.md b/docs/src/quickstart-agones-xonotic.md similarity index 96% rename from docs/quickstart-agones-xonotic.md rename to docs/src/quickstart-agones-xonotic.md index 74375317fa..3a2780327c 100644 --- a/docs/quickstart-agones-xonotic.md +++ b/docs/src/quickstart-agones-xonotic.md @@ -53,7 +53,7 @@ Let's take a look at some metrics that Quilkin outputs. Grab the name of the GameServer you connected to before, and replace the `${gameserver}` value below, and run the command. This will forward the [admin](./admin.md) interface to localhost. -``` +```shell kubectl port-forward ${gameserver} 9091 ``` @@ -132,5 +132,5 @@ kubectl delete -f https://raw.githubusercontent.com/googleforgames/quilkin/main/ ## What's Next? -* Have a look at the [examples](./examples) folder for configuration and usage examples. -* Explore the [proxy configuration reference](./docs/proxy-configuration.md) for other configuration options. \ No newline at end of file +* Have a look at the [examples](https://github.com/googleforgames/quilkin/blob/main/examples) folder for configuration and usage examples. +* Explore the [proxy configuration reference](./docs/proxy-configuration.md) for other configuration options. diff --git a/docs/quickstart-netcat.md b/docs/src/quickstart-netcat.md similarity index 90% rename from docs/quickstart-netcat.md rename to docs/src/quickstart-netcat.md index 2887be1f56..b2e460dbb5 100644 --- a/docs/quickstart-netcat.md +++ b/docs/src/quickstart-netcat.md @@ -2,7 +2,7 @@ ## Requirements -* A *nix terminal +* A \*nix terminal * A binary release of Quilkin from the [Github releases page](https://github.com/googleforgames/quilkin/releases) * [ncat](https://nmap.org/ncat/guide/) * [netcat](http://netcat.sourceforge.net/) @@ -32,7 +32,7 @@ static: - address: 127.0.0.1:8000 ``` -This configuration will start Quilkin on the default port of 7000, and it will redirect all incoming UDP traffic to +This configuration will start Quilkin on the default port of 7000, and it will redirect all incoming UDP traffic to a single endpoint of 127.0.0.1, port 8000. Let's start Quilkin with the above configuration: @@ -75,6 +75,6 @@ Congratulations! You have successfully routed a UDP packet and back again with Q What's next? * Run through the [Quilkin with Agones quickstart](./quickstart-agones-xonotic.md). -* Have a look at some of [the examples](../examples) we have. -* Check out the [proxy configuration reference](./proxy-configuration.md) to what other configuration options are +* Have a look at some of [the examples](https://github.com/googleforgames/quilkin/blob/main/examples) we have. +* Check out the [proxy configuration reference](./proxy-configuration.md) to what other configuration options are available. diff --git a/docs/session.md b/docs/src/session.md similarity index 100% rename from docs/session.md rename to docs/src/session.md diff --git a/docs/using.md b/docs/src/using.md similarity index 100% rename from docs/using.md rename to docs/src/using.md diff --git a/docs/xds.md b/docs/src/xds.md similarity index 100% rename from docs/xds.md rename to docs/src/xds.md diff --git a/src/lib.rs b/src/lib.rs index ba25207764..b7fd119739 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,13 +39,13 @@ pub use quilkin_macros::include_proto; #[cfg(doctest)] mod external_doc_tests { - #![doc = include_str!("../docs/extensions/filters/filters.md")] - #![doc = include_str!("../docs/extensions/filters/writing_custom_filters.md")] - #![doc = include_str!("../docs/extensions/filters/load_balancer.md")] - #![doc = include_str!("../docs/extensions/filters/local_rate_limit.md")] - #![doc = include_str!("../docs/extensions/filters/debug.md")] - #![doc = include_str!("../docs/extensions/filters/concatenate_bytes.md")] - #![doc = include_str!("../docs/extensions/filters/capture_bytes.md")] - #![doc = include_str!("../docs/extensions/filters/token_router.md")] - #![doc = include_str!("../docs/extensions/filters/compress.md")] + #![doc = include_str!("../docs/src/filters.md")] + #![doc = include_str!("../docs/src/filters/writing_custom_filters.md")] + #![doc = include_str!("../docs/src/filters/load_balancer.md")] + #![doc = include_str!("../docs/src/filters/local_rate_limit.md")] + #![doc = include_str!("../docs/src/filters/debug.md")] + #![doc = include_str!("../docs/src/filters/concatenate_bytes.md")] + #![doc = include_str!("../docs/src/filters/capture_bytes.md")] + #![doc = include_str!("../docs/src/filters/token_router.md")] + #![doc = include_str!("../docs/src/filters/compress.md")] }