From b7423293ea7671f0e662d8c4e70056fbe5eaeb7d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 24 Nov 2021 13:14:57 +0100 Subject: Update notes. --- NOTES.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'NOTES.md') diff --git a/NOTES.md b/NOTES.md index 3851d51..51b622e 100644 --- a/NOTES.md +++ b/NOTES.md @@ -6,7 +6,7 @@ The server and game rules are implemented in Javascript. The game state is stored in the database as a JSON blob. The server runs on Node with the Express.js and Socket.io frameworks. -Redirect port 80 and 443 to 8080 and 80443: +Redirect port 80 and 443 to 8080 and 8443: ``` sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-ports 8080 @@ -19,6 +19,25 @@ Create SSL certificate with Let's Encrypt certbot, or self-signed with OpenSSL: openssl req -nodes -new -x509 -keyout key.pem -out cert.pem ``` +Configure the server using the .env file: + +``` +NODE_ENV=production + +HTTP_PORT=8080 + +HTTPS_PORT=8443 +SSL_KEY=/etc/letsencrypt/live/YOUR_DOMAIN/privkey.com +SSL_CERT=/etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem + +MAIL_FROM="Your Site Name " +MAIL_HOST=localhost +MAIL_PORT=25 +``` + +If the HTTPS_PORT is missing, the server will only serve HTTP. +If MAIL_HOST/PORT are not present, the server will not send notification emails. + ## Resources Icons are sourced from various places: @@ -35,6 +54,7 @@ Fonts: Image processing software: * https://github.com/google/guetzli/ +* https://github.com/mozilla/mozjpeg * https://github.com/svg/svgo * http://optipng.sourceforge.net/ * http://potrace.sourceforge.net/ -- cgit v1.2.3