Skip to content

Commit ad9f5fc

Browse files
committed
perf: update basic auth
1 parent 7eea155 commit ad9f5fc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

init.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ function config_nginx() {
3636
sed -i 's@proxy_set_header X-Forwarded-For .*;@proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;@g' "${config_file}"
3737
fi
3838

39-
if [ -n "${BASIC_AUTH_PASSWORD}" ] ; then
39+
if [[ -n "${BASIC_AUTH_PASSWORD}" ]] ; then
40+
rm -f /etc/nginx/.htpasswd
4041
htpasswd -bc /etc/nginx/.htpasswd ${BASIC_AUTH_USER} ${BASIC_AUTH_PASSWORD}
4142
sed -i "s@# auth_basic .*;@auth_basic \"Restricted Area\";@g" "${config_file}"
4243
sed -i "s@# auth_basic_user_file .*;@auth_basic_user_file /etc/nginx/.htpasswd;@g" "${config_file}"

0 commit comments

Comments
 (0)