From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNo2R-0001yu-GN for guix-patches@gnu.org; Sat, 09 Dec 2017 17:56:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNo2M-0007el-HO for guix-patches@gnu.org; Sat, 09 Dec 2017 17:56:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:45593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNo2M-0007eE-DQ for guix-patches@gnu.org; Sat, 09 Dec 2017 17:56:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eNo2M-0006JW-4H for guix-patches@gnu.org; Sat, 09 Dec 2017 17:56:02 -0500 Subject: [bug#29633] [PATCH] services: nginx: Allow to add raw content to the server blocks. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNo1q-0001x6-Iy for guix-patches@gnu.org; Sat, 09 Dec 2017 17:55:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNo1l-0007GU-KZ for guix-patches@gnu.org; Sat, 09 Dec 2017 17:55:30 -0500 Received: from mail.lassieur.org ([83.152.10.219]:55594) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNo1l-0007EZ-5k for guix-patches@gnu.org; Sat, 09 Dec 2017 17:55:25 -0500 Received: from localhost.localdomain (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 420805b6 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO) for ; Sat, 9 Dec 2017 22:55:18 +0000 (UTC) From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Sat, 9 Dec 2017 23:55:04 +0100 Message-Id: <20171209225504.9547-1-clement@lassieur.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 29633@debbugs.gnu.org * doc/guix.texi (Web Services): Document 'raw-content'. * gnu/services/web.scm ()[raw-content]: New field. (emit-nginx-server-config): Add it. --- doc/guix.texi | 3 +++ gnu/services/web.scm | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ab1e5d057..09017ec65 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14974,6 +14974,9 @@ you don't have a key or you don't want to use HTTPS. @item @code{server-tokens?} (default: @code{#f}) Whether the server should add its configuration to response. +@item @code{raw-content} (default: @code{'()}) +A list of raw lines added to the server block. + @end table @end deftp diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 7373d5671..78a6ad309 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -52,6 +52,7 @@ nginx-server-configuration-ssl-certificate nginx-server-configuration-ssl-certificate-key nginx-server-configuration-server-tokens? + nginx-server-configuration-raw-content nginx-upstream-configuration @@ -104,7 +105,9 @@ (ssl-certificate-key nginx-server-configuration-ssl-certificate-key (default "/etc/nginx/key.pem")) (server-tokens? nginx-server-configuration-server-tokens? - (default #f))) + (default #f)) + (raw-content nginx-server-configuration-raw-content + (default '()))) (define-record-type* nginx-upstream-configuration make-nginx-upstream-configuration @@ -180,7 +183,8 @@ of index files." (index (nginx-server-configuration-index server)) (try-files (nginx-server-configuration-try-files server)) (server-tokens? (nginx-server-configuration-server-tokens? server)) - (locations (nginx-server-configuration-locations server))) + (locations (nginx-server-configuration-locations server)) + (raw-content (nginx-server-configuration-raw-content server))) (define-syntax-parameter <> (syntax-rules ())) (define-syntax-rule (and/l x tail ...) (let ((x* x)) @@ -213,6 +217,7 @@ of index files." "\n" (map emit-nginx-location-config locations) "\n" + (map (lambda (x) (list " " x "\n")) raw-content) " }\n"))) (define (emit-nginx-upstream-config upstream) -- 2.15.1