From patchwork Mon Feb 17 04:47:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Raven Hallsby X-Patchwork-Id: 38763 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3E5EE27BBE9; Mon, 17 Feb 2025 04:49:33 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0248D27BBE2 for ; Mon, 17 Feb 2025 04:49:31 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tjt44-0003Gh-6p; Sun, 16 Feb 2025 23:49:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tjt42-0003GF-SC for guix-patches@gnu.org; Sun, 16 Feb 2025 23:49:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tjt42-0004LG-IN for guix-patches@gnu.org; Sun, 16 Feb 2025 23:49:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=1M7WYg3GF8PP3cLgbCZww+1VXSHkgrEhE+T582ial04=; b=Qa2AFb7M0jhPtcF7s08IvZOez7CXTUkJnGraiusXSfYrWB+7B9AS9HU/Dp7ulJ91sREmg8s4oAZWXH+mUo/II3WF2jBzP/SEydoj6ta8ZkYtYx51ZjDGTyFqJic5NixhlJ0w32/wEBqM/koc0L87+s5TACr2pKk3YatqGkILHc0jG5AZHwd8aaalKs1uHGidt7XYMXychjAVKmzlsO+Qf/ur2lbTHACBlxF05JwOSkvEV8HI6JI4i18iNqJ1RmwV/+ErT39pyS+D0j6i3QWklKjqloNxh8Jbdtu6arb95PdS56BRK6kFs9SfZ9fuxfZo6BLyN/SRfommdwSUZEgyGQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tjt42-0007Nw-BA for guix-patches@gnu.org; Sun, 16 Feb 2025 23:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76357] [PATCH] gnu: web: add nginx-headers-more-module Resent-From: Karl Hallsby Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Feb 2025 04:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 76357 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76357@debbugs.gnu.org Cc: Raven Hallsby X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173976771828231 (code B ref -1); Mon, 17 Feb 2025 04:49:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Feb 2025 04:48:38 +0000 Received: from localhost ([127.0.0.1]:40862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjt3d-0007LC-F1 for submit@debbugs.gnu.org; Sun, 16 Feb 2025 23:48:38 -0500 Received: from lists.gnu.org ([2001:470:142::17]:44682) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tjt3a-0007KN-3A for submit@debbugs.gnu.org; Sun, 16 Feb 2025 23:48:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tjt3U-0003F1-JI for guix-patches@gnu.org; Sun, 16 Feb 2025 23:48:28 -0500 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tjt3S-0004K5-Ad for guix-patches@gnu.org; Sun, 16 Feb 2025 23:48:27 -0500 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-855799b9d1cso42223039f.1 for ; Sun, 16 Feb 2025 20:48:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hallsby.com; s=google; t=1739767704; x=1740372504; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1M7WYg3GF8PP3cLgbCZww+1VXSHkgrEhE+T582ial04=; b=k+tHg2r8/W7jCFSW4rkfdJUXHHl2cRPr6HosZ0VyIgRwFi5kgafRWgQmE1g3X2Rl2r uU0Za353BUDVTg4ec1VO+HbOxz9qLJmtoz7ekLnzzOEOOA88MgtFK7lG9IGTqRCjuG9Y zLvZHaTbt/YA37/Fl8y2adZxV4a/cKkMYYXMXX7g2B1yAC+amlQq6IzE7LfRvUZ2rgYP dc40zh2YTZOYqwJ956NeykkvOdu6PBl/DGaflBYqDJX7fQzkuxaiPo7cZBq28BDsudZl JDK2YPTwEzvTGliCw7DIl7RWWVSZzYUsF9w3Ln8zG47i0xRXvAyMu/kSGptv8HEmxbN3 7LNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739767704; x=1740372504; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1M7WYg3GF8PP3cLgbCZww+1VXSHkgrEhE+T582ial04=; b=DW/EB96jRHKjTxQJ6rOBclmVE+ABd9aIyqkYFfr1s+nXYtxdy6tVCL2wiypxqfWH1G W6XGdIpvNITHg3UBhFeZXbUe4Eld2G843qoh5mlIXXAy7Ro1H91UYOLPAV58RqAJX+tI kCrqAgSINN+1WDO9b1ZRDQ2awp/UhAiQp/XO9DOlXcfEGEn5knHkggWncIT67SjjY/ws 5A9dCAocdJTCwMyjA2RDj9aEgePR/G8EQEPKQYWydILhllIX9Dp4LM6BPKmslMe0ZVuF Ish1NSYsRnj9l3ZaSjIwaokigK/60oSUaVTFX2zemA+4rG+k1GVpNUHyGZJtoj3NEvRx u8IA== X-Gm-Message-State: AOJu0YwaUSS8g35GlqVnw+ja14orS7oqqGUxidfbSL7h2yES1lWijYBS Y6VQqMn6xkRx2HuCquOAMP3nTwU23et8GlofdpuOuxQrjIt6YcrlLsrbfxH1w7ArncKgR30kciY = X-Gm-Gg: ASbGnctgz4lexGmpWjqMAvuV+ylIxuFM9DsmjRNDCshQoaX/gliAaEve3DLpI4cvyoi 3tgCA9v68EviZy4rHaJwKW1lj9QopA/6IFtCKZ4itQ20x+KMGSlQKQO65ltraDmOw7T7l8LWdIz qyCYdDyuqaH7ASdWESDSvUpuOcCnN8ksVbDi7S79fvGqEkBDJvxP2vBuZkmzX9Bc42j4X5Ue2NT UJC71jm+9aBpoeOk6jpZfN8V5F4jJyyuPlsvHdZChFRIkn4i8K6IIfpHqwR1wlfKDfAFosWCGWt VzGQAPVBvFR45dwjy8rH X-Google-Smtp-Source: AGHT+IFqtVp/ZLNLsFl6FJUpSjBMHeEX2IWETYGNzCLMFaJku4HByin4kA8WfoRH2fJK0DEkHGlHgA== X-Received: by 2002:a05:6602:2dd4:b0:855:683d:d45a with SMTP id ca18e2360f4ac-8557a136149mr815610239f.9.1739767703938; Sun, 16 Feb 2025 20:48:23 -0800 (PST) Received: from Karl-Desktop.raven ([207.237.222.72]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85566e120fasm175312639f.7.2025.02.16.20.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2025 20:48:22 -0800 (PST) Date: Sun, 16 Feb 2025 22:47:45 -0600 Message-ID: <171f25fda076f80ce11ac113addc239e1645a88f.1739767657.git.karl@hallsby.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::d2c; envelope-from=karl@hallsby.com; helo=mail-io1-xd2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Karl Hallsby X-ACL-Warn: , Karl Hallsby via Guix-patches X-Patchwork-Original-From: Karl Hallsby via Guix-patches via From: Raven Hallsby Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Raven Hallsby * gnu/packages/web.scm (nginx-headers-more-module): New variable. Change-Id: I8219fefadd008b884f836f974d0850b352825ee0 --- gnu/packages/web.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) base-commit: ad74dedb9f167c088d37a3a30d5d6fe841e9127b 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@qq.com> ;;; Copyright © 2024, 2025 Artyom V. Poptsov +;;; Copyright © 2025 Raven Hallsby ;;; ;;; 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)