From 0076b6e83148934fdcc99690f22e23f7e8933145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mai=20G=C3=A1bor?= Date: Fri, 20 May 2022 14:38:03 +0200 Subject: [PATCH] update formating, example, typo --- docs/HAproxy.md | 116 ++++++++++++++++++++++++++---------------------- 1 file changed, 62 insertions(+), 54 deletions(-) diff --git a/docs/HAproxy.md b/docs/HAproxy.md index 5081d6db..14dc05b9 100644 --- a/docs/HAproxy.md +++ b/docs/HAproxy.md @@ -64,13 +64,17 @@ OR ### Server config -mm/configs/server/config.js - -``` js -redisOptions : { host: '192.0.2.4'}, -listeningPort: 80, -httpOnly: true, -trustProxy : ['192.0.2.5'], +config.yaml +``` yaml +turnAPIKey : "" +turnAPIURI : "" +listeningPort : 80 +httpOnly : true +trustProxy : "192.0.2.5" +redisOptions: + host: "192.0.2.4" + port: "6379" + password: "passwd" ``` ## Deploy HA proxy @@ -78,10 +82,12 @@ trustProxy : ['192.0.2.5'], * Configure certificate / letsencrypt for `meet.example.com` * In this example we put a complete chain and private key in /root/certificate.pem. * Install and setup haproxy - - `apt install haproxy` -* Install haproxy 2.2 (recommend) - sudo apt-get install gnupg2 curl -y +```bash +apt install haproxy +``` +* Install haproxy 2.2 (recommended) +``` bash +sudo apt-get install gnupg2 curl -y curl https://haproxy.debian.net/bernat.debian.org.gpg | sudo apt-key add - echo deb http://haproxy.debian.net buster-backports-2.2 main | sudo tee /etc/apt/sources.list.d/haproxy.list sudo apt-get update @@ -89,59 +95,59 @@ apt-get install haproxy=2.2.\* sudo systemctl start haproxy sudo systemctl enable haproxy - +``` * Add to /etc/haproxy/haproxy.cfg config ``` plaintext global - # mult thread setup - nbproc 1 - nbthread 4 - cpu-map auto:1/1-4 0-3 + # mult thread setup + nbproc 1 + nbthread 4 + cpu-map auto:1/1-4 0-3 - log /dev/log local0 - log /dev/log local1 notice - chroot /var/lib/haproxy - stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners - stats socket /run/haproxy.sock mode 660 level admin - stats timeout 30s - user haproxy - group haproxy - daemon + log /dev/log local0 + log /dev/log local1 notice + chroot /var/lib/haproxy + stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners + stats socket /run/haproxy.sock mode 660 level admin + stats timeout 30s + user haproxy + group haproxy + daemon - # Default SSL material locations - ca-base /etc/ssl/certs - crt-base /etc/ssl/private + # Default SSL material locations + ca-base /etc/ssl/certs + crt-base /etc/ssl/private - # Default ciphers to use on SSL-enabled listening sockets. - # For more information, see ciphers(1SSL). This list is from: - # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ - # An alternative list with additional directives can be obtained from - # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy - ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS - ssl-default-bind-options no-sslv3 - tune.ssl.default-dh-param 2048 - maxconn 20000 + # Default ciphers to use on SSL-enabled listening sockets. + # For more information, see ciphers(1SSL). This list is from: + # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ + # An alternative list with additional directives can be obtained from + # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy + ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS + ssl-default-bind-options no-sslv3 + tune.ssl.default-dh-param 2048 + maxconn 20000 defaults - log global - mode http - option httplog - #option logasap - #option dontlognull - timeout connect 5000 - timeout client 50000 - timeout server 50000 - errorfile 400 /etc/haproxy/errors/400.http - errorfile 403 /etc/haproxy/errors/403.http - errorfile 408 /etc/haproxy/errors/408.http - errorfile 500 /etc/haproxy/errors/500.http - errorfile 502 /etc/haproxy/errors/502.http - errorfile 503 /etc/haproxy/errors/503.http - errorfile 504 /etc/haproxy/errors/504.http - maxconn 8192 + log global + mode http + option httplog + #option logasap + #option dontlognull + timeout connect 5000 + timeout client 50000 + timeout server 50000 + errorfile 400 /etc/haproxy/errors/400.http + errorfile 403 /etc/haproxy/errors/403.http + errorfile 408 /etc/haproxy/errors/408.http + errorfile 500 /etc/haproxy/errors/500.http + errorfile 502 /etc/haproxy/errors/502.http + errorfile 503 /etc/haproxy/errors/503.http + errorfile 504 /etc/haproxy/errors/504.http + maxconn 8192 backend letsmeet-room-backend fullconn 4000 @@ -189,6 +195,8 @@ sudo systemctl enable haproxy ``` -Creating cert with letsencrypt +* Creating cert with letsencrypt : +``` bash sudo cat /etc/letsencrypt/live/edumeet.example.com/fullchain.pem /etc/letsencrypt/live/edumeet.example.com/privkey.pem | sudo tee /etc/ssl/edumeet.example.com/edumeet.example.com.pem +```