mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-10-25 09:03:38 +00:00
Use batch mode on htpasswd
This commit is contained in:
@@ -30,14 +30,14 @@ if [ ! -f /etc/nginx/conf.d/kibana.htpasswd ]; then
|
|||||||
do
|
do
|
||||||
IFS=':' read -r -a credentials <<< "${users[index]}"
|
IFS=':' read -r -a credentials <<< "${users[index]}"
|
||||||
if [ $index -eq 0 ]; then
|
if [ $index -eq 0 ]; then
|
||||||
echo ${credentials[1]}|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd ${credentials[0]} >/dev/null
|
htpasswd -b -c /etc/nginx/conf.d/kibana.htpasswd ${credentials[0]} ${credentials[1]} >/dev/null
|
||||||
else
|
else
|
||||||
echo ${credentials[1]}|htpasswd -i /etc/nginx/conf.d/kibana.htpasswd ${credentials[0]} >/dev/null
|
htpasswd -b /etc/nginx/conf.d/kibana.htpasswd ${credentials[0]} ${credentials[1]} >/dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
# NGINX_PWD and NGINX_NAME are declared in nginx/Dockerfile
|
# NGINX_PWD and NGINX_NAME are declared in nginx/Dockerfile
|
||||||
echo $NGINX_PWD|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd $NGINX_NAME >/dev/null
|
htpasswd -b -c /etc/nginx/conf.d/kibana.htpasswd $NGINX_NAME $NGINX_PWD >/dev/null
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Kibana credentials already configured"
|
echo "Kibana credentials already configured"
|
||||||
|
|||||||
Reference in New Issue
Block a user