* [PATCH] Smart-http documentation: add example of how to execute from userdir
@ 2009-12-26 17:07 Tarmigan Casebolt
2009-12-27 3:19 ` Tay Ray Chuan
2009-12-27 21:15 ` [PATCH] " Shawn O. Pearce
0 siblings, 2 replies; 14+ messages in thread
From: Tarmigan Casebolt @ 2009-12-26 17:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Tarmigan Casebolt, Shawn O. Pearce
Smart-http may be an attactive and easy way for people to setup git
hosting on shared servers whose primary web server configuration they
do not control. To facilite this, provide an example of how it may be
done.
cc: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
Documentation/git-http-backend.txt | 40 ++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 67aec06..0cca5ba 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -60,8 +60,8 @@ automatically by the web server.
EXAMPLES
--------
-All of the following examples map 'http://$hostname/git/foo/bar.git'
-to '/var/www/git/foo/bar.git'.
+Unless otherwise noted, the following examples map
+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.
Apache 2.x::
Ensure mod_cgi, mod_alias, and mod_env are enabled, set
@@ -144,6 +144,42 @@ ScriptAliasMatch \
ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
----------------------------------------------------------------
+In the following example, a repository at
+'/home/$username/devel/foo/bar.git' will be accessible at
+'http://$hostname/\~$username/cgi-bin/git/foo/bar.git'
+
+From UserDir on Apache 2.x::
+ One way to configure 'git-http-backend' to execute and serve
+ from a user directory (for example, on a shared hosting
+ provider), is to have a symbolic link that points from the cgi
+ directory to the 'git-http-backend' executable in libexec. The
+ advantage of the symblic link is that any updates to the
+ installed version of 'git-http-backend' also update the version
+ that is run in the userdir. Depending on the configuration of
+ the server, the symbolic link may be able to point to a global
+ installation of git. If, for security reasons, the server is
+ configured to follow symbolic links only if the owner matches,
+ an installation of git into the user directory may be required.
+ In that case, install git as that user into \~/bin, \~/libexec
+ etc. Then create a symlink named 'git' in the cgi-bin
+ directory that points to
+ \~/libexec/git-core/git-http-backend. Put the following in
+ \~/public_html/cgi-bin/.htaccess:
++
+----------------------------------------------------------------
+SetHandler cgi-script
+Options +SymLinksIfOwnerMatch
+SetEnv GIT_PROJECT_ROOT /home/$username/devel
+----------------------------------------------------------------
++
+Also add any needed authentication to the .htaccess file as discussed
+in earlier examples.
++
+If the web server does not follow any symbolic links, the
+'git-http-backend' executable may be copied into the cgi-bin directory
+and renamed to 'git' to acheive the same effect, but it will also need
+to be manually updated whenever a new version of 'git-http-backend' is
+installed.
ENVIRONMENT
-----------
--
1.6.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] Smart-http documentation: add example of how to execute from userdir
2009-12-26 17:07 [PATCH] Smart-http documentation: add example of how to execute from userdir Tarmigan Casebolt
@ 2009-12-27 3:19 ` Tay Ray Chuan
2009-12-28 4:18 ` Tarmigan
2009-12-27 21:15 ` [PATCH] " Shawn O. Pearce
1 sibling, 1 reply; 14+ messages in thread
From: Tay Ray Chuan @ 2009-12-27 3:19 UTC (permalink / raw)
To: Tarmigan Casebolt; +Cc: Junio C Hamano, git, Shawn O. Pearce
Hi,
On Sun, Dec 27, 2009 at 1:07 AM, Tarmigan Casebolt
<tarmigan+git@gmail.com> wrote:
> @@ -60,8 +60,8 @@ automatically by the web server.
>
> EXAMPLES
> --------
> -All of the following examples map 'http://$hostname/git/foo/bar.git'
> -to '/var/www/git/foo/bar.git'.
> +Unless otherwise noted, the following examples map
> +'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.
This rephrase seems to be unrelated (to providing an example of
serving smart http).
> @@ -144,6 +144,42 @@ ScriptAliasMatch \
> ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
> ----------------------------------------------------------------
>
> +In the following example, a repository at
> +'/home/$username/devel/foo/bar.git' will be accessible at
> +'http://$hostname/\~$username/cgi-bin/git/foo/bar.git'
> +
> +From UserDir on Apache 2.x::
> + One way to configure 'git-http-backend' to execute and serve
> + from a user directory (for example, on a shared hosting
> + provider), is to have a symbolic link that points from the cgi
> + directory to the 'git-http-backend' executable in libexec. The
> + advantage of the symblic link is that any updates to the
s/symblic/symbolic/.
> + installed version of 'git-http-backend' also update the version
s/update/updates/.
> + that is run in the userdir. Depending on the configuration of
> + the server, the symbolic link may be able to point to a global
> + installation of git. If, for security reasons, the server is
At this point, the user dealing with the "easy" case (ie. the user
just symlinks the shared git installation and doesn't have to create
symlinks in his own home directory) should have enough configuration
details without having to read any further. So, you could tell the
user about the symlinks to create and the configuration lines in
.htaccess.
It might also be a good idea to start a new paragraph for the "hard"
case, for better readability.
--
Cheers,
Ray Chuan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Smart-http documentation: add example of how to execute from userdir
2009-12-26 17:07 [PATCH] Smart-http documentation: add example of how to execute from userdir Tarmigan Casebolt
2009-12-27 3:19 ` Tay Ray Chuan
@ 2009-12-27 21:15 ` Shawn O. Pearce
2009-12-28 4:06 ` Tarmigan
1 sibling, 1 reply; 14+ messages in thread
From: Shawn O. Pearce @ 2009-12-27 21:15 UTC (permalink / raw)
To: Tarmigan Casebolt; +Cc: Junio C Hamano, git
Tarmigan Casebolt <tarmigan+git@gmail.com> wrote:
> Smart-http may be an attactive and easy way for people to setup git
> hosting on shared servers whose primary web server configuration they
> do not control. To facilite this, provide an example of how it may be
> done.
...
> + \~/public_html/cgi-bin/.htaccess:
> ++
> +----------------------------------------------------------------
> +SetHandler cgi-script
> +Options +SymLinksIfOwnerMatch
> +SetEnv GIT_PROJECT_ROOT /home/$username/devel
> +----------------------------------------------------------------
At this point, isn't this just easier?
mkdir ~/public_html/git
vi ~/public_html/git/.htaccess
SetEnv GIT_PROJECT_ROOT /home/$username/devel
ScriptAlias / /usr/libexec/git-core/git-http-backend/
No need to mess around with SymlinksIfOwnerMatch and all of that fun.
If you have .htaccess override allows, you should be able to setup
a ScriptAlias without needing to use a cgi-bin directory.
--
Shawn.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Smart-http documentation: add example of how to execute from userdir
2009-12-27 21:15 ` [PATCH] " Shawn O. Pearce
@ 2009-12-28 4:06 ` Tarmigan
0 siblings, 0 replies; 14+ messages in thread
From: Tarmigan @ 2009-12-28 4:06 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Junio C Hamano, git
On Sun, Dec 27, 2009 at 4:15 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Tarmigan Casebolt <tarmigan+git@gmail.com> wrote:
>> Smart-http may be an attactive and easy way for people to setup git
>> hosting on shared servers whose primary web server configuration they
>> do not control. To facilite this, provide an example of how it may be
>> done.
> ...
>> + \~/public_html/cgi-bin/.htaccess:
>> ++
>> +----------------------------------------------------------------
>> +SetHandler cgi-script
>> +Options +SymLinksIfOwnerMatch
>> +SetEnv GIT_PROJECT_ROOT /home/$username/devel
>> +----------------------------------------------------------------
>
> At this point, isn't this just easier?
>
> mkdir ~/public_html/git
> vi ~/public_html/git/.htaccess
>
> SetEnv GIT_PROJECT_ROOT /home/$username/devel
> ScriptAlias / /usr/libexec/git-core/git-http-backend/
Yes, that would be perfect. But ScriptAlias is only valid in the
"server config" or "virtual host" contexts which is why the
symlink/copy executable convolutions might be needed. Can you see a
simpler way around it?
Thanks,
Tarmigan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Smart-http documentation: add example of how to execute from userdir
2009-12-27 3:19 ` Tay Ray Chuan
@ 2009-12-28 4:18 ` Tarmigan
2009-12-28 4:46 ` [PATCH v2] " Tarmigan Casebolt
0 siblings, 1 reply; 14+ messages in thread
From: Tarmigan @ 2009-12-28 4:18 UTC (permalink / raw)
To: Tay Ray Chuan; +Cc: Junio C Hamano, git, Shawn O. Pearce
On Sat, Dec 26, 2009 at 10:19 PM, Tay Ray Chuan <rctay89@gmail.com> wrote:
>> -All of the following examples map 'http://$hostname/git/foo/bar.git'
>> -to '/var/www/git/foo/bar.git'.
>> +Unless otherwise noted, the following examples map
>> +'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.
>
> This rephrase seems to be unrelated (to providing an example of
> serving smart http).
I think this change is related because previously all the examples
provided the same mapping. With the new example with a different
mapping, the "_All_ of the following" is no longer true.
>> @@ -144,6 +144,42 @@ ScriptAliasMatch \
>> ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
>> ----------------------------------------------------------------
>>
>> +In the following example, a repository at
>> +'/home/$username/devel/foo/bar.git' will be accessible at
>> +'http://$hostname/\~$username/cgi-bin/git/foo/bar.git'
>> +
>> +From UserDir on Apache 2.x::
>> + One way to configure 'git-http-backend' to execute and serve
>> + from a user directory (for example, on a shared hosting
>> + provider), is to have a symbolic link that points from the cgi
>> + directory to the 'git-http-backend' executable in libexec. The
>> + advantage of the symblic link is that any updates to the
>
> s/symblic/symbolic
> s/update/updates/.
Thanks.
> At this point, the user dealing with the "easy" case (ie. the user
> just symlinks the shared git installation and doesn't have to create
> symlinks in his own home directory) should have enough configuration
> details without having to read any further. So, you could tell the
> user about the symlinks to create and the configuration lines in
> .htaccess.
>
> It might also be a good idea to start a new paragraph for the "hard"
> case, for better readability.
OK, these suggestions sound good to me. I'll send out an updated patch shortly.
Thanks,
Tarmigan
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2] Smart-http documentation: add example of how to execute from userdir
2009-12-28 4:18 ` Tarmigan
@ 2009-12-28 4:46 ` Tarmigan Casebolt
2009-12-31 2:18 ` Tay Ray Chuan
0 siblings, 1 reply; 14+ messages in thread
From: Tarmigan Casebolt @ 2009-12-28 4:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Tarmigan Casebolt, Tay Ray Chuan, Shawn O. Pearce
Smart-http may be an attactive and easy way for people to setup git
hosting on shared servers whose primary web server configuration they
do not control. To facilite this, provide an example of how it may be
done.
cc: Tay Ray Chuan <rctay89@gmail.com>
cc: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
Looking at the
s/update/updates/
suggestion again, I decided not to make that change because I think
the original is grammical even if a little bit awkward. The first
'updates' is the noun, so the verb should be 'update' without an 's'.
I also tried rephrasing that sentence completely, but did not end up
with something better. Suggestions welcome.
Documentation/git-http-backend.txt | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 67aec06..fdff2d3 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -60,8 +60,8 @@ automatically by the web server.
EXAMPLES
--------
-All of the following examples map 'http://$hostname/git/foo/bar.git'
-to '/var/www/git/foo/bar.git'.
+Unless otherwise noted, the following examples map
+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.
Apache 2.x::
Ensure mod_cgi, mod_alias, and mod_env are enabled, set
@@ -144,6 +144,33 @@ ScriptAliasMatch \
ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
----------------------------------------------------------------
+In the following example, a repository at
+'/home/$username/devel/foo/bar.git' will be accessible at
+'http://$hostname/\~$username/cgi-bin/git/foo/bar.git'
+
+From UserDir on Apache 2.x::
+ One way to configure 'git-http-backend' to execute and serve
+ from a user directory (for example, on a shared hosting
+ provider), is to have a symbolic link named 'git' that points
+ from the cgi directory to the 'git-http-backend' executable in
+ libexec. The advantage of the symbolic link is that any updates
+ to the installed version of 'git-http-backend' also update the
+ version that is run in the userdir.
++
+----------------------------------------------------------------
+SetHandler cgi-script
+Options +SymLinksIfOwnerMatch
+SetEnv GIT_PROJECT_ROOT /home/$username/devel
+----------------------------------------------------------------
++
+Also add any needed authentication to the .htaccess file as discussed
+in earlier examples.
++
+If the web server does not follow any symbolic links, the
+'git-http-backend' executable may be copied into the cgi-bin directory
+and renamed to 'git' to acheive the same effect, but it will also need
+to be manually updated whenever a new version of 'git-http-backend' is
+installed.
ENVIRONMENT
-----------
--
1.6.6.1.g8eede.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2] Smart-http documentation: add example of how to execute from userdir
2009-12-28 4:46 ` [PATCH v2] " Tarmigan Casebolt
@ 2009-12-31 2:18 ` Tay Ray Chuan
2010-01-02 21:18 ` [PATCH v3] " Tarmigan Casebolt
0 siblings, 1 reply; 14+ messages in thread
From: Tay Ray Chuan @ 2009-12-31 2:18 UTC (permalink / raw)
To: Tarmigan Casebolt; +Cc: Junio C Hamano, git, Shawn O. Pearce
Hi,
On Mon, Dec 28, 2009 at 12:46 PM, Tarmigan Casebolt
<tarmigan+git@gmail.com> wrote:
> Looking at the
> s/update/updates/
> suggestion again, I decided not to make that change because I think
> the original is grammical even if a little bit awkward. The first
> 'updates' is the noun, so the verb should be 'update' without an 's'.
Indeed.
> I also tried rephrasing that sentence completely, but did not end up
> with something better. ?Suggestions welcome.
My attempt is found below.
> +In the following example, a repository at
I was thinking s/a repository at/the repository/.
> +'/home/$username/devel/foo/bar.git' will be accessible at
> +'http://$hostname/\~$username/cgi-bin/git/foo/bar.git'
You left out a full-stop for this sentence.
> +From UserDir on Apache 2.x::
> + One way to configure 'git-http-backend' to execute and serve
> + from a user directory (for example, on a shared hosting
> + provider), is to have a symbolic link named 'git' that points
> + from the cgi directory to the 'git-http-backend' executable in
> + libexec. The advantage of the symbolic link is that any updates
> + to the installed version of 'git-http-backend' also update the
> + version that is run in the userdir.
We could try
The advantage is that this symbolic link always points to the latest
installed version; one does not have to make any changes to the
symbolic link when the installed 'git-http-backend' is updated.
I thought the corollary (after the ';') was a bit long-winded, but it
explains the advantage more clearly.
--
Cheers,
Ray Chuan
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v3] Smart-http documentation: add example of how to execute from userdir
2009-12-31 2:18 ` Tay Ray Chuan
@ 2010-01-02 21:18 ` Tarmigan Casebolt
2010-01-03 2:11 ` Tay Ray Chuan
2010-01-03 8:34 ` Junio C Hamano
0 siblings, 2 replies; 14+ messages in thread
From: Tarmigan Casebolt @ 2010-01-02 21:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Tarmigan Casebolt, Tay Ray Chuan, Shawn O. Pearce
Smart-http may be an attactive and easy way for people to setup git
hosting on shared servers whose primary web server configuration they
do not control. To facilite this, provide an example of how it may be
done.
cc: Tay Ray Chuan <rctay89@gmail.com>
cc: Shawn O. Pearce <spearce@spearce.org>
Editing-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
Documentation/git-http-backend.txt | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 67aec06..0485033 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -60,8 +60,8 @@ automatically by the web server.
EXAMPLES
--------
-All of the following examples map 'http://$hostname/git/foo/bar.git'
-to '/var/www/git/foo/bar.git'.
+Unless otherwise noted, the following examples map
+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.
Apache 2.x::
Ensure mod_cgi, mod_alias, and mod_env are enabled, set
@@ -144,6 +144,34 @@ ScriptAliasMatch \
ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
----------------------------------------------------------------
+In the following example, the repository at
+'/home/$username/devel/foo/bar.git' will be accessible at
+'http://$hostname/~$username/cgi-bin/git/foo/bar.git'.
+
+From UserDir on Apache 2.x::
+ One way to configure 'git-http-backend' to execute and serve
+ from a user directory (for example, on a shared hosting
+ provider), is to have a symbolic link named 'git' that points
+ from the cgi directory to the 'git-http-backend' executable in
+ libexec. The advantage is that this symbolic link always
+ points to the latest installed version; one does not have to
+ make any changes to the symbolic link when the installed
+ 'git-http-backend' is updated.
++
+----------------------------------------------------------------
+SetHandler cgi-script
+Options +SymLinksIfOwnerMatch
+SetEnv GIT_PROJECT_ROOT /home/$username/devel
+----------------------------------------------------------------
++
+Also add any needed authentication to the .htaccess file as discussed
+in earlier examples.
++
+If the web server does not follow any symbolic links, the
+'git-http-backend' executable may be copied into the cgi-bin directory
+and renamed to 'git' to acheive the same effect, but it will also need
+to be manually updated whenever a new version of 'git-http-backend' is
+installed.
ENVIRONMENT
-----------
--
1.6.6.236.gc56f3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v3] Smart-http documentation: add example of how to execute from userdir
2010-01-02 21:18 ` [PATCH v3] " Tarmigan Casebolt
@ 2010-01-03 2:11 ` Tay Ray Chuan
2010-01-03 8:34 ` Junio C Hamano
1 sibling, 0 replies; 14+ messages in thread
From: Tay Ray Chuan @ 2010-01-03 2:11 UTC (permalink / raw)
To: Tarmigan Casebolt; +Cc: Junio C Hamano, git, Shawn O. Pearce
Hi,
On Sun, Jan 3, 2010 at 5:18 AM, Tarmigan Casebolt
<tarmigan+git@gmail.com> wrote:
> Smart-http may be an attactive and easy way for people to setup git
> hosting on shared servers whose primary web server configuration they
> do not control. To facilite this, provide an example of how it may be
> done.
>
> cc: Tay Ray Chuan <rctay89@gmail.com>
> cc: Shawn O. Pearce <spearce@spearce.org>
> Editing-by: Tay Ray Chuan <rctay89@gmail.com>
> Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
--
Cheers,
Ray Chuan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3] Smart-http documentation: add example of how to execute from userdir
2010-01-02 21:18 ` [PATCH v3] " Tarmigan Casebolt
2010-01-03 2:11 ` Tay Ray Chuan
@ 2010-01-03 8:34 ` Junio C Hamano
2010-01-04 14:06 ` Shawn O. Pearce
1 sibling, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2010-01-03 8:34 UTC (permalink / raw)
To: Tay Ray Chuan, Shawn O. Pearce; +Cc: git, Tarmigan Casebolt
Tarmigan Casebolt <tarmigan+git@gmail.com> writes:
> Smart-http may be an attactive and easy way for people to setup git
> hosting on shared servers whose primary web server configuration they
> do not control. To facilite this, provide an example of how it may be
> done.
>
> cc: Tay Ray Chuan <rctay89@gmail.com>
> cc: Shawn O. Pearce <spearce@spearce.org>
> Editing-by: Tay Ray Chuan <rctay89@gmail.com>
> Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
I still see Cc: here; are people named above (and others commented on
earlier versions) happy with this round?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3] Smart-http documentation: add example of how to execute from userdir
2010-01-03 8:34 ` Junio C Hamano
@ 2010-01-04 14:06 ` Shawn O. Pearce
2010-01-05 7:59 ` Tarmigan
0 siblings, 1 reply; 14+ messages in thread
From: Shawn O. Pearce @ 2010-01-04 14:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Tay Ray Chuan, git, Tarmigan Casebolt
Junio C Hamano <gitster@pobox.com> wrote:
> Tarmigan Casebolt <tarmigan+git@gmail.com> writes:
>
> > Smart-http may be an attactive and easy way for people to setup git
> > hosting on shared servers whose primary web server configuration they
> > do not control. To facilite this, provide an example of how it may be
> > done.
> >
> > cc: Tay Ray Chuan <rctay89@gmail.com>
> > cc: Shawn O. Pearce <spearce@spearce.org>
> > Editing-by: Tay Ray Chuan <rctay89@gmail.com>
> > Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
>
> I still see Cc: here; are people named above (and others commented on
> earlier versions) happy with this round?
I don't get why Options +SymLinksIfOwnerMatch is needed here.
If we are linking to the root installed git-http-backend Apache
will actually reject the link, because the link owner is likely to
be $USER while the target is owned by root.
So I really can't ACK this, the instructions don't jive with my
understanding of the Apache configuration.
--
Shawn.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3] Smart-http documentation: add example of how to execute from userdir
2010-01-04 14:06 ` Shawn O. Pearce
@ 2010-01-05 7:59 ` Tarmigan
2010-01-05 7:59 ` [PATCH v4] " Tarmigan Casebolt
0 siblings, 1 reply; 14+ messages in thread
From: Tarmigan @ 2010-01-05 7:59 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Junio C Hamano, Tay Ray Chuan, git
On Mon, Jan 4, 2010 at 6:06 AM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
>> I still see Cc: here; are people named above (and others commented on
>> earlier versions) happy with this round?
>
> I don't get why Options +SymLinksIfOwnerMatch is needed here.
>
> If we are linking to the root installed git-http-backend Apache
> will actually reject the link, because the link owner is likely to
> be $USER while the target is owned by root.
>
> So I really can't ACK this, the instructions don't jive with my
> understanding of the Apache configuration.
Fair enough.
There seem to be three reasonable ways to run from a userdir
(depending on what the global configuration allows):
- symlink to global git installation (if FollowSymLinks)
- symlink to user's git installation (if not FollowSymLink and only
SymLinkIfOwnerMatch)
- copy of git-http-backend binary (if no symlinks are followed)
The Options +SymLinksIfOwnerMatch is left over from when there was a
more detailed description of the second scenario and should probably
be removed now. The user may not have a choice about which of those
three can be used because it depends on the global server
configuration (which presumably the user does not control) so it's
difficult to provide instructions that will work for everyone. The
last option is likely to be the most portable, but also does not get
updated when the primary http-backend binary is updated.
Enumerating the details of setting up all of these configurations in
the man page seems excessive, but it would also be nice to have enough
information to still make it easy.
We could do one or more of the following:
- Remove the Options +SymLinksIfOwnerMatch as it is too specific to an
unknown configuration and let users figure out how to get symlinks to
work for their particular configuration
- Add a note to remind the user about SymLinksIfOwnerMatch or FollowSymLinks
- Emphasize copying git-http-backend binary into the cgi-bin directory
as that is likely the most portable across configurations
- Expand all three scenarios in detail
I'm inclined to do the first two with the following patch (cut-n-paste
warning) squashed in. I'll send the complete patch as a follow up.
Thanks,
Tarmigan
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend
index 0485033..7af1288 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -160,13 +160,14 @@ From UserDir on Apache 2.x::
+
----------------------------------------------------------------
SetHandler cgi-script
-Options +SymLinksIfOwnerMatch
SetEnv GIT_PROJECT_ROOT /home/$username/devel
----------------------------------------------------------------
+
Also add any needed authentication to the .htaccess file as discussed
in earlier examples.
+
+Depending on the global configuration of the web server, the
+"FollowSymLinks" or "SymLinksIfOwnerMatch" options might be needed.
If the web server does not follow any symbolic links, the
'git-http-backend' executable may be copied into the cgi-bin directory
and renamed to 'git' to acheive the same effect, but it will also need
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4] Smart-http documentation: add example of how to execute from userdir
2010-01-05 7:59 ` Tarmigan
@ 2010-01-05 7:59 ` Tarmigan Casebolt
2010-01-05 8:23 ` Junio C Hamano
0 siblings, 1 reply; 14+ messages in thread
From: Tarmigan Casebolt @ 2010-01-05 7:59 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Tarmigan Casebolt, Tay Ray Chuan, Shawn O. Pearce
Smart-http may be an attactive and easy way for people to setup git
hosting on shared servers whose primary web server configuration they
do not control. To facilite this, provide an example of how it may be
done.
cc: Tay Ray Chuan <rctay89@gmail.com>
cc: Shawn O. Pearce <spearce@spearce.org>
Edited-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
Documentation/git-http-backend.txt | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 67aec06..7af1288 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -60,8 +60,8 @@ automatically by the web server.
EXAMPLES
--------
-All of the following examples map 'http://$hostname/git/foo/bar.git'
-to '/var/www/git/foo/bar.git'.
+Unless otherwise noted, the following examples map
+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.
Apache 2.x::
Ensure mod_cgi, mod_alias, and mod_env are enabled, set
@@ -144,6 +144,35 @@ ScriptAliasMatch \
ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
----------------------------------------------------------------
+In the following example, the repository at
+'/home/$username/devel/foo/bar.git' will be accessible at
+'http://$hostname/~$username/cgi-bin/git/foo/bar.git'.
+
+From UserDir on Apache 2.x::
+ One way to configure 'git-http-backend' to execute and serve
+ from a user directory (for example, on a shared hosting
+ provider), is to have a symbolic link named 'git' that points
+ from the cgi directory to the 'git-http-backend' executable in
+ libexec. The advantage is that this symbolic link always
+ points to the latest installed version; one does not have to
+ make any changes to the symbolic link when the installed
+ 'git-http-backend' is updated.
++
+----------------------------------------------------------------
+SetHandler cgi-script
+SetEnv GIT_PROJECT_ROOT /home/$username/devel
+----------------------------------------------------------------
++
+Also add any needed authentication to the .htaccess file as discussed
+in earlier examples.
++
+Depending on the global configuration of the web server, the
+"FollowSymLinks" or "SymLinksIfOwnerMatch" options might be needed.
+If the web server does not follow any symbolic links, the
+'git-http-backend' executable may be copied into the cgi-bin directory
+and renamed to 'git' to acheive the same effect, but it will also need
+to be manually updated whenever a new version of 'git-http-backend' is
+installed.
ENVIRONMENT
-----------
--
1.6.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v4] Smart-http documentation: add example of how to execute from userdir
2010-01-05 7:59 ` [PATCH v4] " Tarmigan Casebolt
@ 2010-01-05 8:23 ` Junio C Hamano
0 siblings, 0 replies; 14+ messages in thread
From: Junio C Hamano @ 2010-01-05 8:23 UTC (permalink / raw)
To: Tarmigan Casebolt; +Cc: git, Tay Ray Chuan, Shawn O. Pearce
Tarmigan Casebolt <tarmigan+git@gmail.com> writes:
> +Depending on the global configuration of the web server, the
> +"FollowSymLinks" or "SymLinksIfOwnerMatch" options might be needed.
> +If the web server does not follow any symbolic links, the
> +'git-http-backend' executable may be copied into the cgi-bin directory
> +and renamed to 'git' to acheive the same effect, but it will also need
> +to be manually updated whenever a new version of 'git-http-backend' is
> +installed.
Hmph, has Apache heard of hardlinks? If not, wouldn't this be much
simpler?
cat >git <<\EOF
#!/bin/sh
exec /path/to/libexec/git-core/git-http-backend "$@"
EOF
chmod +x git
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2010-01-05 8:23 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-26 17:07 [PATCH] Smart-http documentation: add example of how to execute from userdir Tarmigan Casebolt
2009-12-27 3:19 ` Tay Ray Chuan
2009-12-28 4:18 ` Tarmigan
2009-12-28 4:46 ` [PATCH v2] " Tarmigan Casebolt
2009-12-31 2:18 ` Tay Ray Chuan
2010-01-02 21:18 ` [PATCH v3] " Tarmigan Casebolt
2010-01-03 2:11 ` Tay Ray Chuan
2010-01-03 8:34 ` Junio C Hamano
2010-01-04 14:06 ` Shawn O. Pearce
2010-01-05 7:59 ` Tarmigan
2010-01-05 7:59 ` [PATCH v4] " Tarmigan Casebolt
2010-01-05 8:23 ` Junio C Hamano
2009-12-27 21:15 ` [PATCH] " Shawn O. Pearce
2009-12-28 4:06 ` Tarmigan
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 NNTP newsgroup(s).