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 KHFeA7gbc2b6xQAAe85BDQ:P1 (envelope-from ) for ; Wed, 19 Jun 2024 17:56:08 +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 KHFeA7gbc2b6xQAAe85BDQ (envelope-from ) for ; Wed, 19 Jun 2024 19:56:08 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="P8d/+pHh"; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="P8d/+pHh"; 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=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718819768; 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: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=paT9ZXC7dhMo8I+IiEHkNJjcAOAwHCYHn+AQfXYexv8=; b=fooXeE+lf2+7tziauQ3nH9VCgFSD51ejWc816XRrbPq6X8yrUmMScohc/+aD28cD1YF+Bm V+5mbptBkOnZfDLeSKHjWaDLkJZFPEChX2BQzMjJVZeNWeLP8uBQgTSOtuseCMiMnSHeV2 94HZ8jYVLH07ylsLkSN9jTzChM8PqaDS3BUr80VLSjmcjC8VvNEGdgxNFWWBw+IhzgMpB5 LE/sNxu//ZANubhefc/7laZACxgbH7cNhvDJ9vdr5BHdMtfV/RHHNkAVzH93Os4wKe1X3u uDEjQBrcJ2spAMwRskWpEcTBK+wFnXcr5K+O/7szyX9YaklRTV465XZHGCXDhQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="P8d/+pHh"; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="P8d/+pHh"; 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=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718819768; a=rsa-sha256; cv=none; b=JsxaXOjpcSQmKiwVEn+4ucDPjkyzn5RAoisyiUChKZdGiVq6yBxONwZKXHnkeLKbN5D7Ok bayyFjwcse6QvbkhNNawNpAOSsco4Av1O2QtN82oQ8WH1ylratBR5dhA/lAg0VdKzdRBOO 6XNOZj8hpR/bJYc7/76tQNunPpMgfDF6Rq81fgOyLhP0V2gmlfEPAEUhN4KRPBBTuwxwwM TcPyHXr10wcmjVKLaOMdTEfj2pUduuKsVcDZqVgOzXBluzIYsCYIkK1IarGJ3qDqctT+Mw IhWVIbTr/E9KnsO+YmqoW3N+QRSoa4dQq7Xq6iyIxZbgM+YqVdUmSo+B38YOlw== 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 DBADA6D818 for ; Wed, 19 Jun 2024 19:56:07 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJzXM-0006RP-PV; Wed, 19 Jun 2024 13:56:00 -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 1sJzXL-0006RE-AA for guix-patches@gnu.org; Wed, 19 Jun 2024 13:55: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 1sJzXL-000056-1q for guix-patches@gnu.org; Wed, 19 Jun 2024 13:55:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJzXO-0001Zj-4K for guix-patches@gnu.org; Wed, 19 Jun 2024 13:56:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71586] [PATCH] services: web: Improve nginx formatting for extra-content Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 19 Jun 2024 17:56: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: Richard Sent Cc: 71586@debbugs.gnu.org X-Debbugs-Original-Cc: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17188197406013 (code B ref -1); Wed, 19 Jun 2024 17:56:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jun 2024 17:55:40 +0000 Received: from localhost ([127.0.0.1]:53325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJzX2-0001Yt-8j for submit@debbugs.gnu.org; Wed, 19 Jun 2024 13:55:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:57194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1sJzX0-0001Yh-BG for submit@debbugs.gnu.org; Wed, 19 Jun 2024 13:55:39 -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 <~@wolfsden.cz>) id 1sJzWw-0005zj-Fp for guix-patches@gnu.org; Wed, 19 Jun 2024 13:55:34 -0400 Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1sJzWt-0008Tj-PK for guix-patches@gnu.org; Wed, 19 Jun 2024 13:55:34 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id E622C29BD4F; Wed, 19 Jun 2024 17:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1718819720; bh=/EC9HwODS7sQStqLo6Q05W0tuJXZS+GQ5zbMUjwYbqI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=P8d/+pHh7Leh0BlzMpNy4WMC14jo1yeRpxz8pDJ0+UPkOo+OGwthEZ/3vTlJTW81O PCduZNGzsv+zSp8wghJQj1BHXQwYrqhImgElD4LngfOWf57D5HB2OO7F73l5vPU+eZ +N8PxGX6x+OZxg4kXfY2OPoh1jGd8Vf1oHxV1seWg2pEBsA1du/rjoArfmHIG8wnUP k8Xeyn1/swLEh4XmUvmkeWyn8mvIqsvpzPEnzt3gnjnl7Emo1f+SV6XfAIqU7J6Q1h qKUs+suiwRBr9IBggAhTFSqaKvPzewF8BzbvmRqvYYsW8W7bxVCaMGCnTgniTf5KUi FnteZ5a/S02ZCWsbsW8hgamcgCn8YUq02vItjcvkgdxrBfw42sQJPF+29hZhtpslK5 Av1rUvhCxbXKhoxPMWTJ2x0OgKd4IvnVoWgo/5OtDEP+srTu9rl/rNOB+DlsD78Lsq 46pJguFxSbmfRIwzoreLM9eTuUdp62A1fTVXQJEsyVW0WOvxNOrWtqbxp3zTOwnMtM lHXQKfUHQRlYe040YEUqD4gUhMDaw3TKW+9de1mr2NZTxzks9QoyC3IqjO7ZNHvZXg 4Y7F491INwqH/sLVNbcZW0dsSYwmqGJ0B8F4unvxcM17GplUF6sezTxcqhvbExWs25 LKdxIxnzlFew70U2pGYUI3G4= Received: from localhost (unknown [193.32.127.144]) by wolfsden.cz (Postfix) with ESMTPSA id E745729ADE6; Wed, 19 Jun 2024 17:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1718819720; bh=/EC9HwODS7sQStqLo6Q05W0tuJXZS+GQ5zbMUjwYbqI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=P8d/+pHh7Leh0BlzMpNy4WMC14jo1yeRpxz8pDJ0+UPkOo+OGwthEZ/3vTlJTW81O PCduZNGzsv+zSp8wghJQj1BHXQwYrqhImgElD4LngfOWf57D5HB2OO7F73l5vPU+eZ +N8PxGX6x+OZxg4kXfY2OPoh1jGd8Vf1oHxV1seWg2pEBsA1du/rjoArfmHIG8wnUP k8Xeyn1/swLEh4XmUvmkeWyn8mvIqsvpzPEnzt3gnjnl7Emo1f+SV6XfAIqU7J6Q1h qKUs+suiwRBr9IBggAhTFSqaKvPzewF8BzbvmRqvYYsW8W7bxVCaMGCnTgniTf5KUi FnteZ5a/S02ZCWsbsW8hgamcgCn8YUq02vItjcvkgdxrBfw42sQJPF+29hZhtpslK5 Av1rUvhCxbXKhoxPMWTJ2x0OgKd4IvnVoWgo/5OtDEP+srTu9rl/rNOB+DlsD78Lsq 46pJguFxSbmfRIwzoreLM9eTuUdp62A1fTVXQJEsyVW0WOvxNOrWtqbxp3zTOwnMtM lHXQKfUHQRlYe040YEUqD4gUhMDaw3TKW+9de1mr2NZTxzks9QoyC3IqjO7ZNHvZXg 4Y7F491INwqH/sLVNbcZW0dsSYwmqGJ0B8F4unvxcM17GplUF6sezTxcqhvbExWs25 LKdxIxnzlFew70U2pGYUI3G4= Date: Wed, 19 Jun 2024 19:55:17 +0200 From: Tomas Volf <~@wolfsden.cz> Message-ID: References: <9556afd9d860c28ea5abe15fd42d8e2989e5244c.1718510232.git.richard@freakingpenguin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XF0M5j9EUVO0UX5v" Content-Disposition: inline In-Reply-To: <9556afd9d860c28ea5abe15fd42d8e2989e5244c.1718510232.git.richard@freakingpenguin.com> Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz; helo=wolfsden.cz 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 X-Spam-Score: 2.34 X-Migadu-Queue-Id: DBADA6D818 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 2.34 X-TUID: anUC83mMnA4D --XF0M5j9EUVO0UX5v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, On 2024-06-15 23:57:12 -0400, Richard Sent wrote: > * 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 > --- > 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..094b1e4b45 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) > + (simple-format #f " ~A\n" line)) The format here sadly prevents producing `include' directives with link to the store, since any file-like object will be just serialized as its representation: `("foo" "bar" ("aa" "bb") ,(plain-file "foo" "baz")) Will end up as: foo bar (aa bb) #< name: "foo" content: "baz" references: ()> Neither the list nor the plain-file are as expected. What about doing just this: (match extra-content ((? string? extra-content) extra-content) ((? list? extra-content) (map (lambda (line) `(" " ,line "\n")) extra-content))) This produces the expected (in my opinion) output: foo bar aabb /gnu/store/7pz4iczjvgvn9ikpp1ip50bk6vi4sk7b-foo Meaning you can now do things like (extra-content `(("include " ,%some-file.conf ";"))) And it will work as expected. It already works like this for raw-content in the nginx-server-configuration. Thoughts? > + extra-content))) > "\n}\n")))) > > (define %nginx-accounts > > base-commit: 612e4dd98f7d1d015e405af9d029bede3fe3c280 > -- > 2.45.1 > > Have a nice day, Tomas Volf -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --XF0M5j9EUVO0UX5v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmZzG4UACgkQL7/ufbZ/ wamKKQ/+I4PpctYqrA3G0BWHyfraxDRURbMC0AyyHg6I03+6YF0zBh4g7RMoouZt jLrd9vNgKcArEHzAQcgWJe6I44bh0W5V8ppE459NpACOfjjXdABg+KZ2lb5g69FR p4PnosamM9Njh50I4mwVAdA/E2Xjp4f5Iog2369sjotDUDBErd+JUVGSshw0dmjf i/BhrW2UJQDHtUbPwCB2e34QsLOiMKxaKQmsbmBd5DETZASWm7khHNpYEURDFqdZ BJeDgZ8KhulRmpj25DCAxwMuN4A93tBuRR6b0j6jEWBbc6/Iq0z64KyIOSOZ8I9h WPd4pQFYApYpNUEjvAtwJwQIBsh4i185yuWynwmMVpaMf7xPa2bLD1tj3JZiZ2cB bqRIHuCtIQtbpcsCpEo89NkoWORIUGXV7nPF81Uv5SwUm8EIzfFw9xHS7OnuQ0un HNO7DUknmWpy2zVuuQ4otrUbMtTR6/plAYRJ4VUm6+c+xkWWkyMhjyD4ivvIdybS B3VCBbIvQ+R9FHnHWnbMc0Wvc6gRlVZlxzlaFU4uoCmMvgfssxbjLk/I/YmqfZS1 w0dDMVHGB3T8alm/5AVmbiZr9lSlUK6e9TJkXplUM+4wjOXl+vNcMKIFohr6GBU6 w51WurOxFA6Phkvj+GKnMZgD14jToXE2Q3Og2Qdx7LbQbcWHn3w= =c0Rs -----END PGP SIGNATURE----- --XF0M5j9EUVO0UX5v--