diff --git a/docs/1index.md b/docs/1index.md new file mode 100644 index 00000000..24b26c2a --- /dev/null +++ b/docs/1index.md @@ -0,0 +1,22 @@ +# WaterWall Documentation + +WaterWall is a simple core for tunneling and even direct user-server connections. based on high-performance, fully customizeable nodes for creating any kind of protocol without writing code for it. + + +## Contents + +- [شروع](Begin) +- [فایل core.json](file-core.json) +- [فایل config.json](file-config.json) +- [Port to Port Tunnel](Direct-Port-To-Port) +- [Tls Tunnel](Tls-Tunnel) +- [PreConnect Node](PreConnect) +- [Http2 Mux Grpc Nodes](Http2-Mux-Grpc) +- [Reverse Tunnel](Reverse-Tunnel) +- [Reality Direct Tunnel](Reality-Direct-Tunnel) +- [Reality Reverse Tunnel](Reality-Reverse-Tunnel) +- [Bgp4 Tunnel or Direct](Bgp4-Tunnel-or-Direct) +- [Direct Trojan Protocol with Anti tls in tls](Trojan) +- [HalfDuplex Tunnel or Direct](HalfDuplex-Tunnel-or-Direct) +- [Load balancing](Load-Balancing) +- [CDN Tunnel Direct or Reverse](CDN-Tunnel) diff --git a/docs/examples/trojan_server/config_trojan.json b/docs/examples/trojan_server/config_trojan.json deleted file mode 100644 index 50813461..00000000 --- a/docs/examples/trojan_server/config_trojan.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "trojan_server", - "nodes": [ - { - "name": "tcp_inbound", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": 443, - "nodelay": true - }, - "next": "ssl_server" - }, - { - "name": "ssl_server", - "type": "OpenSSLServer", - "settings": { - "anti-tls-in-tls": true, - "cert-file": "fullchain.pem", - "key-file": "privkey.pem", - "alpns": [ - { - "value": "http/1.1", - "next": "node->next" - }, - { - "value": "h2", - "next": "node->next" - } - ], - "fallback": "tls_fallback" - }, - "next": "my-trojan-auth" - }, - { - "name": "my-trojan-auth", - "type": "TrojanAuthServer", - "settings": { - "fallback": "trojan_fallback", - "fallback-intence-delay": 50, - "users": [ - { - "name": "sample_user", - "uid": "my_awesome_password", - "enable": true - } - ] - }, - "next": "trojan_socks" - }, - { - "name": "trojan_socks", - "type": "TrojanSocksServer", - "settings": {}, - "next": "users_outbound" - }, - { - "name": "users_outbound", - "type": "Connector", - "settings": { - "nodelay": true, - "address": "dest_context->address", - "port": "dest_context->port" - } - }, - { - "name": "tls_fallback", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "demo.nginx.com", - "port": 443 - } - }, - { - "name": "trojan_fallback", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "httpforever.com", - "port": 80 - } - } - ] -} \ No newline at end of file diff --git a/docs/examples/tunnel/direct/tcp/multiport/config_client.json b/docs/examples/tunnel/direct/tcp/multiport/config_client.json deleted file mode 100644 index 2b10b82d..00000000 --- a/docs/examples/tunnel/direct/tcp/multiport/config_client.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "config_tcp_multiport", - "nodes": [ - { - "name": "input", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": [23,65535], - "nodelay": true - }, - "next": "output" - }, - { - "name": "output", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "1.1.1.1", - "port": "src_context->port" - } - } - ] -} \ No newline at end of file diff --git a/docs/examples/tunnel/direct/tcp/multiport/readme.md b/docs/examples/tunnel/direct/tcp/multiport/readme.md deleted file mode 100644 index 87e54b52..00000000 --- a/docs/examples/tunnel/direct/tcp/multiport/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# MultiPort tcp - - -assumptions: - -> port range: 23 - 65535 -> ip foreign server : 1.1.1.1 - ---- - -forward port X to 1.1.1.1:X - - diff --git a/docs/examples/tunnel/direct/tcp/port_to_port/config_client.json b/docs/examples/tunnel/direct/tcp/port_to_port/config_client.json deleted file mode 100644 index 4c2ebd51..00000000 --- a/docs/examples/tunnel/direct/tcp/port_to_port/config_client.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "config_tcp_port_to_port", - "nodes": [ - { - "name": "inbound", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": 443, - "nodelay": true - }, - "next": "outbound" - }, - - - { - "name": "outbound", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "1.1.1.1", - "port": 443 - } - } - ] -} diff --git a/docs/examples/tunnel/direct/tcp/port_to_port/readme.md b/docs/examples/tunnel/direct/tcp/port_to_port/readme.md deleted file mode 100644 index b865d097..00000000 --- a/docs/examples/tunnel/direct/tcp/port_to_port/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# SinglePort Tcp - - -assumptions: - -> port: 443 -> ip foreign server : 1.1.1.1 - ---- - -forward port 443 to 1.1.1.1:443 - - diff --git a/docs/examples/tunnel/direct/tls/multiport/config_client.json b/docs/examples/tunnel/direct/tls/multiport/config_client.json deleted file mode 100644 index 655e3637..00000000 --- a/docs/examples/tunnel/direct/tls/multiport/config_client.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "config_tls_tunnel_client_multiport", - "nodes": [ - { - "name": "inbound", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": [80, 65535], - "nodelay": true - }, - "next": "header" - }, - { - "name": "header", - "type": "HeaderClient", - "settings": { - "data": "src_context->port" - }, - "next": "pre_client" - }, - { - "name": "pre_client", - "type": "PreConnectClient", - "settings": { - "minimum-unused": 8 - }, - "next": "ssl_client" - }, - { - "name": "ssl_client", - "type": "OpenSSLClient", - "settings": { - "sni": "mydomain.com", - "verify": true, - "alpn": "http/1.1" - }, - "next": "tcp_outbound" - }, - { - "name": "tcp_outbound", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "mydomain.com", - "port": 443 - } - } - ] -} \ No newline at end of file diff --git a/docs/examples/tunnel/direct/tls/multiport/config_server.json b/docs/examples/tunnel/direct/tls/multiport/config_server.json deleted file mode 100644 index b8f18aef..00000000 --- a/docs/examples/tunnel/direct/tls/multiport/config_server.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "config_tls_tunnel_server_multiport", - "nodes": [ - { - "name": "inbound", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": 443, - "nodelay": true - }, - "next": "ssl_server" - }, - { - "name": "ssl_server", - "type": "OpenSSLServer", - "settings": { - "cert-file": "fullchain.pem", - "key-file": "privkey.pem", - "alpns": [ - { - "value": "http/1.1", - "next": "node->next" - } - ] - }, - "next": "header" - }, - { - "name": "header", - "type": "HeaderServer", - "settings": { - "override": "dest_context->port" - }, - "next": "outbound" - }, - { - "name": "outbound", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "127.0.0.1", - "port": "dest_context->port" - } - } - ] -} \ No newline at end of file diff --git a/docs/examples/tunnel/direct/tls/multiport/readme.md b/docs/examples/tunnel/direct/tls/multiport/readme.md deleted file mode 100644 index f1226ff8..00000000 --- a/docs/examples/tunnel/direct/tls/multiport/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# MultiPort tls + tcp - - -assumptions: - -> port range: 23 - 65535 - -> foreign server address: mydomain.com - -> in foreign server, the domain certificate files (fullchain.pem, privkey.pem) are present next to Waterwall - -> next protocol is http/1.1 , change it if you need h2 or both - ---- - -forward port X to mydomain.com:443 , then tls handshake, then to port X inside the foreign server (mydomain.com) - -preconnect node is added to lower the handshake time - - -config_client.json -> run in local server (iran) - -config_server.json -> run in foreign server (kharej) \ No newline at end of file diff --git a/docs/examples/tunnel/direct/tls/port_to_port/config_client.json b/docs/examples/tunnel/direct/tls/port_to_port/config_client.json deleted file mode 100644 index d68045f3..00000000 --- a/docs/examples/tunnel/direct/tls/port_to_port/config_client.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "config_tls_tunnel_client_single_port", - "nodes": [ - { - "name": "inbound", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": 443, - "nodelay": true - }, - "next": "pre_client" - }, - { - "name": "pre_client", - "type": "PreConnectClient", - "settings": { - "minimum-unused": 8 - }, - "next": "ssl_client" - }, - { - "name": "ssl_client", - "type": "OpenSSLClient", - "settings": { - "sni": "mydomain.com", - "verify": true, - "alpn": "http/1.1" - }, - "next": "tcp_outbound" - }, - { - "name": "tcp_outbound", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "mydomain.com", - "port": 443 - } - } - ] -} \ No newline at end of file diff --git a/docs/examples/tunnel/direct/tls/port_to_port/config_server.json b/docs/examples/tunnel/direct/tls/port_to_port/config_server.json deleted file mode 100644 index c28cf4d1..00000000 --- a/docs/examples/tunnel/direct/tls/port_to_port/config_server.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "config_tls_tunnel_server_single_port", - "nodes": [ - { - "name": "inbound", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": 443, - "nodelay": true - }, - "next": "ssl_server" - }, - { - "name": "ssl_server", - "type": "OpenSSLServer", - "settings": { - "cert-file": "fullchain.pem", - "key-file": "privkey.pem", - "alpns": [ - { - "value": "h2", - "next": "node->next" - }, - { - "value": "http/1.1", - "next": "node->next" - } - ] - }, - "next": "outbound" - }, - { - "name": "outbound", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "127.0.0.1", - "port": 443 - } - } - ] -} \ No newline at end of file diff --git a/docs/examples/tunnel/direct/tls/port_to_port/readme.md b/docs/examples/tunnel/direct/tls/port_to_port/readme.md deleted file mode 100644 index 876ba0bc..00000000 --- a/docs/examples/tunnel/direct/tls/port_to_port/readme.md +++ /dev/null @@ -1,24 +0,0 @@ -# SinglePort tls + tcp - - -assumptions: - -> port range: 23 - 65535 - -> foreign server address: mydomain.com - -> in foreign server, the domain certificate files (fullchain.pem, privkey.pem) are present next to Waterwall - -> next protocol is http/1.1 , change it if you need h2 or both - ---- - -forward port 443 to mydomain.com:443 , then tls handshake, then to port 2083 inside the foreign server (mydomain.com) - -preconnect node is added to lower the handshake time - - - -config_client.json -> run in local server (iran) - -config_server.json -> run in foreign server (kharej) \ No newline at end of file diff --git a/docs/examples/tunnel/reverse/tcp/port_to_port/config_client.json b/docs/examples/tunnel/reverse/tcp/port_to_port/config_client.json deleted file mode 100644 index 472cd5aa..00000000 --- a/docs/examples/tunnel/reverse/tcp/port_to_port/config_client.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "config_tcp_reverse_client_port_to_port", - "nodes": [ - { - "name": "users_inbound", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": 443, - "nodelay": true - }, - "next": "bridge2" - }, - { - "name": "bridge2", - "type": "Bridge", - "settings": { - "pair": "bridge1" - } - }, - { - "name": "bridge1", - "type": "Bridge", - "settings": { - "pair": "bridge2" - } - }, - { - "name": "reverse_server", - "type": "ReverseServer", - "settings": {}, - "next": "bridge1" - }, - { - "name": "foreign_server_inbound", - "type": "TcpListener", - "settings": { - "address": "0.0.0.0", - "port": 443, - "nodelay": true, - "whitelist": [ - "2.2.2.2/32" - ] - }, - "next": "reverse_server" - } - ] -} \ No newline at end of file diff --git a/docs/examples/tunnel/reverse/tcp/port_to_port/config_server.json b/docs/examples/tunnel/reverse/tcp/port_to_port/config_server.json deleted file mode 100644 index 392fc8df..00000000 --- a/docs/examples/tunnel/reverse/tcp/port_to_port/config_server.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "config_tcp_reverse_server_port_to_port", - "nodes": [ - { - "name": "outbound_to_core", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "127.0.0.1", - "port": 443 - } - }, - { - "name": "bridge1", - "type": "Bridge", - "settings": { - "pair": "bridge2" - }, - "next": "outbound_to_core" - }, - { - "name": "bridge2", - "type": "Bridge", - "settings": { - "pair": "bridge1" - }, - "next": "reverse_client" - }, - { - "name": "reverse_client", - "type": "ReverseClient", - "settings": { - "minimum-unused": 16 - }, - "next": "outbound_to_local_server" - }, - { - "name": "outbound_to_local_server", - "type": "TcpConnector", - "settings": { - "nodelay": true, - "address": "1.1.1.1", - "port": 443 - } - } - ] -} \ No newline at end of file diff --git a/docs/examples/tunnel/reverse/tcp/port_to_port/readme.md b/docs/examples/tunnel/reverse/tcp/port_to_port/readme.md deleted file mode 100644 index 64c34bcc..00000000 --- a/docs/examples/tunnel/reverse/tcp/port_to_port/readme.md +++ /dev/null @@ -1,25 +0,0 @@ -# SinglePort reverse - - -assumptions: - -> port: 443 - -> local(iran) server address: 1.1.1.1 -> foreign(kharej) server address: 2.2.2.2 - ---- - -forward port 443 to 2.2.2.2:443 through a connection which initiated by the foreign server to port 443 - - -port 443 is playing 2 roles here, so we white-listed the foreign server ip address in the config_client.json - -we could also use a auth node instead of ip whitelisting - - -# note - -config_client.json -> run in foreign server (kharej) - -config_server.json -> run in local server (iran) diff --git a/docs/index.md b/docs/index.md index 24b26c2a..362efd42 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,22 +1,174 @@ -# WaterWall Documentation - -WaterWall is a simple core for tunneling and even direct user-server connections. based on high-performance, fully customizeable nodes for creating any kind of protocol without writing code for it. - - -## Contents - -- [شروع](Begin) -- [فایل core.json](file-core.json) -- [فایل config.json](file-config.json) -- [Port to Port Tunnel](Direct-Port-To-Port) -- [Tls Tunnel](Tls-Tunnel) -- [PreConnect Node](PreConnect) -- [Http2 Mux Grpc Nodes](Http2-Mux-Grpc) -- [Reverse Tunnel](Reverse-Tunnel) -- [Reality Direct Tunnel](Reality-Direct-Tunnel) -- [Reality Reverse Tunnel](Reality-Reverse-Tunnel) -- [Bgp4 Tunnel or Direct](Bgp4-Tunnel-or-Direct) -- [Direct Trojan Protocol with Anti tls in tls](Trojan) -- [HalfDuplex Tunnel or Direct](HalfDuplex-Tunnel-or-Direct) -- [Load balancing](Load-Balancing) -- [CDN Tunnel Direct or Reverse](CDN-Tunnel) +# just-the-docs-template + +This is a *bare-minimum* template to create a [Jekyll] site that: + +- uses the [Just the Docs] theme; +- can be built and published on [GitHub Pages]; +- can be built and previewed locally, and published on other platforms. + +More specifically, the created site: + +- uses a gem-based approach, i.e. uses a `Gemfile` and loads the `just-the-docs` gem; +- uses the [GitHub Pages / Actions workflow] to build and publish the site on GitHub Pages. + +To get started with creating a site, simply: + +1. click "[use this template]" to create a GitHub repository +2. go to Settings > Pages > Build and deployment > Source, and select GitHub Actions + +If you want to maintain your docs in the `docs` directory of an existing project repo, see [Hosting your docs from an existing project repo](#hosting-your-docs-from-an-existing-project-repo). + +After completing the creation of your new site on GitHub, update it as needed: + +## Replace the content of the template pages + +Update the following files to your own content: + +- `index.md` (your new home page) +- `README.md` (information for those who access your site repo on GitHub) + +## Changing the version of the theme and/or Jekyll + +Simply edit the relevant line(s) in the `Gemfile`. + +## Adding a plugin + +The Just the Docs theme automatically includes the [`jekyll-seo-tag`] plugin. + +To add an extra plugin, you need to add it in the `Gemfile` *and* in `_config.yml`. For example, to add [`jekyll-default-layout`]: + +- Add the following to your site's `Gemfile`: + + ```ruby + gem "jekyll-default-layout" + ``` + +- And add the following to your site's `_config.yml`: + + ```yaml + plugins: + - jekyll-default-layout + ``` + +Note: If you are using a Jekyll version less than 3.5.0, use the `gems` key instead of `plugins`. + +## Publishing your site on GitHub Pages + +1. If your created site is `YOUR-USERNAME/YOUR-SITE-NAME`, update `_config.yml` to: + + ```yaml + title: YOUR TITLE + description: YOUR DESCRIPTION + theme: just-the-docs + + url: https://YOUR-USERNAME.github.io/YOUR-SITE-NAME + + aux_links: # remove if you don't want this link to appear on your pages + Template Repository: https://github.com/YOUR-USERNAME/YOUR-SITE-NAME + ``` + +2. Push your updated `_config.yml` to your site on GitHub. + +3. In your newly created repo on GitHub: + - go to the `Settings` tab -> `Pages` -> `Build and deployment`, then select `Source`: `GitHub Actions`. + - if there were any failed Actions, go to the `Actions` tab and click on `Re-run jobs`. + +## Building and previewing your site locally + +Assuming [Jekyll] and [Bundler] are installed on your computer: + +1. Change your working directory to the root directory of your site. + +2. Run `bundle install`. + +3. Run `bundle exec jekyll serve` to build your site and preview it at `localhost:4000`. + + The built site is stored in the directory `_site`. + +## Publishing your built site on a different platform + +Just upload all the files in the directory `_site`. + +## Customization + +You're free to customize sites that you create with this template, however you like! + +[Browse our documentation][Just the Docs] to learn more about how to use this theme. + +## Hosting your docs from an existing project repo + +You might want to maintain your docs in an existing project repo. Instead of creating a new repo using the [just-the-docs template](https://github.com/just-the-docs/just-the-docs-template), you can copy the template files into your existing repo and configure the template's Github Actions workflow to build from a `docs` directory. You can clone the template to your local machine or download the `.zip` file to access the files. + +### Copy the template files + +1. Create a `.github/workflows` directory at your project root if your repo doesn't already have one. Copy the `pages.yml` file into this directory. GitHub Actions searches this directory for workflow files. + +2. Create a `docs` directory at your project root and copy all remaining template files into this directory. + +### Modify the GitHub Actions workflow + +The GitHub Actions workflow that builds and deploys your site to Github Pages is defined by the `pages.yml` file. You'll need to edit this file to that so that your build and deploy steps look to your `docs` directory, rather than the project root. + +1. Set the default `working-directory` param for the build job. + + ```yaml + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: docs + ``` + +2. Set the `working-directory` param for the Setup Ruby step. + + ```yaml + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + cache-version: 0 + working-directory: '${{ github.workspace }}/docs' + ``` + +3. Set the path param for the Upload artifact step: + + ```yaml + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: "docs/_site/" + ``` + +4. Modify the trigger so that only changes within the `docs` directory start the workflow. Otherwise, every change to your project (even those that don't affect the docs) would trigger a new site build and deploy. + + ```yaml + on: + push: + branches: + - "main" + paths: + - "docs/**" + ``` + +## Licensing and Attribution + +This repository is licensed under the [MIT License]. You are generally free to reuse or extend upon this code as you see fit; just include the original copy of the license (which is preserved when you "make a template"). While it's not necessary, we'd love to hear from you if you do use this template, and how we can improve it for future use! + +The deployment GitHub Actions workflow is heavily based on GitHub's mixed-party [starter workflows]. A copy of their MIT License is available in [actions/starter-workflows]. + +---- + +[^1]: [It can take up to 10 minutes for changes to your site to publish after you push the changes to GitHub](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll#creating-your-site). + +[Jekyll]: https://jekyllrb.com +[Just the Docs]: https://just-the-docs.github.io/just-the-docs/ +[GitHub Pages]: https://docs.github.com/en/pages +[GitHub Pages / Actions workflow]: https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/ +[Bundler]: https://bundler.io +[use this template]: https://github.com/just-the-docs/just-the-docs-template/generate +[`jekyll-default-layout`]: https://github.com/benbalter/jekyll-default-layout +[`jekyll-seo-tag`]: https://jekyll.github.io/jekyll-seo-tag +[MIT License]: https://en.wikipedia.org/wiki/MIT_License +[starter workflows]: https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml +[actions/starter-workflows]: https://github.com/actions/starter-workflows/blob/main/LICENSE