[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: web: Check for the existance of SSL related files.
From: |
Christopher Baines |
Subject: |
02/02: web: Check for the existance of SSL related files. |
Date: |
Thu, 17 Aug 2017 13:32:37 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository guix.
commit f2d7a492df759ab7416ff4b244e37896835f04fa
Author: Christopher Baines <address@hidden>
Date: Wed Aug 2 15:52:36 2017 +0100
web: Check for the existance of SSL related files.
This adds back the previous behaviour of the nginx-service-type, where the
service would check at the time when the configuration is generated if the
SSL
certificate and certificate key file exists.
* gnu/services/web.scm (emit-nginx-server-config): Add back check for SSL
related files.
---
gnu/services/web.scm | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 97318ec..cc7adeb 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -157,6 +157,16 @@ of index files."
(syntax-parameterize ((<> (identifier-syntax x*)))
(list tail ...))
'())))
+ (for-each
+ (match-lambda
+ ((record-key . file)
+ (if (and file (not (file-exists? file)))
+ (error
+ (simple-format
+ #f
+ "~A in the nginx configuration for the server with name \"~A\"
does not exist" record-key server-name)))))
+ `(("ssl-certificate" . ,ssl-certificate)
+ ("ssl-certificate-key" . ,ssl-certificate-key)))
(list
" server {\n"
(and/l http-port " listen " (number->string <>) ";\n")