From 179521763c721f584718fb0f5c0aeaf8ee056a66 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Mon, 14 May 2018 23:06:41 +0100
Subject: [PATCH] Change gogs port

---
 src/freedombone-app-gogs       |  7 ++++---
 src/freedombone-app-rocketchat |  2 +-
 src/freedombone-template       | 16 ++++++----------
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/freedombone-app-gogs b/src/freedombone-app-gogs
index 6e87b4243..8a2e4c0a6 100755
--- a/src/freedombone-app-gogs
+++ b/src/freedombone-app-gogs
@@ -39,6 +39,7 @@ GIT_CODE=
 GIT_ONION_PORT=8090
 GIT_ADMIN_PASSWORD=
 GOGS_BIN=
+GOGS_PORT=3145
 
 gogs_variables=(ONION_ONLY
                 GIT_ADMIN_PASSWORD
@@ -596,7 +597,7 @@ function install_gogs {
           echo '    location / {'; } >> "/etc/nginx/sites-available/${GIT_DOMAIN_NAME}"
         function_check nginx_limits
         nginx_limits "${GIT_DOMAIN_NAME}" '10G'
-        { echo '        proxy_pass http://localhost:3000;';
+        { echo "        proxy_pass http://localhost:${GOGS_PORT};";
           echo '    }';
           echo '';
           echo '    fastcgi_buffers 64 4K;';
@@ -628,7 +629,7 @@ function install_gogs {
       echo '    location / {'; } >> "/etc/nginx/sites-available/${GIT_DOMAIN_NAME}"
     function_check nginx_limits
     nginx_limits "${GIT_DOMAIN_NAME}" '10G'
-    { echo '        proxy_pass http://localhost:3000;';
+    { echo "        proxy_pass http://localhost:${GOGS_PORT};";
       echo '    }';
       echo '';
       echo '    fastcgi_buffers 64 4K;';
@@ -713,7 +714,7 @@ function install_gogs {
         echo "DOMAIN = ${GIT_ONION_HOSTNAME}" >> ${GOGS_CONFIG_FILE}
         echo "ROOT_URL = http://$GIT_DOMAIN_NAME/" >> ${GOGS_CONFIG_FILE}
     fi
-    { echo 'HTTP_PORT = 3000';
+    { echo "HTTP_PORT = ${GOGS_PORT}";
       echo "SSH_PORT = $SSH_PORT";
       echo 'SSH_DOMAIN = %(DOMAIN)s';
       echo "CERT_FILE = /etc/ssl/certs/${GIT_DOMAIN_NAME}.pem";
diff --git a/src/freedombone-app-rocketchat b/src/freedombone-app-rocketchat
index b48773367..3aaad2923 100755
--- a/src/freedombone-app-rocketchat
+++ b/src/freedombone-app-rocketchat
@@ -33,7 +33,7 @@ SHOW_ON_ABOUT=1
 ROCKETCHAT_DOMAIN_NAME=
 ROCKETCHAT_CODE=
 ROCKETCHAT_ONION_PORT=9722
-ROCKETCHAT_PORT_INTERNAL=1233
+ROCKETCHAT_PORT_INTERNAL=3000
 
 rocketchat_variables=(ONION_ONLY
                       ROCKETCHAT_DOMAIN_NAME
diff --git a/src/freedombone-template b/src/freedombone-template
index c80e4c907..009462988 100755
--- a/src/freedombone-template
+++ b/src/freedombone-template
@@ -873,12 +873,10 @@ if [ $app_webui ]; then
         echo ''
         echo "        { echo '  add_header Strict-Transport-Security max-age=15768000;';"
         echo "          echo '';"
-        echo "          echo '  # Logs';"
-        echo "          echo '  access_log /dev/null;';"
-        echo "          echo '  error_log /dev/null;';"
+        echo "          echo '    access_log /dev/null;';"
+        echo "          echo '    error_log /dev/null;';"
         echo "          echo '';"
-        echo "          echo '  # Root';"
-        echo "          echo \"  root /var/www/\$${app_name_upper}_DOMAIN_NAME/htdocs;\";"
+        echo "          echo \"    root /var/www/\$${app_name_upper}_DOMAIN_NAME/htdocs;\";"
         echo "          echo '';"
         if [[ "$app_php" == 'yes' ]]; then
             echo "          echo '  index index.php;';"
@@ -920,12 +918,10 @@ if [ $app_webui ]; then
     echo "    echo '' >> \"\$${app_name}_nginx_site\""
     echo "    nginx_security_options \"\$${app_name_upper}_DOMAIN_NAME\""
     echo "    { echo '';"
-    echo "      echo '  # Logs';"
-    echo "      echo '  access_log /dev/null;';"
-    echo "      echo '  error_log /dev/null;';"
+    echo "      echo '    access_log /dev/null;';"
+    echo "      echo '    error_log /dev/null;';"
     echo "      echo '';"
-    echo "      echo '  # Root';"
-    echo "      echo \"  root /var/www/\$${app_name_upper}_DOMAIN_NAME/htdocs;\";"
+    echo "      echo \"    root /var/www/\$${app_name_upper}_DOMAIN_NAME/htdocs;\";"
     echo "      echo '';"
     if [[ "$app_php" == 'yes' ]]; then
         echo "      echo '  index index.php;';"
-- 
GitLab