From 22852136b230923ef2b9e12db571dc9055890c6b Mon Sep 17 00:00:00 2001
From: Stefano Alberto Russo <stefano.russo@gmail.com>
Date: Sun, 29 May 2022 16:48:11 +0200
Subject: [PATCH] Fixes

---
 .gitignore                         | 1 -
 services/proxy/prestartup_proxy.sh | 5 ++++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index e8f01ee..70b7265 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,7 +16,6 @@ data*
 
 # DB conf
 services/webapp/db_conf.sh
-services/proxy/certificates
 
 # Compose
 docker-compose.yml
diff --git a/services/proxy/prestartup_proxy.sh b/services/proxy/prestartup_proxy.sh
index aac3083..38918c7 100644
--- a/services/proxy/prestartup_proxy.sh
+++ b/services/proxy/prestartup_proxy.sh
@@ -39,11 +39,14 @@ sudo sed -i "s/__ROSETTA_HOST__/$ROSETTA_HOST/g" /etc/apache2/sites-available/pr
 #-----------------------
 
 # If the tasks host is equal to rosetta host or not set, do nothing as we have already habdled it above
-if [ "x$ROSETTA_TASKS_PROXY_HOST" == "x$ROSETTA_HOST"] || [ "x$ROSETTA_TASKS_PROXY_HOST" == "x" ]; then
+if [ "x$ROSETTA_TASKS_PROXY_HOST" == "x$ROSETTA_HOST" ] || [ "x$ROSETTA_TASKS_PROXY_HOST" == "x" ]; then
     echo "[INFO] Not setting up certificates forRosetta tasks host as qual to Rosetta main host"
     ROSETTA_TASKS_PROXY_HOST=$ROSETTA_HOST
 else
 
+    # Always create dir if not existent
+    mkdir -p /etc/letsencrypt/live/$ROSETTA_TASKS_PROXY_HOST/
+
     # If there are no certificates, use snakeoils
 	if [ ! -f "/etc/letsencrypt/live/$ROSETTA_TASKS_PROXY_HOST/cert.pem" ]; then
 	    echo "Using default self-signed certificate cer file for $ROSETTA_TASKS_PROXY_HOST as not existent..."
-- 
GitLab