GNU bug report logs - #76357
[PATCH] gnu: web: add nginx-headers-more-module

Previous Next

Package: guix-patches;

Reported by: Karl Hallsby <karl <at> hallsby.com>

Date: Mon, 17 Feb 2025 04:49:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76357 in the body.
You can then email your comments to 76357 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#76357; Package guix-patches. (Mon, 17 Feb 2025 04:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Karl Hallsby <karl <at> hallsby.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 17 Feb 2025 04:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Karl Hallsby <karl <at> hallsby.com>
To: guix-patches <at> gnu.org
Cc: Raven Hallsby <karl <at> hallsby.com>
Subject: [PATCH] gnu: web: add nginx-headers-more-module
Date: Sun, 16 Feb 2025 22:47:45 -0600
From: Raven Hallsby <karl <at> hallsby.com>

* gnu/packages/web.scm (nginx-headers-more-module): New variable.

Change-Id: I8219fefadd008b884f836f974d0850b352825ee0
---
 gnu/packages/web.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 1a70da4a90..fd386ee477 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -68,6 +68,7 @@
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
 ;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com>
 ;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom <at> gmail.com>
+;;; Copyright © 2025 Raven Hallsby <karl <at> hallsby.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -986,6 +987,67 @@ (define-public nginx-rtmp-module
 stream.  Remote control of the module is possible over HTTP.")
     (license license:bsd-2)))
 
+(define-public nginx-headers-more-module
+  (package
+    (inherit nginx)
+    (name "nginx-headers-more-module")
+    (version "0.38")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/openresty/headers-more-nginx-module")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1dbgwzkpni616nawjkrq0xid60wdgab3vciy7nr966ac6rjyiliy"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("nginx-sources" ,(package-source nginx))
+       ,@(package-inputs nginx)))
+    (arguments
+     (substitute-keyword-arguments
+         `(#:make-flags '("modules") ;Only build this module not all of nginx.
+           ,@(package-arguments nginx))
+       ((#:configure-flags flags)
+        #~(cons "--add-dynamic-module=." #$flags))
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'unpack-nginx-sources
+              (lambda _
+                (begin
+                  ;; The nginx source code is needed to compile the module.
+                  (format #t "decompressing nginx source code~%")
+                  (invoke "tar" "xvf" #$(this-package-input "nginx-sources")
+                          ;; This package's LICENSE file would be
+                          ;; overwritten with the one from nginx when
+                          ;; unpacking the nginx source, so rename the nginx
+                          ;; one when unpacking.
+                          "--transform=s,/LICENSE$,/LICENSE.nginx,"
+                          "--strip-components=1"))))
+            (replace 'install
+              (lambda _
+                (let ((modules-dir (string-append #$output
+                                                  "/etc/nginx/modules")))
+                  (install-file "objs/ngx_http_headers_more_filter_module.so"
+                                modules-dir))))
+            (delete 'fix-root-dirs)
+            (delete 'install-man-page)))))
+    (home-page "https://github.com/openresty/headers-more-nginx-module")
+    (synopsis "Set, add, and clear input and output headers in NGINX http servers")
+    (description "Allows adding, setting, or clearing any output or input header
+specified.
+
+This is an enhanced version of the standard headers module because it provides
+more utilities like resetting or clearing \"builtin headers\" like @code{Content-Type},
+@code{Content-Length}, and @code{Server}.
+
+It also allows you to specify an optional HTTP status code criteria using the
+@code{-s} option and an optional content type criteria using the @code{-t}
+option while modifying the output headers with the more_set_headers and
+more_clear_headers directives.")
+    (license license:bsd-2)))
+
 (define-public nginx-module-vts
   (package
     (inherit nginx)

base-commit: ad74dedb9f167c088d37a3a30d5d6fe841e9127b
-- 
2.46.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 20 Feb 2025 10:44:02 GMT) Full text and rfc822 format available.

Notification sent to Karl Hallsby <karl <at> hallsby.com>:
bug acknowledged by developer. (Thu, 20 Feb 2025 10:44:02 GMT) Full text and rfc822 format available.

Message #10 received at 76357-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Karl Hallsby <karl <at> hallsby.com>
Cc: 76357-done <at> debbugs.gnu.org
Subject: Re: [bug#76357] [PATCH] gnu: web: add nginx-headers-more-module
Date: Thu, 20 Feb 2025 11:43:17 +0100
[Message part 1 (text/plain, inline)]
Karl Hallsby <karl <at> hallsby.com> skribis:

> From: Raven Hallsby <karl <at> hallsby.com>
>
> * gnu/packages/web.scm (nginx-headers-more-module): New variable.
>
> Change-Id: I8219fefadd008b884f836f974d0850b352825ee0

Applied with the change below.

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 7a4daee5c35..240163b034e 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -1035,8 +1035,8 @@ (define-public nginx-headers-more-module
             (delete 'install-man-page)))))
     (home-page "https://github.com/openresty/headers-more-nginx-module")
     (synopsis "Set, add, and clear input and output headers in NGINX http servers")
-    (description "Allows adding, setting, or clearing any output or input header
-specified.
+    (description "This NGINX module allows adding, setting, or clearing any
+output or input header specified.
 
 This is an enhanced version of the standard headers module because it provides
 more utilities like resetting or clearing \"builtin headers\" like @code{Content-Type},

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 20 Mar 2025 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.