[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] improve nginx-service
From: |
Julien Lepiller |
Subject: |
Re: [PATCH] improve nginx-service |
Date: |
Wed, 26 Oct 2016 21:45:07 +0200 |
On Mon, 24 Oct 2016 22:51:27 +0200
address@hidden (Ludovic Courtès) wrote:
> Hi,
>
> Julien Lepiller <address@hidden> skribis:
>
> > On Wed, 19 Oct 2016 23:04:14 +0200
> > address@hidden (Ludovic Courtès) wrote:
> >
> >> Hi Julien,
> >>
> >> This looks like a great improvement to me! Sounds nicer than
> >> fiddling with config files.
> >>
> >> I suppose we could make ‘nginx-service-type’ extensible (info
> >> "(guix) Service Types and Services") so that people can write
> >> services that define new vhosts?
> >
> > You mean something like udev-service-type where you could extend it
> > with a list of vhosts?
>
> Yes, exactly. So for example one could write a service for some
> high-level Web service that would in turn create an nginx vhost.
> WDYT?
Sounds great. I tried to work on it, but I'm stuck.
I'm trying to implement a service that extends nginx-service-type with
a vhost (default-nginx-vhost-service-type), and it creates a root
directory for a default empty index file. Now I would like to pass the
absolute path of this directory to the <nginx-vhost-configuration>, but
it is too early for that. System configuration with this new service
fails with:
Backtrace:
In guix/ui.scm:
1220: 19 [run-guix-command system "reconfigure" "/etc/config.scm"]
In ice-9/boot-9.scm:
157: 18 [catch srfi-34 #<procedure 56353c0 at guix/ui.scm:426:2
()> ...] 157: 17 [catch system-error ...]
In guix/scripts/system.scm:
870: 16 [#<procedure 560f270 at guix/scripts/system.scm:862:2 ()>]
776: 15 [process-action reconfigure ("/etc/config.scm") ...]
In guix/store.scm:
1182: 14 [run-with-store # ...]
In guix/scripts/system.scm:
788: 13 [#<procedure 5be5180 at guix/scripts/system.scm:780:8 (state)>
#] 552: 12 [perform-action reconfigure # # ...]
In gnu/system.scm:
627: 11 [operating-system-derivation # # #f]
In gnu/services.scm:
585: 10 [loop #]
In srfi/srfi-1.scm:
578: 9 [map #<procedure loop (sink)> (# # #)]
In gnu/services.scm:
585: 8 [loop #<<service> type: # parameters: #>]
In srfi/srfi-1.scm:
578: 7 [map #<procedure loop (sink)> (# # # # ...)]
In gnu/services.scm:
585: 6 [loop #<<service> type: # parameters: ()>]
In srfi/srfi-1.scm:
578: 5 [map #<procedure 55bd960 at gnu/services.scm:574:4 (service)>
(# # # # ...)] In gnu/services/web.scm:
189: 4 [nginx-shepherd-service #]
181: 3 [nginx-action "-p" "/var/run/nginx"]
141: 2 [nginx-config-file "/var/log/nginx" "/var/run/nginx" ...]
In srfi/srfi-1.scm:
576: 1 [map #<procedure default-nginx-vhost-config (vhost)> (# #)]
In unknown file:
?: 0 [string-append " server {\n" " listen 80;\n" ...]
ERROR: In procedure string-append:
ERROR: In procedure string-append: Wrong type (expecting string):
#<<computed-file> name: "default-nginx-vhost" gexp: #<gexp (begin
(mkdir #<gexp-output out>) (symlink #<gexp-input #<<plain-file> name:
"index.html" content: "[...]" references: ()>:out> (string-append
#<gexp-output out> "/index.html"))) 5959270> options: (#:local-build?
#t)>
>
> > From 8bda6fdd53b3cc7470fac67228a88e0d165134dd Mon Sep 17 00:00:00
> > 2001 From: Julien Lepiller <address@hidden>
> > Date: Mon, 26 Sep 2016 23:55:58 +0200
> > Subject: [PATCH] services: improve nginx-service configuration
> >
> > * gnu/services/web.scm (<nginx-vhost-configuration>): New record
> > type. (config-domain-strings): New procedure.
> > (config-index-strings): New procedure.
> > (default-nginx-vhost-config): New procedure.
> > (default-nginx-config): Add vhost support and temporary directories
> > (nginx-activation): Create temporary directories
> > (nginx-service): Add vhost-list key.
> > * doc/guix.texi (Web Services): Document
> > 'nginx-vhost-configuration'.
>
> Applied with the minor changes below.
>
> Thank you!
>
> Ludo’.
>
0001-services-Make-nginx-service-type-extensible.patch
Description: Text Data