Re: [PATCH] git-daemon virtual hosting implementation.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Pierre Habouzit
Date: Wednesday, August 23, 2006 - 1:56 pm

Le mer 23 ao=FBt 2006 22:11, Junio C Hamano a =E9crit :

fair enough, so I suppose there is many choices:
 * replace --use-vhosts with --use-vhosts=3D${default hostname}
   but I do not like it very much
 * use `hostname -f` as the default hostname (not very nice either)
 * use the magic _default_ (=E0 la apache) hostname ?

But just note that if a git repository is accessible on an host that is=20
not the default, and only on that one, an older client won't be able to=20
clone the repository anyway, because he will be redirected to the=20
default virtual host. Meaning, that someone that uses virtual hosts=20
will break older clients anyway.

what would be nicer would be a way to gracefully reject older clients in=20
that case with an understandable error message, so that the user knows=20
why it does not work. I don't know PROTO_GIT very well yet,so I don't=20
know if older client support such communications yet or not.


Another option would be not to support virtual hosts, but instead=20
superseed the --base-path and --user-path with some --base-path-fmt=20
and --user-path-fmt where the user can specify how to build the path=20
with simple sprintf-like formats. One could e.g. support:
 * %% obviously ;
 * %h that will be replaced with the hostname
 * %u (only for --user-path-fmt)
 * %p (asked path)
 * ...

I think that's more clever, and allow more flexible use of the virtual=20
hosting code. It e.g. allow to use the virtual host scheme for the=20
`base-path` repos and to disallow it for the users.

=2D-*-path and --*-path-fmt are obviously mutually exclusive.

What do you think ?

=2D-=20
=B7O=B7  Pierre Habouzit
=B7=B7O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] git-daemon virtual hosting implementation., Pierre Habouzit, (Wed Aug 23, 11:52 am)
Re: [PATCH] git-daemon virtual hosting implementation., Junio C Hamano, (Wed Aug 23, 1:11 pm)
Re: [PATCH] git-daemon virtual hosting implementation., Pierre Habouzit, (Wed Aug 23, 1:56 pm)
Re: [PATCH] git-daemon: more powerful base-path/user-path ..., Pierre Habouzit, (Thu Aug 24, 12:50 am)
Re: [PATCH] git-daemon virtual hosting implementation., Jon Loeliger, (Thu Aug 24, 1:15 pm)
Re: [PATCH] git-daemon virtual hosting implementation., Jon Loeliger, (Thu Aug 24, 1:34 pm)
Re: [PATCH] git-daemon virtual hosting implementation., Junio C Hamano, (Thu Aug 24, 1:35 pm)
Re: [PATCH] git-daemon: more powerful base-path/user-path ..., Randal L. Schwartz, (Sun Aug 27, 9:06 am)