From patchwork Thu Nov 3 16:15:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Abramov X-Patchwork-Id: 44257 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 60D3827BBEB; Thu, 3 Nov 2022 16:18:43 +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_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 4F6BA27BBE9 for ; Thu, 3 Nov 2022 16:18:42 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqcuq-0000vL-ED; Thu, 03 Nov 2022 12:18:06 -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 1oqctr-0000Wm-9q for guix-patches@gnu.org; Thu, 03 Nov 2022 12:17:08 -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 1oqctq-00082q-Ka for guix-patches@gnu.org; Thu, 03 Nov 2022 12:17:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqctq-000348-Dw for guix-patches@gnu.org; Thu, 03 Nov 2022 12:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58989] [PATCH] services: gitolite: Add local-code configuration option. Resent-From: Alexey Abramov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Nov 2022 16:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58989 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58989@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166749217411714 (code B ref -1); Thu, 03 Nov 2022 16:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Nov 2022 16:16:14 +0000 Received: from localhost ([127.0.0.1]:50122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqct4-00032s-9X for submit@debbugs.gnu.org; Thu, 03 Nov 2022 12:16:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:50354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqcsz-00032e-Ha for submit@debbugs.gnu.org; Thu, 03 Nov 2022 12:16:12 -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 1oqcsr-0008F7-SL for guix-patches@gnu.org; Thu, 03 Nov 2022 12:16:03 -0400 Received: from mail.mmer.org ([178.22.65.174]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqcsq-0007rq-2D for guix-patches@gnu.org; Thu, 03 Nov 2022 12:16:01 -0400 Received: from mail.mmer.org (localhost [127.0.0.1]) by mail.mmer.org (OpenSMTPD) with ESMTP id d9232543 for ; Thu, 3 Nov 2022 16:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=mmer.org; h=from:to :subject:date:message-id:mime-version:content-transfer-encoding; s=dkim; bh=V2QJMRn02h61z9Q/a0kQ+qw1OgLlZlf3/zyEwALVEz0=; b=BTeE iN41NVaehBiYjT8bOkYk6WpQo/mljg01N1GLW6N8es63vfBx30sHB7Q6rM8wb8Sx tEx824YNKr5okwL8t1apWo73CPXTQ/Jf6EdjxBjo4f9Hv2OTBSOgANw872jNmRVN eYZmVXR1GuMK3yrqC9Za7eF8dQHQostZU6exOrw= Received: from delta (j74210.upc-j.chello.nl [24.132.74.210]) by mail.mmer.org (OpenSMTPD) with ESMTPSA id 14f2a8ec (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Thu, 3 Nov 2022 16:15:54 +0000 (UTC) Date: Thu, 3 Nov 2022 17:15:25 +0100 Message-Id: <20221103161525.2130-1-levenson@mmer.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Received-SPF: pass client-ip=178.22.65.174; envelope-from=levenson@mmer.org; helo=mail.mmer.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Sender: "Guix-patches" Reply-to: Alexey Abramov X-ACL-Warn: , Alexey Abramov via Guix-patches X-Patchwork-Original-From: Alexey Abramov via Guix-patches via From: Alexey Abramov Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/version-control.scm (gitolite-rc-file): Add local-code field. (gitolite-rc-file-compiler): Serialize the field. * doc/guix.texi: Document it. --- doc/guix.texi | 9 +++++++++ gnu/services/version-control.scm | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 80fb3bc47f..c05c7961e5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35704,6 +35704,15 @@ A value like @code{#o0027} will give read access to the group used by Gitolite (by default: @code{git}). This is necessary when using Gitolite with software like cgit or gitweb. +@item @code{local-code} (default: @code{"$rc@{GL_ADMIN_BASE@}/local"}) +Allows you to add your own non-core programs, or even override the +shipped ones with your own. + +Please supply the FULL path to this variable. By default, directory +called "local" in your gitolite clone is used, providing the benefits of +versioning them as well as making changes to them without having to log +on to the server. + @item @code{unsafe-pattern} (default: @code{#f}) An optional Perl regular expression for catching unsafe configurations in the configuration file. See diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm index cd8763f5ea..8c9701afe0 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -54,6 +54,7 @@ (define-module (gnu services version-control) gitolite-rc-file + gitolite-rc-file-local-code gitolite-rc-file-umask gitolite-rc-file-unsafe-pattern gitolite-rc-file-git-config-keys @@ -242,6 +243,8 @@ (define-record-type* gitolite-rc-file? (umask gitolite-rc-file-umask (default #o0077)) + (local-code gitolite-rc-file-local-code + (default "$rc{GL_ADMIN_BASE}/local")) (unsafe-pattern gitolite-rc-file-unsafe-pattern (default #f)) (git-config-keys gitolite-rc-file-git-config-keys @@ -263,11 +266,13 @@ (define-record-type* (define-gexp-compiler (gitolite-rc-file-compiler (file ) system target) (match file - (($ umask unsafe-pattern git-config-keys roles enable) + (($ umask local-code unsafe-pattern git-config-keys roles enable) (apply text-file* "gitolite.rc" `("%RC = (\n" " UMASK => " ,(format #f "~4,'0o" umask) ",\n" " GIT_CONFIG_KEYS => '" ,git-config-keys "',\n" + ,(if local-code + (simple-format #f " LOCAL_CODE => \"~A\",\n" local-code)) " ROLES => {\n" ,@(map (match-lambda ((role . value)