diff mbox series

Activate http auth digest as nginx external module

Message ID DU2PR05MB10812CD5D89A78E79B0034402A33D2@DU2PR05MB10812.eurprd05.prod.outlook.com
State New
Headers show
Series Activate http auth digest as nginx external module | expand

Commit Message

Ivan Castell Dec. 10, 2024, 2:30 p.m. UTC
Hello buildroot forum

This is a patch activating http auth digest as a nginx external module. It is disabled by default. It would be useful to have this module available in buildroot baseline.  Please include it if you consider it can be useful for somebody else.

Many thanks in advance!

$ cat 0001-add-nginx-http-auth-digest-module-and-related-change.patch
From 2b1c8402a89f342b56716381ea4ab67c4b3d8250 Mon Sep 17 00:00:00 2001
From: Angel Ivan Castell Rovira <al004140@gmail.com>
Date: Tue, 10 Dec 2024 15:08:15 +0100
Subject: [PATCH] add nginx-http-auth-digest module and related changes

Signed-off-by: Angel Ivan Castell Rovira <al004140@gmail.com>
---
 package/Config.in                             |  1 +
 package/nginx-http-auth-digest/Config.in      | 19 +++++++++++++++++++
 .../nginx-http-auth-digest.mk                 | 13 +++++++++++++
 package/nginx/nginx.mk                        |  5 +++++
 4 files changed, 38 insertions(+)
 create mode 100644 package/nginx-http-auth-digest/Config.in
 create mode 100644 package/nginx-http-auth-digest/nginx-http-auth-digest.mk

--
2.34.1
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index e8ff6733..f225bf00 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2498,6 +2498,7 @@  menu "External nginx modules"
      source "package/nginx-modsecurity/Config.in"
      source "package/nginx-naxsi/Config.in"
      source "package/nginx-upload/Config.in"
+        source "package/nginx-http-auth-digest/Config.in"
 endmenu
 endif
      source "package/ngircd/Config.in"
diff --git a/package/nginx-http-auth-digest/Config.in b/package/nginx-http-auth-digest/Config.in
new file mode 100644
index 00000000..cf7fadf1
--- /dev/null
+++ b/package/nginx-http-auth-digest/Config.in
@@ -0,0 +1,19 @@ 
+config BR2_PACKAGE_NGINX_HTTP_AUTH_DIGEST_MODULE
+     bool "nginx-http-auth-digest-module"
+        default n
+     depends on BR2_PACKAGE_NGINX_HTTP
+     help
+       Nginx Digest Authentication module
+
+        The ngx_http_auth_digest module supplements Nginx's built-in
+        Basic Authentication module by providing support for RFC 2617
+        Digest Authentication. The module is currently functional but
+        has only been tested and reviewed by its author. And given
+        that this is security code, one set of eyes is almost
+        certainly insufficient to guarantee that it's 100% correct.
+        Until a few bug reports come in and some of the unknown
+        unknowns in the code are flushed out, consider this module
+        an alpha and treat it with the appropriate amount of
+        skepticism.
+
+       https://github.com/samizdatco/nginx-http-auth-digest
diff --git a/package/nginx-http-auth-digest/nginx-http-auth-digest.mk b/package/nginx-http-auth-digest/nginx-http-auth-digest.mk
new file mode 100644
index 00000000..bfa10442
--- /dev/null
+++ b/package/nginx-http-auth-digest/nginx-http-auth-digest.mk
@@ -0,0 +1,13 @@ 
+################################################################################
+# nginx-http-auth-digest
+################################################################################
+
+NGINX_HTTP_AUTH_DIGEST_PKG_NAME = nginx-http-auth-digest
+NGINX_HTTP_AUTH_DIGEST_VERSION = 5a2cae4812d8a1ba5f83dfbcb8d043d05c8e6f97
+NGINX_HTTP_AUTH_DIGEST_SITE = https://github.com/samizdatco/nginx-http-auth-digest
+NGINX_HTTP_AUTH_DIGEST_SITE_METHOD = git
+
+NGINX_HTTP_AUTH_DIGEST_LICENSE = BSD-2-Clause
+NGINX_HTTP_AUTH_DIGEST_LICENSE_FILES = LICENSE
+
+$(eval $(generic-package))
diff --git a/package/nginx/nginx.mk b/package/nginx/nginx.mk
index 7a5455de..1ffe9db4 100644
--- a/package/nginx/nginx.mk
+++ b/package/nginx/nginx.mk
@@ -267,6 +267,11 @@  NGINX_CONF_OPTS += \
 endif # BR2_PACKAGE_NGINX_STREAM

 # external modules
+ifeq ($(BR2_PACKAGE_NGINX_HTTP_AUTH_DIGEST_MODULE),y)
+NGINX_CONF_OPTS += --add-module=$(BUILD_DIR)/nginx-http-auth-digest-$(NGINX_HTTP_AUTH_DIGEST_VERSION)
+NGINX_DEPENDENCIES += nginx-http-auth-digest
+endif
+
 ifeq ($(BR2_PACKAGE_NGINX_UPLOAD),y)
 NGINX_CONF_OPTS += $(addprefix --add-module=,$(NGINX_UPLOAD_DIR))
 NGINX_DEPENDENCIES += nginx-upload