Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/websockproxy/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# INSTALLING
If you want to install the proxy server on your own server, here's the easiest way to get started:

1. Start with an Ubuntu 20.04 server instance. This is the only configuration that's currently tested. Ubuntu 22.04 will not work, as it uses `OpenSSL 3.0` which is not compatible with the docker image's versons of `OpenSSL` and `nginx`.
2. Make sure Docker is installed. (see install_docker.sh for installing Docker on Ubuntu 20.04 amd64)
3. Make sure the DNS for your domain points to this new server. (Use an `A` record.)
4. Copy the `install.sh` file to the server.
5. Modify the first two lines of `install.sh` to set your `PROXY_DOMAIN` and `PROXY_DOMAIN_SUPPORT_EMAIL`.
6. Execute the `install.sh` script on the server.


# WebSockets Proxy

A websocket ethernet switch built using Tornado in Python
Expand Down
19 changes: 19 additions & 0 deletions packages/websockproxy/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export PROXY_DOMAIN="my_proxy.domain.com"
export PROXY_DOMAIN_SUPPORT_EMAIL="support@my_proxy.domain.com"

docker rm -f relay && docker run --privileged --network host --name relay burggraf/pg_browser_websockproxy:1.0.5 &

sleep 120 # give time for initial start

crontab -l | { cat; echo "@reboot sleep 5 && docker rm -f relay && docker run --privileged --network host --name relay burggraf/pg_browser_websockproxy:1.0.5"; } | crontab -

apt install -y certbot
apt install -y cron
certbot certonly -d $PROXY_DOMAIN --standalone -n --agree-tos --email $PROXY_DOMAIN_SUPPORT_EMAIL
docker cp -L /etc/letsencrypt/live/$PROXY_DOMAIN/fullchain.pem relay:/root/fullchain.pem
docker cp -L /etc/letsencrypt/live/$PROXY_DOMAIN/privkey.pem relay:/root/privkey.pem
docker exec -it relay nginx # start nginx

crontab -l | { cat; echo "0 1 * * * certbot renew --standalone"; } | crontab -
crontab -l | { cat; echo "0 2 * * * docker cp -L /etc/letsencrypt/live/$PROXY_DOMAIN/fullchain.pem relay:/root/fullchain.pem"; } | crontab -
crontab -l | { cat; echo "0 2 * * * docker cp -L /etc/letsencrypt/live/$PROXY_DOMAIN/privkey.pem relay:/root/privkey.pem"; } | crontab -
7 changes: 7 additions & 0 deletions packages/websockproxy/install_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# install docker on Ubuntu Server 20.04 amd64
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install -y docker-ce
sudo systemctl status docker