File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1- 5.0.15
1+ 5.0.16
Original file line number Diff line number Diff line change 1+ auth_basic "Please enter a username and password.";
2+ auth_basic_user_file htpasswd;
Original file line number Diff line number Diff line change 1+ #!/command/with-contenv sh
2+
3+ set -euo pipefail
4+ export BF_E=`basename ${0}`
5+
6+
7+ #======================================================================================================================
8+ # Check variables.
9+ #======================================================================================================================
10+
11+ [[ -z "${1-}" ]] && bf-error "You must pass a username." "nginx-adduser"
12+ USER="${1}"
13+
14+ [[ -z "${2-}" ]] && bf-error "You must pass a password." "nginx-adduser"
15+ PASS="${2}"
16+
17+
18+ #======================================================================================================================
19+ # Add a user for basic HTTP auth.
20+ #======================================================================================================================
21+
22+ bf-echo "Adding user ${USER} with encrypted password..." "nginx-adduser"
23+ printf "${USER}:$(openssl passwd -apr1 ${PASS})\n" >> /etc/nginx/htpasswd
24+ bf-done
You can’t perform that action at this time.
0 commit comments