mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 12:05:19 -06:00
services: gitolite-service-type: Allow setting the admin name.
* gnu/services/version-control.scm (<gitolite-configuration>): 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 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
parent
24396e8327
commit
85e6371a3f
2 changed files with 19 additions and 7 deletions
|
|
@ -41010,7 +41010,7 @@ representing the configuration for Gitolite.
|
|||
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.
|
||||
|
|
@ -41021,6 +41021,13 @@ To specify the SSH key as a string, use the @code{plain-file} function.
|
|||
(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
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
gitolite-configuration-user
|
||||
gitolite-configuration-rc-file
|
||||
gitolite-configuration-admin-pubkey
|
||||
gitolite-configuration-admin-name
|
||||
|
||||
<gitolite-rc-file>
|
||||
gitolite-rc-file
|
||||
|
|
@ -377,7 +378,9 @@ access to exported repositories under @file{/srv/git}."
|
|||
(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 <gitolite-configuration>
|
||||
|
|
@ -396,17 +399,19 @@ access to exported repositories under @file{/srv/git}."
|
|||
(define (gitolite-activation config)
|
||||
(match-record config <gitolite-configuration>
|
||||
( 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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue