From 8989ed1e34486be0e93ebb15435cbbd394b035ff Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Fri, 27 Jan 2023 18:49:41 +1100 Subject: [PATCH] INSTALLATION.md and nginx install script improvements for nohttps --- INSTALLATION.md | 7 +++---- configs/nginx/nginx.sh | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index b8f95252..15837f80 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -27,16 +27,15 @@ ```bash sudo apt update -y -sudo apt install curl wget gnupg nginx ffmpeg imagemagick graphicsmagick python-certbot-nginx fonts-dejavu -y +sudo apt install curl wget gnupg nginx ffmpeg imagemagick graphicsmagick python3-certbot-nginx fonts-dejavu -y ``` **3. Install MongoDB** [MongoDB Installation](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/#install-mongodb-community-edition-on-debian): ```bash -#NOTE: this installs mongodb 4.4 for compatibility reasons only. Newer versions (6.x) are recommended) -wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - -echo "deb http://repo.mongodb.org/apt/debian $(lsb_release -sc)/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list +wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - +echo "deb http://repo.mongodb.org/apt/debian $(lsb_release -sc)/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list sudo apt update -y sudo apt install -y mongodb-org sudo systemctl enable --now mongod diff --git a/configs/nginx/nginx.sh b/configs/nginx/nginx.sh index 65f42fba..353c7a73 100755 --- a/configs/nginx/nginx.sh +++ b/configs/nginx/nginx.sh @@ -122,6 +122,7 @@ EOF " fi + if [ "$NOHTTPS" != "y" ]; then HTTPS_MIDSECTION=" listen [::]:443 ssl ipv6only=on; listen 443 ssl; @@ -140,7 +141,8 @@ server { server_name $CLEARNET_SERVER_NAME; return 444; - " +" + fi #onion_location redirect header ONION_LOCATION="" @@ -236,7 +238,7 @@ echo "Writing main jschan vhost config..." printf "$JSCHAN_CONFIG" > /etc/nginx/sites-available/$SITES_AVAILABLE_NAME sudo ln -s -f /etc/nginx/sites-available/$SITES_AVAILABLE_NAME /etc/nginx/sites-enabled/$SITES_AVAILABLE_NAME -if [ "$NOHTTPS" == "Y" ]; then +if [ "$NOHTTPS" == "y" ]; then echo "Adjusting config snippets to support NOHTTPS mode..." sudo sed -i "s/Forwarded-Proto https/Forwarded-Proto http/g" /etc/nginx/snippets/jschan_clearnet_routes.conf fi