mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02: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:
committed by
Maxim Cournoyer
parent
24396e8327
commit
85e6371a3f
@@ -41010,7 +41010,7 @@ representing the configuration for Gitolite.
|
|||||||
A ``file-like'' object (@pxref{G-Expressions, file-like objects}),
|
A ``file-like'' object (@pxref{G-Expressions, file-like objects}),
|
||||||
representing the git configuration for Gitolite.
|
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
|
A ``file-like'' object (@pxref{G-Expressions, file-like objects}) used to
|
||||||
setup Gitolite. This will be inserted in to the @file{keydir} directory
|
setup Gitolite. This will be inserted in to the @file{keydir} directory
|
||||||
within the gitolite-admin repository.
|
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")
|
(plain-file "yourname.pub" "ssh-rsa AAAA... guix@@example.com")
|
||||||
@end lisp
|
@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 table
|
||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
gitolite-configuration-user
|
gitolite-configuration-user
|
||||||
gitolite-configuration-rc-file
|
gitolite-configuration-rc-file
|
||||||
gitolite-configuration-admin-pubkey
|
gitolite-configuration-admin-pubkey
|
||||||
|
gitolite-configuration-admin-name
|
||||||
|
|
||||||
<gitolite-rc-file>
|
<gitolite-rc-file>
|
||||||
gitolite-rc-file
|
gitolite-rc-file
|
||||||
@@ -377,7 +378,9 @@ access to exported repositories under @file{/srv/git}."
|
|||||||
(default (gitolite-rc-file)))
|
(default (gitolite-rc-file)))
|
||||||
(git-config gitolite-configuration-git-config
|
(git-config gitolite-configuration-git-config
|
||||||
(default (gitolite-git-configuration)))
|
(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)
|
(define (gitolite-accounts config)
|
||||||
(match-record config <gitolite-configuration>
|
(match-record config <gitolite-configuration>
|
||||||
@@ -396,17 +399,19 @@ access to exported repositories under @file{/srv/git}."
|
|||||||
(define (gitolite-activation config)
|
(define (gitolite-activation config)
|
||||||
(match-record config <gitolite-configuration>
|
(match-record config <gitolite-configuration>
|
||||||
( package user group home-directory rc-file admin-pubkey
|
( package user group home-directory rc-file admin-pubkey
|
||||||
git-config)
|
admin-name git-config)
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (ice-9 match)
|
(use-modules (ice-9 match)
|
||||||
(guix build utils))
|
(guix build utils))
|
||||||
|
|
||||||
(let* ((user-info (getpwnam #$user))
|
(let* ((user-info (getpwnam #$user))
|
||||||
(admin-pubkey #$admin-pubkey)
|
(admin-pubkey #$admin-pubkey)
|
||||||
(pubkey-file (string-append
|
(pubkey-file (if #$admin-name
|
||||||
#$home-directory "/"
|
(string-append #$admin-name ".pub")
|
||||||
(basename
|
(string-append
|
||||||
(strip-store-file-name admin-pubkey))))
|
#$home-directory "/"
|
||||||
|
(basename
|
||||||
|
(strip-store-file-name admin-pubkey)))))
|
||||||
(rc-file #$(string-append home-directory "/.gitolite.rc")))
|
(rc-file #$(string-append home-directory "/.gitolite.rc")))
|
||||||
|
|
||||||
;; activate-users+groups in (gnu build activation) sets the
|
;; activate-users+groups in (gnu build activation) sets the
|
||||||
|
|||||||
Reference in New Issue
Block a user