Skip to content

Commit 44823c0

Browse files
authored
Merge pull request #12 from snaplet/main
merge changes
2 parents 115a781 + 7d19a05 commit 44823c0

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<h1 align="center">Postgres WASM</h1>
3-
<p align="center">A PostgresQL server instance running in a virtual machine running in the browser<br />
3+
<p align="center">A PostgreSQL server instance running in a virtual machine running in the browser<br />
44
<i>by Supabase &amp; Snaplet</i></p>
55
<img align="center" src="https://user-images.githubusercontent.com/90199159/192729860-730e89a9-2489-4a95-a814-25eaaebebb7d.png" alt="Snaplet, Supabase and friends" width="480">
66
<br /><br />
@@ -24,7 +24,7 @@ Go to http://localhost:3000 and have fun!
2424

2525
## Packages
2626

27-
This repo is split into three packages that build up the environment for running PostgresQL in the browser.
27+
This repo is split into three packages that build up the environment for running PostgreSQL in the browser.
2828

2929
- [runtime](/packages/runtime): The v86 emulator that starts the `buildroot` image
3030
- [Buildroot](/packages/buildroot): Scripts to build the CPU and memory snapshot run by v86.

packages/websockproxy/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# INSTALLING
2+
If you want to install the proxy server on your own server, here's the easiest way to get started:
3+
4+
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`.
5+
2. Make sure Docker is installed. (see install_docker.sh for installing Docker on Ubuntu 20.04 amd64)
6+
3. Make sure the DNS for your domain points to this new server. (Use an `A` record.)
7+
4. Copy the `install.sh` file to the server.
8+
5. Modify the first two lines of `install.sh` to set your `PROXY_DOMAIN` and `PROXY_DOMAIN_SUPPORT_EMAIL`.
9+
6. Execute the `install.sh` script on the server.
10+
11+
112
# WebSockets Proxy
213

314
A websocket ethernet switch built using Tornado in Python

packages/websockproxy/install.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export PROXY_DOMAIN="my_proxy.domain.com"
2+
export PROXY_DOMAIN_SUPPORT_EMAIL="support@my_proxy.domain.com"
3+
4+
docker rm -f relay && docker run --privileged --network host --name relay burggraf/pg_browser_websockproxy:1.0.5 &
5+
6+
sleep 120 # give time for initial start
7+
8+
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 -
9+
10+
apt install -y certbot
11+
apt install -y cron
12+
certbot certonly -d $PROXY_DOMAIN --standalone -n --agree-tos --email $PROXY_DOMAIN_SUPPORT_EMAIL
13+
docker cp -L /etc/letsencrypt/live/$PROXY_DOMAIN/fullchain.pem relay:/root/fullchain.pem
14+
docker cp -L /etc/letsencrypt/live/$PROXY_DOMAIN/privkey.pem relay:/root/privkey.pem
15+
docker exec -it relay nginx # start nginx
16+
17+
crontab -l | { cat; echo "0 1 * * * certbot renew --standalone"; } | crontab -
18+
crontab -l | { cat; echo "0 2 * * * docker cp -L /etc/letsencrypt/live/$PROXY_DOMAIN/fullchain.pem relay:/root/fullchain.pem"; } | crontab -
19+
crontab -l | { cat; echo "0 2 * * * docker cp -L /etc/letsencrypt/live/$PROXY_DOMAIN/privkey.pem relay:/root/privkey.pem"; } | crontab -
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# install docker on Ubuntu Server 20.04 amd64
2+
sudo apt install apt-transport-https ca-certificates curl software-properties-common
3+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4+
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
5+
apt-cache policy docker-ce
6+
sudo apt install -y docker-ce
7+
sudo systemctl status docker

0 commit comments

Comments
 (0)