From 67d3d441b7bbed3293823929f7b73bed5923e3f7 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Fri, 3 Oct 2014 19:56:42 +0530 Subject: [PATCH] http auth default password set to random --- src/modules/stack/install/ee_mod_setup_nginx.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/stack/install/ee_mod_setup_nginx.sh b/src/modules/stack/install/ee_mod_setup_nginx.sh index 75943cde..fc3c4b6c 100644 --- a/src/modules/stack/install/ee_mod_setup_nginx.sh +++ b/src/modules/stack/install/ee_mod_setup_nginx.sh @@ -3,6 +3,7 @@ function ee_mod_setup_nginx() { local ee_whitelist_ip_address + local ee_random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) ee_lib_echo "Setting up NGINX, please wait..." @@ -94,4 +95,9 @@ function ee_mod_setup_nginx() sed -i "/deny/i $(echo allow $ee_whitelist_ip_address\;)" /etc/nginx/common/acl.conf done fi + + # Set easyengine:easyengine as default http authentication + if [ ! -f /etc/nginx/htpasswd-ee ]; then + printf "easyengine:$(openssl passwd -crypt $ee_random 2> /dev/null)\n" > /etc/nginx/htpasswd-ee 2> /dev/null + fi }