From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id OF0jC5Epc2aPZwAAe85BDQ:P1 (envelope-from ) for ; Wed, 19 Jun 2024 18:55:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id OF0jC5Epc2aPZwAAe85BDQ (envelope-from ) for ; Wed, 19 Jun 2024 20:55:13 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=rF+yZntf; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718823312; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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:dkim-signature; bh=dyOeKPwytSjInHziwe+fqzWHCAzn2QTiW2sYtxZh+0o=; b=rP1/lLI6Fjs+AT9nkatH2+lZAYmXrC5MN1SDLeYYyNUDgdx8IYtqsgmGEu3QSmJXGpQJXx 9AZw9fFLnhcSsBuWKHBfbuADb5Oa1GsOA3zPwWwIcsABrbWyfoXxpC+8Iwo/p1SfPPJcKN zT8PrfTJx4RTNt9wQ7DPZktpgu6dpqrqgq37Sr0YmwJHW1hwbMnnDWfDZM5BAzD4mnLBTX 7rnn0AuVSzlSp8v1henoW3hrhjVKqvuJlz0g2IcxApvzYfcy6+ybzUX/FoMNltKf8JQOgp Zbif6dK+ZFEDkmK4eHow96BO2eXaSpyeEW2pAlJqE1ElVzlKxaf9ss3kAfbgWg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=rF+yZntf; 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=1718823312; a=rsa-sha256; cv=none; b=K56aE7U2YuXfUrxG7YVCX9u4yoB+lmIhLLFI+7MGIan8uPgf01eSBptgXdKalfEm59seQ/ ozW89c2COWNl5gKnzKT0Dfj/RMp/i38v5eoOcHj9MLCDuGbIVVTt9Ere0xW70T6GkDTglG GGyTsWyzLkM5cdP26WxeJF+MSKVsAPAJzqaiQTDNc8HCPECN3XqKihQ6YaqZKyIpkzU2Qp knghxjgR9LnW9YjYR6oSKx9K8f3oplY5FtkyYEzpEk+1z9U55otvjHuLRzHy7XLQrkVmGa uyK8szi982jn4XT7rToYnBeu7htyfFOqSdVQ8cakLBbkYSLdhxLqr8/YAZcTWA== 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 3550670DBC for ; Wed, 19 Jun 2024 20:55:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sK0ST-0002Kv-Uv; Wed, 19 Jun 2024 14:55:02 -0400 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 1sK0SR-0002KI-Eh for guix-patches@gnu.org; Wed, 19 Jun 2024 14:54:59 -0400 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 1sK0SR-0004Ec-6I for guix-patches@gnu.org; Wed, 19 Jun 2024 14:54:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sK0SU-0003gr-I1 for guix-patches@gnu.org; Wed, 19 Jun 2024 14:55:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71586] [PATCH v2] services: web: Improve nginx formatting for extra-content References: <9556afd9d860c28ea5abe15fd42d8e2989e5244c.1718510232.git.richard@freakingpenguin.com> In-Reply-To: <9556afd9d860c28ea5abe15fd42d8e2989e5244c.1718510232.git.richard@freakingpenguin.com> Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 19 Jun 2024 18:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71586 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71586@debbugs.gnu.org Cc: Richard Sent , ~@wolfsden.cz Received: via spool by 71586-submit@debbugs.gnu.org id=B71586.171882325914088 (code B ref 71586); Wed, 19 Jun 2024 18:55:02 +0000 Received: (at 71586) by debbugs.gnu.org; 19 Jun 2024 18:54:19 +0000 Received: from localhost ([127.0.0.1]:55180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK0Rn-0003fA-7v for submit@debbugs.gnu.org; Wed, 19 Jun 2024 14:54:19 -0400 Received: from mail-108-mta29.mxroute.com ([136.175.108.29]:41253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK0Rl-0003ew-N2 for 71586@debbugs.gnu.org; Wed, 19 Jun 2024 14:54:18 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta29.mxroute.com (ZoneMTA) with ESMTPSA id 19031d9719800017a3.001 for <71586@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 19 Jun 2024 18:54:12 +0000 X-Zone-Loop: df1c812095af92ceeccb9e14fb2fded7593e0e57099c X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=dyOeKPwytSjInHziwe+fqzWHCAzn2QTiW2sYtxZh+0o=; b=rF+yZntfvGoc4n3RsEWts2LoWE aORbWCNH84zDRbYRA+PcCU856m8MrsvtSbnsEGhw3zrrSzrZ0/Iwzz+LHhpKS7ol5x+22Mom2+8oB GfhS6K4OSFLhFyolKaTrSREk6hXi7qHzDqalnTFH3j98LE2xsXCaPhUXD4Lok9xIjLhc1yvQP8UQ3 b9IsZiO5+093B3918nVt78RYIZ+3UE37y5krl8cx5iYZJW23o+S3V7k1prp3nv6/JYlGcxUApO+eP gUZbLYEdyJVboCz5DlDk0y6pTqCl5GBGin8YJ1PLWgKnwm7He2T3ESSVLIJxnwnZmlSaJZ2s0ckBR IaWVX3IA==; From: Richard Sent Date: Wed, 19 Jun 2024 14:49:19 -0400 Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com 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 X-Spam-Score: -3.36 X-Migadu-Queue-Id: 3550670DBC X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -3.36 X-TUID: 13bpe/9oWl8J * gnu/services/web (default-nginx-config): When extra-content is a list, add 4 space indentation and a newline to every line. If it's a string, continue inserting it directly. This makes the list serialization behavior more consistent with other services. Change-Id: Iec8614ba3cfc37292a566197e8d39b352b04846a --- Updated according to feedback. I agree that file-like objects should be lowered into strings like they normally are and not serialized in their package form. emit-nginx-upstream-config has a similar issue. gnu/services/web.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 406117c457..0572af1310 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -771,7 +771,12 @@ (define (default-nginx-config config) "\n" (map emit-nginx-upstream-config upstream-blocks) (map emit-nginx-server-config server-blocks) - extra-content + (match extra-content + ((? string? extra-content) extra-content) + ((? list? extra-content) + (map (lambda (line) + `(" " ,line "\n")) + extra-content))) "\n}\n")))) (define %nginx-accounts base-commit: e32e3d0a03dc17c4c54a91aad053c9036998b601 -- 2.45.1