-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup Secure WebSockets #293
base: master
Are you sure you want to change the base?
Conversation
.snippets/code/infrastructure/setup-secure-wss/apache2-config.md
Outdated
Show resolved
Hide resolved
|
||
1. Install the `nginx` web server: | ||
```bash | ||
apt install nginx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add a note somewhere that all the steps presented in this guide are for Ubuntu-like oss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note for unix based systems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed a few things. Thanks!
- 'Setup Secure Websocket': setup-secure-wss.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 'Setup Secure Websocket': setup-secure-wss.md | |
- 'Set Up Secure Websocket': setup-secure-wss.md |
For consistency
wss://example.com:443 | ||
``` | ||
|
||
![A sync-in-progress chain connected to Polkadot.js UI](/images/infrastructure/general/setup-secure-wss/secure-wss-01.webp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image is missing
@@ -0,0 +1,93 @@ | |||
--- | |||
title: Setup Secure WebSocket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Setup Secure WebSocket | |
title: Set Up Secure WebSocket |
|
||
LetsEncrypt will auto-generate an SSL certificate and include it in your configuration. | ||
|
||
You can generate a self-signed certificate and rely on your node's raw IP address when connecting. However, self-signed certificates aren't optimal because you have to whitelist the certificate to access it from a browser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can generate a self-signed certificate and rely on your node's raw IP address when connecting. However, self-signed certificates aren't optimal because you have to whitelist the certificate to access it from a browser. | |
When connecting, you can generate a self-signed certificate and rely on your node's raw IP address. However, self-signed certificates aren't optimal because you must include the certificate in an allowlist to access it from a browser. |
|
||
You can generate a self-signed certificate and rely on your node's raw IP address when connecting. However, self-signed certificates aren't optimal because you have to whitelist the certificate to access it from a browser. | ||
|
||
Use the following commmand to generate a self-signed certificate using OpenSSL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the following commmand to generate a self-signed certificate using OpenSSL: | |
Use the following command to generate a self-signed certificate using OpenSSL: |
## Connect to the Node | ||
|
||
1. Open [Polkadot.js Apps interface](https://polkadot.js.org/apps){target=\_blank} and click the logo in the top left to switch the node | ||
2. Activate the **Development** toggle and input your node's address - either the domain or the IP address. Remember to prefix with `wss://` and if you're using the 443 port, append `:443` as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Activate the **Development** toggle and input your node's address - either the domain or the IP address. Remember to prefix with `wss://` and if you're using the 443 port, append `:443` as follows: | |
2. Activate the **Development** toggle and input either your node's domain or IP address. Remember to prefix with `wss://` and, if you're using the 443 port, append `:443` as follows: |
|
||
### Obtain an SSL Certificate | ||
|
||
You can follow the [LetsEncrypt](https://letsencrypt.org/){target=\_blank} instructions for your respective web server implementation to get a free SSL certificate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can follow the [LetsEncrypt](https://letsencrypt.org/){target=\_blank} instructions for your respective web server implementation to get a free SSL certificate: | |
LetsEncrypt suggests using the [Certbot ACME client](https://letsencrypt.org/getting-started/#with-shell-access/){target=\_blank} for your respective web server implementation to get a free SSL certificate: |
I found it confusing when these links didn't open to LetsEncrypt, so added some language to clarify where the user can expect to end up
Apache2 can run in various modes, including `prefork`, `worker`, and `event`. In this example, the [`event`](https://httpd.apache.org/docs/2.4/mod/event.html){target=\_blank} mode is recommended for handling higher traffic loads, as it is optimized for performance in such environments. However, depending on the specific requirements of your setup, other modes like `prefork` or `worker` may also be appropriate. | ||
|
||
1. Install the `apache2` web server: | ||
--8<-- 'code/infrastructure/running-a-node/running-a-node/setup-secure-wss/install-apache2.md' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--8<-- 'code/infrastructure/running-a-node/running-a-node/setup-secure-wss/install-apache2.md' | |
--8<-- 'code/infrastructure/running-a-node/setup-secure-wss/install-apache2.md' |
Code snippet wasn't rendering
RewriteRule /(.*) http://localhost:9944/$1 [P,L] | ||
``` | ||
|
||
3. Optionally, some form of rate limiting can be introduced: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Optionally, some form of rate limiting can be introduced: | |
3. Optionally, some form of rate limiting can be introduced by first running the following command: |
a2enmod qos | ||
``` | ||
|
||
And edit `/etc/apache2/mods-available/qos.conf`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And edit `/etc/apache2/mods-available/qos.conf`: | |
Then edit `/etc/apache2/mods-available/qos.conf` as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only there was a way to test this content too 🙈
can we use something like docker-compose
to both make this setup easier to achieve, and test-able?
Previous PR for reference: #35