From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcvSM-0005ik-8S for guix-patches@gnu.org; Wed, 02 Aug 2017 11:21:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcvSI-0000bo-8J for guix-patches@gnu.org; Wed, 02 Aug 2017 11:21:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:35895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcvSI-0000bh-4M for guix-patches@gnu.org; Wed, 02 Aug 2017 11:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dcvSH-0006MN-Rd for guix-patches@gnu.org; Wed, 02 Aug 2017 11:21:01 -0400 Subject: [bug#26684] [PATCH 2/2] web: Check for the existance of SSL related files. Resent-Message-ID: From: Christopher Baines Date: Wed, 2 Aug 2017 16:20:41 +0100 Message-Id: <20170802152041.11053-2-mail@cbaines.net> In-Reply-To: <20170802152041.11053-1-mail@cbaines.net> References: <87o9rytiwy.fsf@gnu.org> <20170802152041.11053-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26684@debbugs.gnu.org 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 97318ecb1..cc7adeb5e 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") -- 2.13.1