From patchwork Fri Mar 25 15:35:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 38105 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 9937C27BBE9; Fri, 25 Mar 2022 15:36:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED 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 EECD427BBEA for ; Fri, 25 Mar 2022 15:36:19 +0000 (GMT) Received: from localhost ([::1]:53900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXlz9-0007Q4-29 for patchwork@mira.cbaines.net; Fri, 25 Mar 2022 11:36:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXlyt-0007Pj-0m for guix-patches@gnu.org; Fri, 25 Mar 2022 11:36:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58321) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXlys-000219-Ol for guix-patches@gnu.org; Fri, 25 Mar 2022 11:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXlys-0001Gl-It for guix-patches@gnu.org; Fri, 25 Mar 2022 11:36:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#52578] [PATCH v2 1/2] DRAFT gnu: Add openldap-for-services. References: In-Reply-To: Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 Mar 2022 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52578 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52578@debbugs.gnu.org Cc: jean-francois.guillaume@univ-nantes.fr, zimoun Received: via spool by 52578-submit@debbugs.gnu.org id=B52578.16482225274831 (code B ref 52578); Fri, 25 Mar 2022 15:36:02 +0000 Received: (at 52578) by debbugs.gnu.org; 25 Mar 2022 15:35:27 +0000 Received: from localhost ([127.0.0.1]:52216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXlyI-0001Fp-LW for submit@debbugs.gnu.org; Fri, 25 Mar 2022 11:35:26 -0400 Received: from mail-wm1-f45.google.com ([209.85.128.45]:54969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXlyH-0001FW-4r for 52578@debbugs.gnu.org; Fri, 25 Mar 2022 11:35:25 -0400 Received: by mail-wm1-f45.google.com with SMTP id r64so4657534wmr.4 for <52578@debbugs.gnu.org>; Fri, 25 Mar 2022 08:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/BE5ZHl3S+tEFA/XklRHpWWnozpakZ1UFovO5VJfVe0=; b=CRHlRqqXeq4M4JD5oEGqbOFy1kp4Z7uybCbturHfkAn5z+FqQ4ivrmJTYSUtnERq4F +WYes1QvQZLa4oPJbtZmRsf/hL3OrBMLYegw/Pepos61RXO+w0ZoTg2oMzfXs61kxf8N hfSsKjIaUDBxIKuWNEeCmxTqOBIYiNSA6BZ3VoNd9Bk12V3EoOXuiOKZjC7/TX67iEHI zb26D1IDt52wNT2RR1AhjoZvSlx2VGcF8Ka1+W/pHsKVywLKuqljlF7oY9Jt6OoFljmr gtbcyMSq+s9xgaPz0ypdUUgccd5gFfVeas/UUMc3jpFoU+VUFUB+d326q/uWCDk8WjPB lz1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/BE5ZHl3S+tEFA/XklRHpWWnozpakZ1UFovO5VJfVe0=; b=0i1GC7ItKeJ+emvkzhJusZ4l8H+gvYmPWHeaHxpZbeYrONkJKbNGfBmdW/7/NUD4Za g2v5yobSe3Be9ZT29r9E5maUE3zSTnPy2FMiraB/IqqQt54Hk7YxFbp+6hbSBCQQnCHI LMmTeRnZb6gSKSLHnNJLGbDgCrEsTyFluKRgjICmWrZPw0H8TpU5gX8USxdsWN55kMRc MjyJtcrVeG0kPZDfPgL2/SoM2wb0uxRTSwPQE61QQEjOJ2Q3FiwRIgPTn3KzUu5Ng8Y2 /QIACWof+2KMTsU2Tuo9rvRuOiQxXV8/YMybCdSsRUhjOdgrm9jLIx1MrFP8upYbdn47 wxUg== X-Gm-Message-State: AOAM53029Cgh5PrG0HEudMCBJOKa+UTOK6W4ZftF8nVlS9OLq0l56Rmq z9i6C6OqaHXVPHr5cib9/3e/HUG56Us= X-Google-Smtp-Source: ABdhPJwzlPDRME/iLNHwqvJJroZyjqb77d2dlZaC1h6dr4C914MqCEQCQ1N126QRYEk1JYjlf6rY+w== X-Received: by 2002:a05:600c:49a9:b0:38c:987d:d692 with SMTP id h41-20020a05600c49a900b0038c987dd692mr10711344wmp.166.1648222519265; Fri, 25 Mar 2022 08:35:19 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id w5-20020a5d5445000000b00203f8c96bcesm5189244wrv.49.2022.03.25.08.35.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 08:35:18 -0700 (PDT) From: zimoun Date: Fri, 25 Mar 2022 16:35:16 +0100 Message-Id: <20220325153517.1478717-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/openldap.scm (openldap-for-services): New variable. Co-Authored-By: Jean-François Guillaume . --- gnu/packages/openldap.scm | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm index c8a47e45d5..8374386807 100644 --- a/gnu/packages/openldap.scm +++ b/gnu/packages/openldap.scm @@ -9,6 +9,8 @@ ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2022 Marius Bakke +;;; Copyright © 2022 Jean-François Guillaume +;;; Copyright © 2022 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,6 +32,7 @@ (define-module (gnu packages openldap) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages databases) #:use-module (gnu packages dbm) #:use-module (gnu packages documentation) #:use-module (gnu packages gettext) @@ -164,6 +167,50 @@ (define-public openldap-2.6 (lambda (port) (format port "INPUT ( libldap.so )~%"))))))))))) +(define-public openldap-for-services + ;; TODO: Update in the next rebuild cycle + (let* ((openldap-minimal openldap-2.6)) + (package + (inherit openldap-minimal) + (name (string-append (package-name openldap-minimal) "-for-services")) + (arguments + (substitute-keyword-arguments (package-arguments openldap-minimal) + ((#:configure-flags flags) + `(append (list + "--enable-aci" + "--enable-argon2" + "--enable-backends=mod" + "--enable-balancer" + "--enable-cleartext" + "--enable-crypt" + "--enable-debug" + "--enable-dynacl" + "--enable-modules" + "--enable-ipv6" + "--enable-local" + "--enable-overlays=mod" + "--enable-rlookups" + "--enable-shared" + "--enable-slapd" + "--enable-slapi" + "--enable-spasswd" + "--enable-syslog" + "--with-tls=openssl") + ,flags)))) + (inputs (modify-inputs (package-inputs openldap-minimal) + (delete "gnutls") + (append argon2 + libevent + libltdl + lz4 + openssl + perl + snappy + unixodbc + wiredtiger))) + (native-inputs (modify-inputs (package-native-inputs openldap-minimal) + (append pkg-config)))))) + (define-public nss-pam-ldapd (package (name "nss-pam-ldapd") From patchwork Fri Mar 25 15:35:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 38106 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 CC1FB27BBEA; Fri, 25 Mar 2022 15:36:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED 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 4703927BBE9 for ; Fri, 25 Mar 2022 15:36:21 +0000 (GMT) Received: from localhost ([::1]:53932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXlzA-0007RT-EB for patchwork@mira.cbaines.net; Fri, 25 Mar 2022 11:36:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXlyt-0007Pq-Az for guix-patches@gnu.org; Fri, 25 Mar 2022 11:36:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXlyt-00021E-2c for guix-patches@gnu.org; Fri, 25 Mar 2022 11:36:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXlyt-0001Gs-0U for guix-patches@gnu.org; Fri, 25 Mar 2022 11:36:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#52578] [PATCH v2 2/2] DRAFT services: Add openldap service. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 Mar 2022 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52578 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52578@debbugs.gnu.org Cc: jean-francois.guillaume@univ-nantes.fr Received: via spool by 52578-submit@debbugs.gnu.org id=B52578.16482225274837 (code B ref 52578); Fri, 25 Mar 2022 15:36:02 +0000 Received: (at 52578) by debbugs.gnu.org; 25 Mar 2022 15:35:27 +0000 Received: from localhost ([127.0.0.1]:52218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXlyI-0001Fs-Vp for submit@debbugs.gnu.org; Fri, 25 Mar 2022 11:35:27 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:39531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXlyH-0001FY-IZ for 52578@debbugs.gnu.org; Fri, 25 Mar 2022 11:35:26 -0400 Received: by mail-wr1-f50.google.com with SMTP id j18so11375419wrd.6 for <52578@debbugs.gnu.org>; Fri, 25 Mar 2022 08:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KnfZ8OfGFc5Se4GzR4vfCgmJ3nill7kzCqLJa4gRUYI=; b=AJsjgA9eZCK3MZwg3Isu5F0m5+53gJttjD2Pp3Lgq7mm6cfmEbb8iK7I+pXMV0l+Zo DFi+Nofh4aCG0PPJdLveZDOVoRNIhwigu2oc85DVA4hNZJ2wvovfLGMBUPS8+bw03/RO R1utKBptY7oSn8sFK9WpQ1ITl0+JUZCN+HVdOzsa44LIHD4l0ha3FfxR7YCmH+xdxy90 I7NXzrgZ/4fqXTcGes9teFrRvYrHth3+WJBGjxQ5W0cfGvuiSmKogcNG6NyLpicYJaRA 6L5+aocjyNuEWXFDwg2C7p+ozWp4uRpnYKRURYVJZN30OLJNTua6xXF39SiJlhrtCWYq ai4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KnfZ8OfGFc5Se4GzR4vfCgmJ3nill7kzCqLJa4gRUYI=; b=TZIBu6VDpk/ha6kjGf9U3bizpMC7gTDOJi67m9qdJTyqIdkbsKeBdreg52sbWhOHbT dCNXEM5XILQd9IZw/DsB9FJi7RLMyUQqXuWy82uMZV8j6zhywXiHQPPbXkPPM1IyZa5Y MyfrJ0ZpeJQvuaNntwfzGyPuz2ocYCPfQ+lqz5gnRJjBuug9pHNsLdMSJrDTHYiRZc5R lB2q/QbcCR4obxqIPDME5d3vaaEQUwPSLOsWjBv9M5sfeo5W1ZkNYy4staShxC5rbDh1 p7EFXduQbkfnJVTzHMCetSiyNg/L00khM0bf4GI9dSr680MR3sy5cOINAiv3Yjt4HaEQ 3ohg== X-Gm-Message-State: AOAM533cKN4aTdOq6i9KuHTWtWLVxoaoupJwxENXldilzRmZYqbGlcqa pB6hLUzaWjayf+oJegqVXl0BFCUE0E8= X-Google-Smtp-Source: ABdhPJxOsehjLr5HUS5Qh6SgAbpE8eTRvDrowDw6RYhmrb54VPuUrHQyNskO1GjhyL+8VaHdPqZSXg== X-Received: by 2002:a05:6000:1541:b0:204:1a56:e159 with SMTP id 1-20020a056000154100b002041a56e159mr9395588wry.469.1648222519806; Fri, 25 Mar 2022 08:35:19 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id w5-20020a5d5445000000b00203f8c96bcesm5189244wrv.49.2022.03.25.08.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 08:35:19 -0700 (PDT) From: zimoun Date: Fri, 25 Mar 2022 16:35:17 +0100 Message-Id: <20220325153517.1478717-2-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220325153517.1478717-1-zimon.toutoune@gmail.com> References: <20220325153517.1478717-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 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" X-getmail-retrieved-from-mailbox: Patches From: Jean-François Guillaume * gnu/services/openlda.scm (): New record. (openldap-shepherd-service): New procedure. (%openldap-activation, openldap-service-type): New variable. --- gnu/services/openldap.scm | 84 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 gnu/services/openldap.scm diff --git a/gnu/services/openldap.scm b/gnu/services/openldap.scm new file mode 100644 index 0000000000..dc5ae3fa8f --- /dev/null +++ b/gnu/services/openldap.scm @@ -0,0 +1,84 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Jean-François Guillaume +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services openldap) + #:use-module (gnu packages openldap) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + #:use-module (guix) + #:use-module (guix records) + #:use-module (ice-9 match) + #:export (openldap-configuration + openldap-configuration? + openldap-service-type + + )) + +(define-record-type* + openldap-configuration make-openldap-configuration + openldap-configuration? + (openldap openldap-configuration-openldap + (default openldap)) + (uri openldap-configuration-uri + (default "ldapi:// ldap://")) + (logflags openldap-configuration-logflags + (default "0")) + (pid-file openldap-configuration-pid-file + (default "/var/run/openldap/slapd.pid")) + (config-file openldap-configuration-config-file + (default (file-append openldap "/etc/openldap/slapd.conf"))) + (log-file openldap-configuration-log-file + (default "/var/log/slapd.log"))) + +(define openldap-shepherd-service + (match-lambda + (($ openldap uri logflags pid-file config-file log-file) + (list + (shepherd-service + (provision '(slapd) ) + (documentation "Run OpenLDAP.") + (requirement '(user-processes)) + (respawn? #t) + (start #~(make-forkexec-constructor + (list + #$(file-append openldap "/libexec/slapd") + "-h" #$uri + "-d" #$logflags + "-f" #$config-file) + #:pid-file #$pid-file + #:log-file #$log-file)) + (stop #~(make-kill-destructor))))))) + +(define %openldap-activation + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/run/openldap") + (mkdir-p "/var/lib/ldap") + #t))) + +(define openldap-service-type + (service-type (name 'slapd) + (extensions + (list + (service-extension shepherd-root-service-type + openldap-shepherd-service) + (service-extension activation-service-type + (const %openldap-activation)))) + (description + "Run @uref{https://www.openldap.org, OpenLDAP}.")))