[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] make nginx service extensible
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] make nginx service extensible |
Date: |
Tue, 03 Jan 2017 14:39:27 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hi Julien,
Sorry for the looong delay! At last I got around to reviewing these
patches from last year. :-)
Julien Lepiller <address@hidden> skribis:
> From 52f220a2bb5a7186c9dde79b6d9a419bc58feec4 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <address@hidden>
> Date: Tue, 13 Dec 2016 20:44:31 +0100
> Subject: [PATCH 1/3] gnu: services: Rename nginx vhosts to server.
>
> * gnu/services/web.scm (nginx-vhost-configuration): Rename to...
> (nginx-server-configuration): ...this.
> ---
> doc/guix.texi | 20 +++++++++---------
> gnu/services/web.scm | 60
> ++++++++++++++++++++++++++--------------------------
> 2 files changed, 40 insertions(+), 40 deletions(-)
Pushed with an adjusted commit log to mention changes in guix.texi as
well.
http://git.savannah.gnu.org/cgit/guix.git/commit/?id=3b9b12ef49d0b6d7a8887513acb9e9a1a8325148
> From 237557b0e0cff28dc53f384f2297f658bff06459 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <address@hidden>
> Date: Tue, 13 Dec 2016 20:48:16 +0100
> Subject: [PATCH 2/3] services: Fix multiple index and server name
>
> * gnu/services/web.scm (config-domain-strings, config-index-string): separate
> names with a space.
Pushed.
http://git.savannah.gnu.org/cgit/guix.git/commit/?id=4e9ae301ce759f9cf9a09f47dc521d0bc8409f6c
> From a0e24caf1f8a7d89c4ecafc57f9cfe2c098dc89c Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <address@hidden>
> Date: Tue, 13 Dec 2016 21:00:53 +0100
> Subject: [PATCH 3/3] services: Make nginx service extensible
>
> * gnu/services/web.scm (nginx-service-type): Make extensible.
> (nginx-service): Change default options.
> ---
> doc/guix.texi | 17 +++++++++++++++--
> gnu/services/web.scm | 34 ++++++++++++++++++++++++++--------
> 2 files changed, 41 insertions(+), 10 deletions(-)
Pushed with an adjusted commit log to mention all the changes.
http://git.savannah.gnu.org/cgit/guix.git/commit/?id=d338237d8c2408e0cd13ecfeb303e327ff7e3d9b
> address@hidden {Scheme Variable} nginx-service-type
> +This is type for the nginx web server.
> +
> +This service can be extended to add more vhosts than the default one.
> +
> address@hidden
> +(simple-service 'my-extra-vhost nginx-service-type
> + (list (nginx-vhost-configuration (https-port #f)
> + (root
> "/srv/http/extra-website"))))
> address@hidden example
I also changed “vhost” to “server” here.
Thank you!
On a related note: you might have seen the discussion about the ‘root’
parameter of server blocks:
https://lists.gnu.org/archive/html/help-guix/2017-01/msg00005.html
To fix it, we need to have ‘default-nginx-config’ use ‘computed-file’
instead of ‘plain-file’, and to move have ‘default-nginx-server-config’
return a gexp instead of a string.
So something like:
(define (default-nginx-server-config server)
#~(string-append
"server {"
;; …
" root " #$(nginx-server-configuration-root server) ";\n"
"};\n"))
(define (default-nginx-config …)
(computed-file "nginx.conf"
#~(call-with-output-file #$output
(lambda (port)
(display … port)))))
That way, people could use (file-append …) or similar for ‘root’ and
other parameters that denote a file name.
Could you look into it? :-)
Ludo’.
- Re: [PATCH] make nginx service extensible,
Ludovic Courtès <=