all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ng0 <ng0@we.make.ritual.n0.is>
To: 宋文武 <iyzsong@member.fsf.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: service: Add git-service.
Date: Sun, 16 Oct 2016 14:30:15 +0000	[thread overview]
Message-ID: <871szgtlhk.fsf@we.make.ritual.n0.is> (raw)
In-Reply-To: <8737khlzhr.fsf@member.fsf.org>

宋文武 <iyzsong@member.fsf.org> writes:

> 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.

The ssh access is intended, that's why it had a home-directory. For now
I will apply what you suggested, but this is a use case I have myself
and why would I use gitolite when git+ssh do the job well enough.

> 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).

How? This thread is taking so much time because this is one of my 3
first services and I'm trying to learn more guile. I'll look at other
services like before, but I asked for help because I'm stuck. I think
openssh-service had this.. But what I have worked before I added all
other options, and for now I want it this way.. Just debug this without
changing it any further.
But if this would not require much changes which can not break things
further, I'll apply it.

>
> 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-10-16 14:30 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                 ` 宋文武
2016-10-16 14:30                   ` ng0 [this message]
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=871szgtlhk.fsf@we.make.ritual.n0.is \
    --to=ng0@we.make.ritual.n0.is \
    --cc=guix-devel@gnu.org \
    --cc=iyzsong@member.fsf.org \
    /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.