git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Philip Oakley" <philipoakley@iee.org>
Cc: <git@vger.kernel.org>
Subject: Re: Everyday contents (was Re: What's cooking in git.git (Jul 2014, #04; Tue, 22))
Date: Tue, 05 Aug 2014 13:26:57 -0700	[thread overview]
Message-ID: <xmqqzjfiof72.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqqvbqezs64.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Wed, 30 Jul 2014 10:13:07 -0700")

Continued: this message covers the last part.

| Repository Administration[[Repository Administration]]
| ------------------------------------------------------
| 
| A repository administrator uses the following tools to set up
| and maintain access to the repository by developers.
| 
|   * linkgit:git-daemon[1] to allow anonymous download from
|     repository.
| 
|   * linkgit:git-shell[1] can be used as a 'restricted login shell'
|     for shared central repository users.
| 
| link:howto/update-hook-example.html[update hook howto] has a good
| example of managing a shared central repository.

This part is fairly stale.  We only talk about allowing anonymous
fetching via git-daemon and pushing via git-over-ssh.  The readers
would want to be aware that they can set up their hosts for fetching
and pushing via git-over-http aka "Smart http", and browsing via
gitweb.  We should definitely at least mention these, and we may
even want to describe them at the same level of detail as the
existing examples.

I wonder if we also want to mention (but not describe, just make the
readers aware of) widely deployed hosting/browsing solutions such as
gitolite, gerrit code review, and cgit.

Do tasks that are described here have impact on the use of these
third-party tools?  For example, I understand gitolite does not
require one UNIX user per biological human user, but the vanilla
push-over-ssh described in these examples does.  I guess the burden
of telling the users to "unlearn everything you read about setting
up the vanilla git-over-ssh when you use gitolite" falls on gitolite
doc, so in that sense we shouldn't have to worry about doing any of
that here.

| Examples
| ~~~~~~~~
| We assume the following in /etc/services::
| +
| ------------
| $ grep 9418 /etc/services
| git		9418/tcp		# Git Version Control System
| ------------

OK.

| Run git-daemon to serve /pub/scm from inetd.::
| +
| ------------
| $ grep git /etc/inetd.conf
| git	stream	tcp	nowait	nobody \
|   /usr/bin/git-daemon git-daemon --inetd --export-all /pub/scm
| ------------
| +
| The actual configuration line should be on one line.

OK.

| Run git-daemon to serve /pub/scm from xinetd.::
| +
| ------------
| $ cat /etc/xinetd.d/git-daemon
| # default: off
| # description: The Git server offers access to Git repositories
| service git
| {
|         disable = no
|         type            = UNLISTED
|         port            = 9418
|         socket_type     = stream
|         wait            = no
|         user            = nobody
|         server          = /usr/bin/git-daemon
|         server_args     = --inetd --export-all --base-path=/pub/scm
|         log_on_failure  += USERID
| }
| ------------
| +
| Check your xinetd(8) documentation and setup, this is from a Fedora system.
| Others might be different.

OK, but which vintage of Fedora? ;-)

| Give push/pull only access to developers.::

This entry may mislead the readers if the "access" this section
talks about is to the git-daemon we just set up in the above.  We
should clarify that this is about git-over-ssh access, i.e. the
users will be doing this:

	$ git push/pull host.xz:/pub/scm/project

or

	$ git push/pull ssh://host.xz/pub/scm/project

or somesuch.

| +
| ------------
| $ grep git /etc/passwd <1>
| alice:x:1000:1000::/home/alice:/usr/bin/git-shell
| bob:x:1001:1001::/home/bob:/usr/bin/git-shell
| cindy:x:1002:1002::/home/cindy:/usr/bin/git-shell
| david:x:1003:1003::/home/david:/usr/bin/git-shell
| $ grep git /etc/shells <2>
| /usr/bin/git-shell
| ------------
| +
| <1> log-in shell is set to /usr/bin/git-shell, which does not
| allow anything but `git push` and `git pull`.  The users should
| get an ssh access to the machine.
| <2> in many distributions /etc/shells needs to list what is used
| as the login shell.

One possible mis-interpretation of <1> is "Thanks to these git-shell
entries, the users will get `push/pull` accesses to the box; they
separately need ssh access to the box (to do something more than
that, if desired)".

In reality, this configuration _requires_ them to have an ssh access
to the box and these entries restricts them to only run push/pull
against the host.  We may want to rephrase to clarify.

| CVS-style shared repository.::
| +
| ------------
| $ grep git /etc/group <1>
| git:x:9418:alice,bob,cindy,david
| $ cd /home/devo.git
| $ ls -l <2>
|   lrwxrwxrwx   1 david git    17 Dec  4 22:40 HEAD -> refs/heads/master
|   drwxrwsr-x   2 david git  4096 Dec  4 22:40 branches
|   -rw-rw-r--   1 david git    84 Dec  4 22:40 config
|   -rw-rw-r--   1 david git    58 Dec  4 22:40 description
|   drwxrwsr-x   2 david git  4096 Dec  4 22:40 hooks
|   -rw-rw-r--   1 david git 37504 Dec  4 22:40 index
|   drwxrwsr-x   2 david git  4096 Dec  4 22:40 info
|   drwxrwsr-x   4 david git  4096 Dec  4 22:40 objects
|   drwxrwsr-x   4 david git  4096 Nov  7 14:58 refs
|   drwxrwsr-x   2 david git  4096 Dec  4 22:40 remotes
| $ ls -l hooks/update <3>
|   -r-xr-xr-x   1 david git  3536 Dec  4 22:40 update
| $ cat info/allowed-users <4>
| refs/heads/master	alice\|cindy
| refs/heads/doc-update	bob
| refs/tags/v[0-9]*	david
| ------------
| +
| <1> place the developers into the same git group.
| <2> and make the shared repository writable by the group.
| <3> use update-hook example by Carl from Documentation/howto/
| for branch policy control.
| <4> alice and cindy can push into master, only bob can push into doc-update.
| david is the release manager and is the only person who can
| create and push version tags.

OK.

| HTTP server to support dumb protocol transfer.::
| +
| ------------
| dev$ git update-server-info <1>
| dev$ ftp user@isp.example.com <2>
| ftp> cp -r .git /home/user/myproject.git
| ------------
| +
| <1> make sure your info/refs and objects/info/packs are up-to-date
| <2> upload to public HTTP server hosted by your ISP.

This may want to be removed, for two reasons.  Nobody should be
using dumb HTTP anymore, and the "cp" implies that the repository is
not maintained at the isp.example.com site but is synchronized
manually from some other location with _only_ ftp access into it,
which is not a typical way to run your project (I admit I did this
myself in very early days of Git when Linus was still running the
project).

Thanks.

  reply	other threads:[~2014-08-05 20:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 21:44 What's cooking in git.git (Jul 2014, #04; Tue, 22) Junio C Hamano
2014-07-23  6:56 ` Philip Oakley
2014-07-23 18:10   ` Junio C Hamano
2014-07-24 22:37     ` Philip Oakley
2014-07-24 22:45       ` Junio C Hamano
2014-07-25 22:08         ` Junio C Hamano
2014-07-28 22:12           ` Philip Oakley
2014-07-30 17:13           ` Everyday contents (was Re: What's cooking in git.git (Jul 2014, #04; Tue, 22)) Junio C Hamano
2014-08-05 20:26             ` Junio C Hamano [this message]
2014-08-05 21:00               ` Philip Oakley
2014-08-02 17:28           ` Everday contents (was part of " Philip Oakley
2014-08-03 17:29             ` Everday contents Junio C Hamano
2014-08-03 18:41               ` Philip Oakley
2014-08-04 17:00                 ` Junio C Hamano
2014-07-23 14:17 ` What's cooking in git.git (Jul 2014, #04; Tue, 22) Karsten Blees
2014-07-23 18:24   ` Junio C Hamano
2014-07-25 12:30   ` Duy Nguyen
2014-07-29 19:43     ` [RFC/PATCH] Windows tests: let $TRASH_DIRECTORY point to native Windows path Karsten Blees
2014-08-27 13:08       ` Duy Nguyen

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqzjfiof72.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=philipoakley@iee.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 public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).