Sharkord
HTTPS Setup

Apache

Apache as the reverse proxy, with certbot.

sudo apt install -y apache2 certbot python3-certbot-apache
sudo a2enmod rewrite proxy proxy_http proxy_wstunnel headers ssl

/etc/apache2/sites-available/001-sharkord.conf:

<VirtualHost *:80>
    ServerName sharkord.example.com
    Redirect permanent / https://sharkord.example.com
</VirtualHost>

<VirtualHost *:443>
    ServerName sharkord.example.com
    Protocols h2 http/1.1

    # websocket, required for sharkord to connect at all
    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*) ws://localhost:4991/$1 [P,L]

    RequestHeader set X-Forwarded-Proto "https"

    ProxyPreserveHost On
    ProxyPass / http://localhost:4991/
    ProxyPassReverse / http://localhost:4991/
    ProxyTimeout 86400
    SetEnv proxy-nokeepalive 1
    SetEnv proxy-initial-not-pooled 1

    SSLEngine on
    SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
</VirtualHost>
sudo a2ensite 001-sharkord.conf
sudo certbot --apache -d sharkord.example.com
sudo systemctl restart apache2

Firewall

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 40000/tcp
sudo ufw allow 40000/udp

Keep 4991 closed. Apache reaches it on localhost.

On this page