services: web: Remove default certificate and key files for nginx.

If nginx is configured with a ssl-certificate file, and ssl-certificate-key,
it will fail to start unless these exist. To avoid this happening, change the
default to #f.

* gnu/services/web.scm (<nginx-server-configuration>)
  [ssl-certificate,ssl-certificate-key]: Set the defaults to #f.
* gnu/tests/web.scm (%nginx-servers): Remove redundant
  nginx-server-configuration fields.
* doc/guix.texi (Web Services): Update examples and documentation.
This commit is contained in:
Christopher Baines 2017-12-09 09:24:07 +00:00
parent b7db2c63ed
commit c48aa70a9a
No known key found for this signature in database
GPG Key ID: 5E28A33B0B84F577
3 changed files with 7 additions and 22 deletions

View File

@ -14813,10 +14813,7 @@ A simple example configuration is given below.
(server-blocks (server-blocks
(list (nginx-server-configuration (list (nginx-server-configuration
(server-name '("www.example.com")) (server-name '("www.example.com"))
(root "/srv/http/www.example.com") (root "/srv/http/www.example.com"))))))
(https-port #f)
(ssl-certificate #f)
(ssl-certificate-key #f))))))
@end example @end example
In addition to adding server blocks to the service configuration In addition to adding server blocks to the service configuration
@ -14826,9 +14823,6 @@ blocks, as in this example:
@example @example
(simple-service 'my-extra-server nginx-service-type (simple-service 'my-extra-server nginx-service-type
(list (nginx-server-configuration (list (nginx-server-configuration
(https-port #f)
(ssl-certificate #f)
(ssl-certificate-key #f)
(root "/srv/http/extra-website") (root "/srv/http/extra-website")
(try-files (list "$uri" "$uri/index.html"))))) (try-files (list "$uri" "$uri/index.html")))))
@end example @end example
@ -14873,10 +14867,7 @@ HTTPS.
(server-blocks (server-blocks
(list (nginx-server-configuration (list (nginx-server-configuration
(server-name '("www.example.com")) (server-name '("www.example.com"))
(root "/srv/http/www.example.com") (root "/srv/http/www.example.com"))))))
(https-port #f)
(ssl-certificate #f)
(ssl-certificate-key #f))))))
@end example @end example
@item @code{upstream-blocks} (default: @code{'()}) @item @code{upstream-blocks} (default: @code{'()})
@ -14899,9 +14890,6 @@ requests with two servers.
(list (nginx-server-configuration (list (nginx-server-configuration
(server-name '("www.example.com")) (server-name '("www.example.com"))
(root "/srv/http/www.example.com") (root "/srv/http/www.example.com")
(https-port #f)
(ssl-certificate #f)
(ssl-certificate-key #f)
(locations (locations
(list (list
(nginx-location-configuration (nginx-location-configuration
@ -14965,11 +14953,11 @@ Nginx will send the list of files in the directory.
A list of files whose existence is checked in the specified order. A list of files whose existence is checked in the specified order.
@code{nginx} will use the first file it finds to process the request. @code{nginx} will use the first file it finds to process the request.
@item @code{ssl-certificate} (default: @code{"/etc/nginx/cert.pem"}) @item @code{ssl-certificate} (default: @code{#f})
Where to find the certificate for secure connections. Set it to @code{#f} if Where to find the certificate for secure connections. Set it to @code{#f} if
you don't have a certificate or you don't want to use HTTPS. you don't have a certificate or you don't want to use HTTPS.
@item @code{ssl-certificate-key} (default: @code{"/etc/nginx/key.pem"}) @item @code{ssl-certificate-key} (default: @code{#f})
Where to find the private key for secure connections. Set it to @code{#f} if Where to find the private key for secure connections. Set it to @code{#f} if
you don't have a key or you don't want to use HTTPS. you don't have a key or you don't want to use HTTPS.

View File

@ -102,9 +102,9 @@
(try-files nginx-server-configuration-try-files (try-files nginx-server-configuration-try-files
(default '())) (default '()))
(ssl-certificate nginx-server-configuration-ssl-certificate (ssl-certificate nginx-server-configuration-ssl-certificate
(default "/etc/nginx/cert.pem")) (default #f))
(ssl-certificate-key nginx-server-configuration-ssl-certificate-key (ssl-certificate-key nginx-server-configuration-ssl-certificate-key
(default "/etc/nginx/key.pem")) (default #f))
(server-tokens? nginx-server-configuration-server-tokens? (server-tokens? nginx-server-configuration-server-tokens?
(default #f))) (default #f)))

View File

@ -45,10 +45,7 @@
;; Server blocks. ;; Server blocks.
(list (nginx-server-configuration (list (nginx-server-configuration
(root "/srv") (root "/srv")
(http-port 8042) (http-port 8042))))
(https-port #f)
(ssl-certificate #f)
(ssl-certificate-key #f))))
(define %nginx-os (define %nginx-os
;; Operating system under test. ;; Operating system under test.