From 19d576783db0b4dd134bc2e6027c3109821f6c74 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Mon, 6 Feb 2023 15:34:10 -0800 Subject: [PATCH] Style fixes and more README documentation --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ web/static/css/chat.css | 7 +++++++ 2 files changed, 45 insertions(+) diff --git a/README.md b/README.md index db89959..c0e5346 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,44 @@ This app is not designed to run without JWT authentication for users enabled. In Note that they would not get past history of those DMs as this server only pushes _new_ messages to users after they connect. +# Deploying This App + +It is recommended to use a reverse proxy such as nginx in front of this app. You will need to configure nginx to forward WebSocket related headers: + +```nginx +server { + server_name chat.example.com; + listen 443 ssl http2; + listen [::]:443 ssl http2; + + ssl_certificate /etc/letsencrypt/live/chat.example.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/chat.example.com/privkey.pem; + + # Proxy pass to BareRTC. + location / { + proxy_pass http://127.0.0.1:9000; + + # WebSocket headers to forward along. + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + } +} +``` + +You can run the BareRTC app itself using any service supervisor you like. I use [Supervisor](http://supervisord.org/introduction.html) and you can configure BareRTC like so: + +```ini +# /etc/supervisor/conf.d/barertc.conf +[program:barertc] +command = /home/user/git/BareRTC/BareRTC -address 127.0.0.1:9000 +directory = /home/user/git/BareRTC +user = user +``` + +Then `sudo supervisorctl reread && sudo supervisorctl add barertc` to start the app. + # License GPLv3. diff --git a/web/static/css/chat.css b/web/static/css/chat.css index 78984e4..ec074f9 100644 --- a/web/static/css/chat.css +++ b/web/static/css/chat.css @@ -40,6 +40,13 @@ body { grid-template-rows: auto 1fr auto; } +@media (prefers-color-scheme: dark) { + .chat-container { + background: rgb(39, 39, 39); + background: linear-gradient(0deg, rgb(39, 39, 39) 0%, rgb(66, 66, 66) 100%); + } +} + /* Header row */ .chat-container > .chat-header { grid-column: 1 / 4;