From patchwork Mon Mar 31 22:10:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Volf <~@wolfsden.cz> X-Patchwork-Id: 41100 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 0CC9027BBEA; Mon, 31 Mar 2025 23:12:47 +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=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 63C7727BBE2 for ; Mon, 31 Mar 2025 23:12:46 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzNMy-0000LU-1U; Mon, 31 Mar 2025 18:12:36 -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 1tzNMX-0000DG-E0 for guix-patches@gnu.org; Mon, 31 Mar 2025 18:12:11 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tzNMX-0006zm-4D; Mon, 31 Mar 2025 18:12:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=MS7ePYOWm1bXznEoAeWQtMXrvawIlD2Fw46GLdwBagk=; b=WAJj9CHXimEIiSp5k2cKljsg8XGL8xvvApj2zfew/Gp131fnIkDCNBbL+JA4EPsNw1alr2LBWYeD6vAWw3JFOZVKfKxszFW3yTgYCg+A4rsnfK+a3My2vg8dykwxhh6rwQuBV8i98yF+1i1/zPsPWHYV2+p02RF9ZQYOa4BK0nt8wKvUfBcIS5QTvy39dUMwfx8D7dlMPg+RekiiT4dfLtm+qd4Q4lHxrkXc0gD92nRPBmUSDTeqKTH41kIqwbd9z177ldUGjPBXGfACCYLB5xQqv891q3pDDWxTym3Nk8RT7XvpNMveTuYCmwpEJ6LO9jVkx7uEGBdWAMdtH+GBQA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tzNMW-0000cC-V8; Mon, 31 Mar 2025 18:12:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77186] [PATCH v2 14/14] services: gitolite-service-type: Allow setting the admin name. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Mon, 31 Mar 2025 22:12:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77186 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77186@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz>, Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 77186-submit@debbugs.gnu.org id=B77186.17434590752024 (code B ref 77186); Mon, 31 Mar 2025 22:12:08 +0000 Received: (at 77186) by debbugs.gnu.org; 31 Mar 2025 22:11:15 +0000 Received: from localhost ([127.0.0.1]:43368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tzNLe-0000WQ-40 for submit@debbugs.gnu.org; Mon, 31 Mar 2025 18:11:14 -0400 Received: from wolfsden.cz ([37.205.8.62]:41044) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tzNL8-0000R3-Tc for 77186@debbugs.gnu.org; Mon, 31 Mar 2025 18:10:44 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id D8C9C37983B; Mon, 31 Mar 2025 22:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1743459041; bh=VWxynkrVb+7ZmSr2fvYfxZuI5nys7anYqcUuVgVojdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HbEXpZzJNxy5unyleNo6lslQCD9IqAtf+Bi7gRlcOkaGwtcfvX7t5FQqw8+cLrkrB Dy6+jB8TPsqC8RPRuSQau6NXvtNkvQCMmZnjZuoOW4tGb7NpyT2T4+WYjM254zxzD/ 2wNKn1yvTi/ZHdksmk3XTjYFgvkC1Za/2yhEuEusQB7RwQE572JtIBFm8orLesaBeA qC2wtQUWG/5rxnGXtEWv7JbYy+pblsj+lYAtcIfY0g+4GelxJcZ+X6Gy+hnMJ6v4UX LCBG8JZIUCDpu8WPbCeIb8KWOiNKFC39o7bObt3XiMlLvljB4e6WoVDWNi2E8OyXam w2YqzQ5yaJ03j7d26NQK3kFOl7PHIySnze75OP4lITJ4ccEUMvyUCcVOJUBp90tTAD sXzu2HrNZ0oL/hwXmPVdZbAFbRwd4y06HeOMESnl/l2KyoHO/6xyh7a28ElQU9TZZZ Y7/CYWmayw4rLPg6x/BzcaHhh3Mk3IV2Sf9fT/CJIHu51gUbs93M701a5OAtcxOiiL E3rldmSusYi4fRrAgplU87U03BsjgdkJr62JXNXwTvDcm4n7vnXsUzI9KMTl7ValIp R5BVhcdwKjMumyohczBTLPnEfk+PrNJOdIajCtrV5N6i2ajEwzmQGzsTexpxJOwujQ +4Ue2Zqcc6YnD5cKLhXNBrwk= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id A1E1137973A; Mon, 31 Mar 2025 22:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1743459039; bh=VWxynkrVb+7ZmSr2fvYfxZuI5nys7anYqcUuVgVojdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=d3cJihNX/sr68o/u56avFwMGK2QtmYrnwn5uxcfM3DfhVUJpCSLrMV0YSszQgDBR0 u2cT0WTIEc9ktGPauw20WDHMRDXbdZf/5GdiHV8iN6btcBBUsUvBnyB1BFNIhC/kR/ gvRUr1JFXh98EpcVLQWl1nzwUe6OCygfjEOWKEdKAibR+BHM1cDU3ZXURAiPxgFZJb x5dr6mLHl+1ZN3mni6GBgsEIXdVkoGBhg3455rcj27GOYp8zv7PMIJ60VBtIM6VMBl ws9I0l61T+fSQXZ3hUaoEnJtg65c+EejFT2/zlAceTfurO4nsLt/tgdTPmqhaxD+6V JY4iribtSxQofqdisUMBmRszKpO71UfhF5jYvoOccMK82gDRbCj6QvHwYWet5lI2hW uJFPUn6gla3ZpdtVXTc+DWhJmcP6P627folALhg7gf2XjsqdDMD55fc0+U53qW3PXn 4133xYE62bwshCE4sKqyPn9PlMc/5VZQo5W+T43dYGZzYCy2Yg0HkEHBKpr+4cuv2Z UnfGczzQpukrXYP4usnYJ4V09k2D5IP5RKB/bPXM/09QKKiFcdnSuJh4ADlYLQSDf6 x6stlv/pbe+2dW5InzYZFLF12+US3HX1wRKt4lFGo9Pk4iTtJU+hTi8jMQTqsaHaYm TWOYQNVFSp6/EpMiWz3M0MqE= From: Tomas Volf <~@wolfsden.cz> Date: Tue, 1 Apr 2025 00:10:20 +0200 Message-ID: <10ec1b1b255fb295438974862d806a2a19ed9754.1743459020.git.~@wolfsden.cz> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/version-control.scm (): Add admin-name field. (gitolite-activation): Use it. * doc/guix.texi (Version Control Services): Document it. Remove the wrong default value of admin-pubkey. State the need for .pub extension. Change-Id: Idadf4b2697cee6d1da10e6ba03bdc2e1d729c417 --- doc/guix.texi | 9 ++++++++- gnu/services/version-control.scm | 17 +++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ad4a623916..5db6f28f7d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -41013,7 +41013,7 @@ Version Control Services A ``file-like'' object (@pxref{G-Expressions, file-like objects}), representing the git configuration for Gitolite. -@item @code{admin-pubkey} (default: @code{#f}) +@item @code{admin-pubkey} A ``file-like'' object (@pxref{G-Expressions, file-like objects}) used to setup Gitolite. This will be inserted in to the @file{keydir} directory within the gitolite-admin repository. @@ -41024,6 +41024,13 @@ Version Control Services (plain-file "yourname.pub" "ssh-rsa AAAA... guix@@example.com") @end lisp +The file has to have @file{.pub} extension. + +@item @code{admin-name} (default: @code{#f}) +Usually the key name is derived by taking a base name of the +@code{admin-pubkey}. The resulting file name is the name of the +gitolite user. You can use this field to override the automatic name. + @end table @end deftp diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm index e73e77e0b2..51da1c59cb 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -53,6 +53,7 @@ (define-module (gnu services version-control) gitolite-configuration-user gitolite-configuration-rc-file gitolite-configuration-admin-pubkey + gitolite-configuration-admin-name gitolite-rc-file @@ -377,7 +378,9 @@ (define-record-type* (default (gitolite-rc-file))) (git-config gitolite-configuration-git-config (default (gitolite-git-configuration))) - (admin-pubkey gitolite-configuration-admin-pubkey)) + (admin-pubkey gitolite-configuration-admin-pubkey) + (admin-name gitolite-configuration-admin-name + (default #f))) (define (gitolite-accounts config) (match-record config @@ -396,17 +399,19 @@ (define (gitolite-accounts config) (define (gitolite-activation config) (match-record config ( package user group home-directory rc-file admin-pubkey - git-config) + admin-name git-config) #~(begin (use-modules (ice-9 match) (guix build utils)) (let* ((user-info (getpwnam #$user)) (admin-pubkey #$admin-pubkey) - (pubkey-file (string-append - #$home-directory "/" - (basename - (strip-store-file-name admin-pubkey)))) + (pubkey-file (if #$admin-name + (string-append #$admin-name ".pub") + (string-append + #$home-directory "/" + (basename + (strip-store-file-name admin-pubkey))))) (rc-file #$(string-append home-directory "/.gitolite.rc"))) ;; activate-users+groups in (gnu build activation) sets the