From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IL9+FTLRuWPgHgAAbAwnHQ (envelope-from ) for ; Sat, 07 Jan 2023 21:08:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QBiYFDLRuWPUXQEAG6o9tA (envelope-from ) for ; Sat, 07 Jan 2023 21:08:18 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B3ED6C4F5 for ; Sat, 7 Jan 2023 21:08:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEFU8-0002p8-SI; Sat, 07 Jan 2023 15:08:08 -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 1pEFU4-0002o4-85 for guix-patches@gnu.org; Sat, 07 Jan 2023 15:08:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEFU3-0005so-3G for guix-patches@gnu.org; Sat, 07 Jan 2023 15:08:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEFU2-0006cP-GO for guix-patches@gnu.org; Sat, 07 Jan 2023 15:08:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59621] [PATCH] services: nginx: Add support for ssl-stapling in server blocks. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Jan 2023 20:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59621 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 59621@debbugs.gnu.org X-Debbugs-Original-Cc: 59621@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167312203925374 (code B ref -1); Sat, 07 Jan 2023 20:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jan 2023 20:07:19 +0000 Received: from localhost ([127.0.0.1]:59055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEFTK-0006bC-Mk for submit@debbugs.gnu.org; Sat, 07 Jan 2023 15:07:19 -0500 Received: from lists.gnu.org ([209.51.188.17]:46680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEFTJ-0006b4-BU for submit@debbugs.gnu.org; Sat, 07 Jan 2023 15:07:17 -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 1pEFTJ-0002ji-4J for guix-patches@gnu.org; Sat, 07 Jan 2023 15:07:17 -0500 Received: from smtpmciv2.myservices.hosting ([185.26.107.238]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEFTH-0005p6-3f for guix-patches@gnu.org; Sat, 07 Jan 2023 15:07:16 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv2.myservices.hosting (Postfix) with ESMTP id 6D2FB20D32; Sat, 7 Jan 2023 21:07:12 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 1C14F80096; Sat, 7 Jan 2023 21:07:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CebgBCCxy-MX; Sat, 7 Jan 2023 21:07:11 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7079180093; Sat, 7 Jan 2023 21:07:11 +0100 (CET) Message-ID: Date: Sat, 7 Jan 2023 20:07:11 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US References: <9a18d0c03940cfe0d8ab01964f12d08fcc972e30.1669507155.git.mirai@makinata.eu> <87o7ramay8.fsf@cbaines.net> From: Bruno Victal In-Reply-To: <87o7ramay8.fsf@cbaines.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=185.26.107.238; envelope-from=mirai@makinata.eu; helo=smtpmciv2.myservices.hosting X-Spam_score_int: -49 X-Spam_score: -5.0 X-Spam_bar: ----- X-Spam_report: (-5.0 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-3.114, 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673122097; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=UyCgFe8u5jOh6YrbVwFD9HAMQ3yujzCTCEw1Sols9oY=; b=p4pzLTHw/96qeb2GTebaXZ6RmOC37r23hgGUmthUAyqCQ01mZDnPVhaphYD4AXqocPnkrQ w4gw39B0htbQNN9oU0Wk6f3OmyPjST/ISOWMWhGWS5Wa4TUAXdRJMC/n1H7Sd3IVXluuku gj6GRbkkakwX4tGSW0sryUxeAVMFMFCo4ND94mYiSmKzhRJSZL51Q0PJYu5sfSiXgJrfPF Fe+wNsDH3ZZuH8+j14Q1+9IPEDlwuEZslQkdJRCxU6kUcRIJ2Bfi/qjxW8sOiUp2N23t9F SkLg34NhjG+TRdJrX4SNMAMtavFB/O5tbnzvMyVMKOtupXW3ALzteFFL9rdEFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673122097; a=rsa-sha256; cv=none; b=WkNcbMisniMjHRFUKwgR9E4JHA2fdK2DxedUieVE/AmtJdPRMhUgWXtxFWZVhE1er6Fjxu Ls/m/ncOfn7VjIfxiQvbIGH620uLINfSGVyro6STU7q6xOoWlZUwLf6epdF/sURsu0SrC5 11wquIfw0G8gANTOZzKB6dk9TYKk3JPjbTGIA+ZrHNSerT/OyPTlXv7HthoRIzqFTLNjP4 azHgxa6vrnm08kMwiBNTKABiqqxCLZBb2ObMPPx9WFnzy1Zn6vXK0ZgUHG4n+ENjcCQ//V FoqMAaZpG+t9qjDnLviSwegvsfL3NDqq/K5iONAhhfactn9BHTVD5AZ9pniJWg== X-Spam-Score: -3.26 X-Migadu-Queue-Id: B3ED6C4F5 Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -3.26 X-TUID: lQ8oFoBEsNfS Hi On 2023-01-07 17:21, Christopher Baines wrote: > > mirai@makinata.eu writes: > >> From: Bruno Victal >> >> * gnu/services/web.scm (): Add >> ssl-stapling? and ssl-stapling-verify?. >> * doc/guix.texi (NGINX): Document this. >> --- >> doc/guix.texi | 7 +++++ >> gnu/services/web.scm | 69 +++++++++++++++++++++++++------------------- >> 2 files changed, 46 insertions(+), 30 deletions(-) > > Hi Bruno, > > Thanks for the patch, and sorry it's taken so long to reply. > >> @@ -647,6 +654,8 @@ (define-syntax-rule (and/l x tail ...) >> " server_name " (config-domain-strings server-name) ";\n" >> (and/l ssl-certificate " ssl_certificate " <> ";\n") >> (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") >> + " ssl_stapling " (if ssl-stapling? "on" "off") ";\n" >> + " ssl_stapling_verify " (if ssl-stapling-verify? "on" "off") ";\n" >> (if (not (equal? "" root)) >> (list " root " root ";\n") >> "") >> >> base-commit: 68925b5ee7e0d96b0c84ae98a633eea5097bf511 > > Generally this looks good to me. There's some unnecessary indentation > changes that should probably go in another commit if they're made, but I > did spot something in the above diff. I was afraid that doing it in a separate commit would have made it less clearer as it would have looked like a trivial cosmetic change without any purpose. > > I'm no expert in NGinx configs, but I do wonder if this change will > break using nginx if it's built without the ngx_http_ssl_module? With > the other module specific configuration (e.g. ssl_certificate), it's > possible to specify a value in the that > means the line won't be included in the configuration. I think it would > be good to continue that here. I haven't tested this with a nginx that is built without ngx_http_ssl_module, it would be a rather esoteric nginx build as TLS support presence is a common expectation of web servers. > I'm not sure how to enable not including these config lines. Maybe a > symbol value like 'noval could be used (this should also be the default, > rather than #f), or maybe 'on and 'off could be used as the values with > #f meaning the line isn't included. > > Does that make sense? I'm not a fan of this approach as there's define-configuration and define-maybe value types that should be used here rather than making up a custom value, though I'm afraid reworking nginx-configuration and writing the serialize- procedures to use the gnu/services/configuration.scm facilities is a much bigger effort than what's done in this patch. Before such effort is to be considered, a plan to solve [1] is required as I don't think define-configuration is enough to represent the structure of nginx.conf (nested locations, if branches, configuration for custom modules, etc.) [1]: https://issues.guix.gnu.org/37388 Cheers, Bruno