git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Pierre Habouzit <madcoder@debian.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-daemon virtual hosting implementation.
Date: Wed, 23 Aug 2006 13:11:01 -0700	[thread overview]
Message-ID: <7vmz9vgqlm.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <11563591572194-git-send-email-madcoder@debian.org> (Pierre Habouzit's message of "Wed, 23 Aug 2006 20:52:37 +0200")

Pierre Habouzit <madcoder@debian.org> writes:

> just add the hostname in the path when using --base-path and --user-path.
> this should be enough for most needs.
>
> Signed-off-by: Pierre Habouzit <madcoder@debian.org>
> ---
>  Here is a proposal for daemon side virtualhosting support.

> @@ -158,6 +160,11 @@ static char *path_ok(char *dir)
>  		return NULL;
>  	}
>  
> +	if (use_vhosts && !vhost) {
> +		logerror("using virtual hosting, and not host= was specified !");
> +		return NULL;
> +	}
> +

This part is objectionable -- older clients do not give "host=".
I think the plan, when virtual hosting was proposed and we added
this to the client side first, was to treat older clients as if
they specified the "primary" host.  So we would need some
mechanism to say where the repositories of the "primary" host
lives.

> +			if (use_vhosts) {
> +				loginfo("host <%s>, "
> +					"userpath <%s>, request <%s>, "
> +					"namlen %d, restlen %d, slash <%s>",
> +					vhost,
> +					user_path, dir,
> +					namlen, restlen, slash);
> +				snprintf(rpath, PATH_MAX, "%.*s/%s/%s%.*s",
> +					 namlen, dir, user_path, vhost,
> +					 restlen, slash);

I am not sure if the interaction between user-path and vhost
should go like this, but I do not think of a good alternative to
suggest right now.  Your code allows ~user/host1 and ~user/host2
to host different set of repositories, but I suspect if somebody
is setting up a virtual hosting of two hosts, he might want to
have two distinct set of users (iow to pretend that ~user exist
only on host1 but not on host2).  I dunno.

  reply	other threads:[~2006-08-23 20:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-23 18:52 [PATCH] git-daemon virtual hosting implementation Pierre Habouzit
2006-08-23 20:11 ` Junio C Hamano [this message]
2006-08-23 20:56   ` Pierre Habouzit
2006-08-24 20:15     ` Jon Loeliger
2006-08-24 20:35       ` Junio C Hamano
2006-08-24 20:34         ` Jon Loeliger
2006-08-23 23:32   ` [PATCH] git-daemon: more powerful base-path/user-path settings, using formats Pierre Habouzit
2006-08-24  0:17     ` Junio C Hamano
2006-08-24  7:50       ` Pierre Habouzit
2006-08-27  6:12     ` Junio C Hamano
2006-08-27 10:28       ` Pierre Habouzit
2006-08-27 10:52         ` Junio C Hamano
2006-08-27 11:40           ` Pierre Habouzit
2006-08-27 15:30             ` Jakub Narebski
2006-08-27 16:26               ` Pierre Habouzit
2006-08-27 16:06           ` Randal L. Schwartz

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=7vmz9vgqlm.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=madcoder@debian.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.
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).