all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#29633] [PATCH] services: nginx: Allow to add raw content to the server blocks.
@ 2017-12-09 22:55 Clément Lassieur
  2017-12-16 22:00 ` Christopher Baines
  0 siblings, 1 reply; 3+ messages in thread
From: Clément Lassieur @ 2017-12-09 22:55 UTC (permalink / raw)
  To: 29633

* doc/guix.texi (Web Services): Document 'raw-content'.
* gnu/services/web.scm (<nginx-server-configuration>)[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>
             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>
   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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#29633] [PATCH] services: nginx: Allow to add raw content to the server blocks.
  2017-12-09 22:55 [bug#29633] [PATCH] services: nginx: Allow to add raw content to the server blocks Clément Lassieur
@ 2017-12-16 22:00 ` Christopher Baines
  2017-12-18 11:07   ` bug#29633: " Clément Lassieur
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Baines @ 2017-12-16 22:00 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 29633

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]


Clément Lassieur <clement@lassieur.org> writes:

> * doc/guix.texi (Web Services): Document 'raw-content'.
> * gnu/services/web.scm (<nginx-server-configuration>)[raw-content]: New field.
> (emit-nginx-server-config): Add it.

This looks good to me :) I was writing a service for the Apache web
server recently, and ended up adding something very similar there [1].

1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29741

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#29633: [PATCH] services: nginx: Allow to add raw content to the server blocks.
  2017-12-16 22:00 ` Christopher Baines
@ 2017-12-18 11:07   ` Clément Lassieur
  0 siblings, 0 replies; 3+ messages in thread
From: Clément Lassieur @ 2017-12-18 11:07 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 29633-done

Christopher Baines <mail@cbaines.net> writes:

> Clément Lassieur <clement@lassieur.org> writes:
>
>> * doc/guix.texi (Web Services): Document 'raw-content'.
>> * gnu/services/web.scm (<nginx-server-configuration>)[raw-content]: New field.
>> (emit-nginx-server-config): Add it.
>
> This looks good to me :) I was writing a service for the Apache web
> server recently, and ended up adding something very similar there [1].
>
> 1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29741

I pushed it.  Thank you!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-18 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-09 22:55 [bug#29633] [PATCH] services: nginx: Allow to add raw content to the server blocks Clément Lassieur
2017-12-16 22:00 ` Christopher Baines
2017-12-18 11:07   ` bug#29633: " Clément Lassieur

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.