From 0baed68ed28648850c8a77e452359c5e034a7313 Mon Sep 17 00:00:00 2001 From: bfren Date: Thu, 22 Sep 2022 15:50:49 +0100 Subject: [PATCH 1/4] Bumping version to 5.0.16 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index df697be..14bfa85 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.15 \ No newline at end of file +5.0.16 \ No newline at end of file From 4090b27a2bb3b17f3a2653729259deced1741099 Mon Sep 17 00:00:00 2001 From: bfren Date: Thu, 22 Sep 2022 15:50:56 +0100 Subject: [PATCH 2/4] Adding basic HTTP auth support --- overlay/etc/nginx/helpers/nginx-auth.conf | 2 ++ overlay/usr/bin/bf/nginx-adduser | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 overlay/etc/nginx/helpers/nginx-auth.conf create mode 100644 overlay/usr/bin/bf/nginx-adduser diff --git a/overlay/etc/nginx/helpers/nginx-auth.conf b/overlay/etc/nginx/helpers/nginx-auth.conf new file mode 100644 index 0000000..d24f715 --- /dev/null +++ b/overlay/etc/nginx/helpers/nginx-auth.conf @@ -0,0 +1,2 @@ +basic_auth "Please enter a username and password."; +basic_auth_user_file htpasswd; \ No newline at end of file diff --git a/overlay/usr/bin/bf/nginx-adduser b/overlay/usr/bin/bf/nginx-adduser new file mode 100644 index 0000000..8e5a1c7 --- /dev/null +++ b/overlay/usr/bin/bf/nginx-adduser @@ -0,0 +1,22 @@ +#!/command/with-contenv sh + +set -euo pipefail +export BF_E=`basename ${0}` + + +#====================================================================================================================== +# Check variables. +#====================================================================================================================== + +[[ -z "${1-}" ]] && bf-error "You must pass a username." "nginx-adduser" +USER="${1}" + +[[ -z "${2-}" ]] && bf-error "You must pass a password." "nginx-adduser" +PASS="${2}" + + +#====================================================================================================================== +# Add a user for basic HTTP auth. +#====================================================================================================================== + +printf "${USER}:$(openssl passwd -apr1 ${PASS})\n" >> /etc/nginx/htpasswd From bbf4676eb6b05e161f472c559a18f5172e6a5e4f Mon Sep 17 00:00:00 2001 From: bfren Date: Thu, 22 Sep 2022 15:55:00 +0100 Subject: [PATCH 3/4] Adding output to nginx-adduser --- overlay/usr/bin/bf/nginx-adduser | 2 ++ 1 file changed, 2 insertions(+) diff --git a/overlay/usr/bin/bf/nginx-adduser b/overlay/usr/bin/bf/nginx-adduser index 8e5a1c7..ba9319f 100644 --- a/overlay/usr/bin/bf/nginx-adduser +++ b/overlay/usr/bin/bf/nginx-adduser @@ -19,4 +19,6 @@ PASS="${2}" # Add a user for basic HTTP auth. #====================================================================================================================== +bf-echo "Adding user ${USER} with encrypted password..." "nginx-adduser" printf "${USER}:$(openssl passwd -apr1 ${PASS})\n" >> /etc/nginx/htpasswd +bf-done From 608a1b6b2c28fa23dedc694b7bbed19e58862f82 Mon Sep 17 00:00:00 2001 From: bfren Date: Thu, 22 Sep 2022 15:56:46 +0100 Subject: [PATCH 4/4] Fixing nginx-auth --- overlay/etc/nginx/helpers/nginx-auth.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overlay/etc/nginx/helpers/nginx-auth.conf b/overlay/etc/nginx/helpers/nginx-auth.conf index d24f715..30e195a 100644 --- a/overlay/etc/nginx/helpers/nginx-auth.conf +++ b/overlay/etc/nginx/helpers/nginx-auth.conf @@ -1,2 +1,2 @@ -basic_auth "Please enter a username and password."; -basic_auth_user_file htpasswd; \ No newline at end of file +auth_basic "Please enter a username and password."; +auth_basic_user_file htpasswd; \ No newline at end of file