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.

Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Alexey Abramov 2022-10-19 11:34:31 +02:00 committed by Christopher Baines
parent b670dc6c8a
commit 73b3519568
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577
2 changed files with 16 additions and 1 deletions

View file

@ -35736,6 +35736,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 (by default: @code{git}). This is necessary when using Gitolite with software
like cgit or gitweb. 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}) @item @code{unsafe-pattern} (default: @code{#f})
An optional Perl regular expression for catching unsafe configurations in An optional Perl regular expression for catching unsafe configurations in
the configuration file. See the configuration file. See

View file

@ -54,6 +54,7 @@ (define-module (gnu services version-control)
<gitolite-rc-file> <gitolite-rc-file>
gitolite-rc-file gitolite-rc-file
gitolite-rc-file-local-code
gitolite-rc-file-umask gitolite-rc-file-umask
gitolite-rc-file-unsafe-pattern gitolite-rc-file-unsafe-pattern
gitolite-rc-file-git-config-keys gitolite-rc-file-git-config-keys
@ -242,6 +243,8 @@ (define-record-type* <gitolite-rc-file>
gitolite-rc-file? gitolite-rc-file?
(umask gitolite-rc-file-umask (umask gitolite-rc-file-umask
(default #o0077)) (default #o0077))
(local-code gitolite-rc-file-local-code
(default "$rc{GL_ADMIN_BASE}/local"))
(unsafe-pattern gitolite-rc-file-unsafe-pattern (unsafe-pattern gitolite-rc-file-unsafe-pattern
(default #f)) (default #f))
(git-config-keys gitolite-rc-file-git-config-keys (git-config-keys gitolite-rc-file-git-config-keys
@ -263,11 +266,14 @@ (define-record-type* <gitolite-rc-file>
(define-gexp-compiler (gitolite-rc-file-compiler (define-gexp-compiler (gitolite-rc-file-compiler
(file <gitolite-rc-file>) system target) (file <gitolite-rc-file>) system target)
(match file (match file
(($ <gitolite-rc-file> umask unsafe-pattern git-config-keys roles enable) (($ <gitolite-rc-file> umask local-code unsafe-pattern git-config-keys roles enable)
(apply text-file* "gitolite.rc" (apply text-file* "gitolite.rc"
`("%RC = (\n" `("%RC = (\n"
" UMASK => " ,(format #f "~4,'0o" umask) ",\n" " UMASK => " ,(format #f "~4,'0o" umask) ",\n"
" GIT_CONFIG_KEYS => '" ,git-config-keys "',\n" " GIT_CONFIG_KEYS => '" ,git-config-keys "',\n"
,(if local-code
(simple-format #f " LOCAL_CODE => \"~A\",\n" local-code)
"")
" ROLES => {\n" " ROLES => {\n"
,@(map (match-lambda ,@(map (match-lambda
((role . value) ((role . value)