From patchwork Sat Jun 3 18:25:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timo Wilken X-Patchwork-Id: 50584 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1683A27BBE2; Sat, 3 Jun 2023 19:26:29 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CEFAA27BBE9 for ; Sat, 3 Jun 2023 19:26:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5Vwy-0003lN-8c; Sat, 03 Jun 2023 14:26:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Vww-0003km-Ke for guix-patches@gnu.org; Sat, 03 Jun 2023 14:26:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5Vww-0000lm-Cc for guix-patches@gnu.org; Sat, 03 Jun 2023 14:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5Vww-0001h2-85 for guix-patches@gnu.org; Sat, 03 Jun 2023 14:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63877] [PATCH] gnu: services: web: Set SSL_CERT_DIR in php-fpm environment. Resent-From: Timo Wilken Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Jun 2023 18:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63877 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63877@debbugs.gnu.org Cc: Timo Wilken X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16858167496487 (code B ref -1); Sat, 03 Jun 2023 18:26:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Jun 2023 18:25:49 +0000 Received: from localhost ([127.0.0.1]:44282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Vwj-0001gZ-AI for submit@debbugs.gnu.org; Sat, 03 Jun 2023 14:25:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:49502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Vwg-0001gO-Fq for submit@debbugs.gnu.org; Sat, 03 Jun 2023 14:25:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Vwg-0003gc-A7 for guix-patches@gnu.org; Sat, 03 Jun 2023 14:25:46 -0400 Received: from mx1.mythic-beasts.com ([2a00:1098:0:86:1000:0:2:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Vwe-0000kD-EP for guix-patches@gnu.org; Sat, 03 Jun 2023 14:25:46 -0400 Received: by mailhub-cam-d.mythic-beasts.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q5Vwc-00Fdc8-FC; Sat, 03 Jun 2023 19:25:42 +0100 From: Timo Wilken Date: Sat, 3 Jun 2023 20:25:12 +0200 Message-Id: <3fec02d93b8e7803dd8183e7f0037ec1a1393b0f.1685816572.git.guix@twilken.net> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BlackCat-Spam-Score: 9 Received-SPF: pass client-ip=2a00:1098:0:86:1000:0:2:1; envelope-from=guix@twilken.net; helo=mx1.mythic-beasts.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Some PHP programs, like Nextcloud, make HTTPS requests to other servers. For this, they need to know where the system CA certificates are. * gnu/services/web.scm (php-fpm-shepherd-service): Set SSL_CERT_DIR environment variable. --- This solution adds a dependency from the resulting Shepherd service to the nss-certs package, which weighs 0.3 MiB. An alternative solution might be to set SSL_CERT_DIR=/etc/ssl/certs instead and rely on nss-certs being installed system-wide. gnu/services/web.scm | 7 +++++++ 1 file changed, 7 insertions(+) base-commit: 66c9b82fed3c59ee07187898592c688c82fed273 diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 45897d7d6f..e46710a040 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2020, 2021 Alexandru-Sergiu Marton ;;; Copyright © 2022 Simen Endsjø ;;; Copyright © 2023 Bruno Victal +;;; Copyright © 2023 Timo Wilken ;;; ;;; This file is part of GNU Guix. ;;; @@ -1096,6 +1097,12 @@ (define php-fpm-shepherd-service #$@(if php-ini-file `("-c" ,php-ini-file) '())) + #:environment-variables + (cons* + ;; Needed by e.g. Nextcloud to make HTTPS requests. + (string-append + "SSL_CERT_DIR=" #$(file-append nss-certs "/etc/ssl/certs")) + (default-environment-variables)) #:pid-file #$pid-file)) (stop #~(make-kill-destructor)))))))