From patchwork Mon Nov 7 06:40:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Abramov X-Patchwork-Id: 44365 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 EE7C327BBEA; Mon, 7 Nov 2022 06:41: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_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 07BD927BBE9 for ; Mon, 7 Nov 2022 06:41:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orvoe-00078v-CX; Mon, 07 Nov 2022 01:41:04 -0500 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 1orvoc-00077Q-HA for guix-patches@gnu.org; Mon, 07 Nov 2022 01:41:02 -0500 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 1orvoc-0003MX-9L for guix-patches@gnu.org; Mon, 07 Nov 2022 01:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1orvoc-0001ds-5t for guix-patches@gnu.org; Mon, 07 Nov 2022 01:41:02 -0500 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: Mon, 07 Nov 2022 06:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58989 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: Christopher Baines Cc: 58989@debbugs.gnu.org X-Debbugs-Original-Cc: 58989@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by 58989-submit@debbugs.gnu.org id=B58989.16678032136210 (code B ref 58989); Mon, 07 Nov 2022 06:41:02 +0000 Received: (at 58989) by debbugs.gnu.org; 7 Nov 2022 06:40:13 +0000 Received: from localhost ([127.0.0.1]:33030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orvnp-0001c0-1z for submit@debbugs.gnu.org; Mon, 07 Nov 2022 01:40:13 -0500 Received: from mail.mmer.org ([178.22.65.174]:55024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orvnn-0001bj-Eq for 58989@debbugs.gnu.org; Mon, 07 Nov 2022 01:40:12 -0500 Received: from mail.mmer.org (localhost [127.0.0.1]) by mail.mmer.org (OpenSMTPD) with ESMTP id 1406822c; Mon, 7 Nov 2022 06:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=mmer.org; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=dkim; bh=XFN3Eldm0NHzlLeyBTqQC2hKr1tuUbTXl44A20 AgLfw=; b=sRhyTvZIrn4mNFtwyqlwIn4zuH9RJKooZwCDdZIK6DAmk200f7AsEU 6VqrAFuYnpOvS+9093ME7w8sQdon0gVJ0SRoivThDj5DYJeZTIcAr6rMsSg1//Nl VioXkGZKgEdgMCq38ZaQjP5elmtqFAn8Do+hl1Tk6ipj1b7nAx78E= Received: from delta.lan (j74210.upc-j.chello.nl [24.132.74.210]) by mail.mmer.org (OpenSMTPD) with ESMTPSA id fb04ae20 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 7 Nov 2022 06:40:03 +0000 (UTC) In-Reply-To: <87a654gouw.fsf@cbaines.net> (Christopher Baines's message of "Sun, 06 Nov 2022 15:03:38 +0100") References: <20221103161525.2130-1-levenson@mmer.org> <87a654gouw.fsf@cbaines.net> Date: Mon, 07 Nov 2022 07:40:02 +0100 Message-ID: <87leon469p.fsf@delta.lan> User-Agent: Gnus/5.13 (Gnus v5.13) 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: , 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 Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Christopher Baines writes: > Alexey Abramov via Guix-patches via writes: > [...] > > This generally looks good, but I believe the above will break if > local-code is #f. Yeah, you are absolutely right. I have attached an updated patch. From 0eb61654d46e171b29a3be7b75cad22f8c32f636 Mon Sep 17 00:00:00 2001 From: Alexey Abramov Date: Wed, 19 Oct 2022 11:34:31 +0200 Subject: [PATCH] services: gitolite: Add local-code configuration option. * 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 | 8 +++++++- 2 files changed, 16 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..b6b78e504e 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,14 @@ (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) -- 2.36.1