all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: iyzsong@member.fsf.org (宋文武)
To: ng0 <ng0@we.make.ritual.n0.is>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: service: Add git-service.
Date: Sat, 01 Oct 2016 07:49:36 +0800	[thread overview]
Message-ID: <8737khlzhr.fsf@member.fsf.org> (raw)
In-Reply-To: <878tudpxgx.fsf@we.make.ritual.n0.is> (ng0@we.make.ritual.n0.is's message of "Tue, 27 Sep 2016 08:18:22 +0000")

ng0 <ng0@we.make.ritual.n0.is> writes:


>> From d1d7eb59ca53833098cea2d6eddaa59f1494b579 Mon Sep 17 00:00:00 2001
>> From: ng0 <ng0@we.make.ritual.n0.is>
>> Date: Fri, 8 Jul 2016 15:42:55 +0000
>> Subject: [PATCH] gnu: services: Add git-service.
>>
>> * gnu/services/version-control.scm: New file, create it.
>> (git-service): New Procedures.
>> (git-service-type): New variable.
>> * doc/guix.texi: Add documentation.

I think it should be: * doc/guix.text (Services)(Version Control): New section.

> [...]
>> +(define %git-accounts
>> +  ;; User account and groups for git-daemon.
>> +  (list (user-group
>> +         (name "git")
>> +         (system? #t))
>> +        (user-account
>> +         (name "git")
>> +         (system? #t)
>> +         (group "git")
>> +         (comment "Shepherd created user for the git-daemon service")
>> +         (home-directory "/var/git")

I think it doesn't need a home directory.

>> +         (shell #~(string-append #$shadow "/bin/git-shell")))))

Use 'nologin' should be enough, according to `man git-shell', it's for
SSH access.

Also, it seems this 'git' user is not used anywhere, it should be passed
as the '--user' argument to 'git daemon' or as '#:user' to
'make-forkexec-constructor'.

>> +
>> +(define (git-activation config)
>> +  "Return the activation gexp for CONFIG."
>> +  #~(begin (use-modules (guix build utils))
>> +           ;; Create the default base-directory, see `man git daemon'.
>> +           (mkdir-p "/var/git/repositories")))

This should create the 'git-configuration-base-directory' of config, and
make sure it's readable by the 'git' user.


>> +(define* (git-service #:key
>> +                      (git git)
>> +                      (base-directory "/var/git/repositories")
>> +                      (user-directory? #f)
>> +                      (user-directory? "")
>> +                      (directory? #f)
>> +                      (directory "")
>> +                      (port 9418)
>> +                      (pid-file? #t)
>> +                      (pid-file "/var/run/git-daemon.pid")
>> +                      (max-connections 32))

This should just accept a <git-configuration> object, and document it in
the manaual (no need to make detail comments in the git-command, which I
think a mention to `man git-daemon' is fine there).


For testing, I guess 'git clone git://localhost/xxx' in the VM is
enough.

And the patch doesn't apply for me, can you send an update one?

  reply	other threads:[~2016-09-30 23:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 13:04 [PATCH] gnu: service: Add git-service ng0
2016-08-29 14:12 ` Andy Wingo
2016-08-29 14:34   ` ng0
2016-08-29 20:05     ` ng0
2016-08-30  7:40       ` Andy Wingo
2016-08-30 11:45         ` ng0
2016-08-30 12:12           ` Andy Wingo
2016-08-30 17:50             ` ng0
2016-09-27  8:18               ` ng0
2016-09-30 23:49                 ` 宋文武 [this message]
2016-10-16 14:30                   ` ng0
2016-09-27  8:20               ` ng0
2016-09-30  7:41                 ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737khlzhr.fsf@member.fsf.org \
    --to=iyzsong@member.fsf.org \
    --cc=guix-devel@gnu.org \
    --cc=ng0@we.make.ritual.n0.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.