Re: [gitorious] Virtual hosts ponderings ...

2013-03-21 Thread Marius Mårnes Mathiesen

Johannes Ernst writes:

> I happen to be reading "man git-daemon", where it says this:
>
>--interpolated-path=
>To support virtual hosting, an interpolated path template can be 
> used to dynamically construct alternate paths. The template
>supports %H for the target hostname as supplied by the client but 
> converted to all lowercase, %CH for the canonical
>hostname, %IP for the server’s IP address, %P for the port number, 
> and %D for the absolute path of the named repository.
>After interpolation, the path is validated against the directory 
> whitelist.
>
> I have not tried this, but this sounds like virtual hosts should
> actually be possible? "supplied by the client" sounds like the Host:
> header in HTTP?

Interesting. The git proxy we use (in config/git-proxymachine.rb) for
translating git:// requests to the hashed paths used on some
installations has some examples on how the git protocol works:

proxy do |data|
  if data =~ /^(git\-upload\-pack|git\ upload\-pack)\s(.+)\x00host=(.+)\x00/
service, path, host = $1, $2, $3
# ...

so it looks like it would work a lot like the HTTP Host: header.

Cheers,
- Marius

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-20 Thread Johannes Ernst
I happen to be reading "man git-daemon", where it says this:

   --interpolated-path=
   To support virtual hosting, an interpolated path template can be 
used to dynamically construct alternate paths. The template
   supports %H for the target hostname as supplied by the client but 
converted to all lowercase, %CH for the canonical
   hostname, %IP for the server’s IP address, %P for the port number, 
and %D for the absolute path of the named repository.
   After interpolation, the path is validated against the directory 
whitelist.

I have not tried this, but this sounds like virtual hosts should actually be 
possible? "supplied by the client" sounds like the Host: header in HTTP? 


On Mar 20, 2013, at 2:41, Marius Mårnes Mathiesen  
wrote:

> 
> Johannes Ernst writes:
>> But he might want to publish "his" code at "his" domain, with his own
>> color scheme, branding etc. just like he might have a blog at that own
>> domain, etc. This is not unlikely as many employers, for example, now
>> Google their prospective hires and try to look at code they wrote.
> 
> One thing to consider here is to use Christian's amazingly awesome dolt
> gem to serve the repositories. Dolt is the code browser that will be
> shipping with Gitorious 3, but it's a standalone tool and doesn't
> include things like merge requests, push/pull etc.
> 
> The readme for dolt (unfortunately not served by dolt, and thus not
> properly syntax-highlighted) is at 
> https://gitorious.org/gitorious/dolt/blobs/master/Readme.md
> 
> Cheers,
> - Marius
> 
> -- 
> -- 
> To post to this group, send email to gitorious@googlegroups.com
> To unsubscribe from this group, send email to
> gitorious+unsubscr...@googlegroups.com
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Gitorious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to gitorious+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-20 Thread Marius Mårnes Mathiesen

Johannes Ernst writes:
> But he might want to publish "his" code at "his" domain, with his own
> color scheme, branding etc. just like he might have a blog at that own
> domain, etc. This is not unlikely as many employers, for example, now
> Google their prospective hires and try to look at code they wrote.

One thing to consider here is to use Christian's amazingly awesome dolt
gem to serve the repositories. Dolt is the code browser that will be
shipping with Gitorious 3, but it's a standalone tool and doesn't
include things like merge requests, push/pull etc.

The readme for dolt (unfortunately not served by dolt, and thus not
properly syntax-highlighted) is at 
https://gitorious.org/gitorious/dolt/blobs/master/Readme.md

Cheers,
- Marius

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-19 Thread Ken Dreyer
On Tue, Mar 19, 2013 at 1:57 AM, Christian Johansen  wrote:
> Being able to run multiple Gitorious instances on a box would be a
> nice-to-have, but in my opinion not critical, and probably not well
> suited for production use unless each instance has relatively few
> users/projects or sees sparse usage. Given this context, I don't think
> your solution is such a bad one.
>
> If anyone has ideas to make Gitorious easier to run side-by-side that
> doesn't conflict with current setups, I'm all ears.

Yeah, I should clarify that I'm just trying to split my "staging"
environment from my "production" environment here, and I don't
consider this a sustainable enterprise solution for the long term :)

- Ken

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-19 Thread Christian Johansen
> Here's a use case for multiple instances on same server:
>
> an individual developer would like to publish his code to the world.
> He could create an account on github and put it there, and indeed
> that's what many people do almost by default.
>
> But he might want to publish "his" code at "his" domain, with his own
> color scheme, branding etc. just like he might have a blog at that own
> domain, etc. This is not unlikely as many employers, for example, now
> Google their prospective hires and try to look at code they wrote.
>
> Chances are blogs etc. of individual are run on shared servers, and it
> would be nice if Gitorious could function in that environment.
>
> Scalability is not an issue because it's just the code of some single
> individual.

To be clear: I don't disagree that there are good use cases. This is
indeed one of them. My point was that multiple setups on the same server
is not something I'd recommend for companies/larger organizations.

>
> Question: so if gitorious was set up to only speak http (not the git
> protocol), shouldn't that work?

Indeed. And that would be a very neat setup, easier to install etc.
We've considered it for some time. The only part missing is push over
HTTP, which I don't think is a lot of code to pull off. Maybe Marius
wants to chip in, as he's done some exploratory work on that.

Christian

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-19 Thread Johannes Ernst
Here's a use case for multiple instances on same server:

an individual developer would like to publish his code to the world. He could 
create an account on github and put it there, and indeed that's what many 
people do almost by default.

But he might want to publish "his" code at "his" domain, with his own color 
scheme, branding etc. just like he might have a blog at that own domain, etc. 
This is not unlikely as many employers, for example, now Google their 
prospective hires and try to look at code they wrote.

Chances are blogs etc. of individual are run on shared servers, and it would be 
nice if Gitorious could function in that environment.

Scalability is not an issue because it's just the code of some single 
individual.

Question: so if gitorious was set up to only speak http (not the git protocol), 
shouldn't that work?



On Mar 19, 2013, at 0:57, Christian Johansen  wrote:

> Ken Dreyer writes:
> 
>> On Mon, Mar 18, 2013 at 3:13 PM, Johannes Ernst  wrote:
>>> Presumably you could run multiple sshd's at either multiple IP addresses
>>> assigned to the same machine, or at different ports. That doesn't need
>>> chroots, but it's still very messy ...
>> 
>> Well, the chroots would be primarily for splitting out the "git" user,
>> so that I can have a unique "git" UID inside each chroot, with its own
>> home dir, SSH keys, etc. I don't know of any other way to do that,
>> short of full OS virtualization.
> 
> Being able to run multiple Gitorious instances on a box would be a
> nice-to-have, but in my opinion not critical, and probably not well
> suited for production use unless each instance has relatively few
> users/projects or sees sparse usage. Given this context, I don't think
> your solution is such a bad one.
> 
> If anyone has ideas to make Gitorious easier to run side-by-side that
> doesn't conflict with current setups, I'm all ears.
> 
> Christian
> 
> -- 
> -- 
> To post to this group, send email to gitorious@googlegroups.com
> To unsubscribe from this group, send email to
> gitorious+unsubscr...@googlegroups.com
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Gitorious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to gitorious+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-19 Thread Christian Johansen
Ken Dreyer writes:

> On Mon, Mar 18, 2013 at 3:13 PM, Johannes Ernst  wrote:
>> Presumably you could run multiple sshd's at either multiple IP addresses
>> assigned to the same machine, or at different ports. That doesn't need
>> chroots, but it's still very messy ...
>
> Well, the chroots would be primarily for splitting out the "git" user,
> so that I can have a unique "git" UID inside each chroot, with its own
> home dir, SSH keys, etc. I don't know of any other way to do that,
> short of full OS virtualization.

Being able to run multiple Gitorious instances on a box would be a
nice-to-have, but in my opinion not critical, and probably not well
suited for production use unless each instance has relatively few
users/projects or sees sparse usage. Given this context, I don't think
your solution is such a bad one.

If anyone has ideas to make Gitorious easier to run side-by-side that
doesn't conflict with current setups, I'm all ears.

Christian

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-18 Thread Ken Dreyer
On Mon, Mar 18, 2013 at 3:13 PM, Johannes Ernst  wrote:
> Presumably you could run multiple sshd's at either multiple IP addresses
> assigned to the same machine, or at different ports. That doesn't need
> chroots, but it's still very messy ...

Well, the chroots would be primarily for splitting out the "git" user,
so that I can have a unique "git" UID inside each chroot, with its own
home dir, SSH keys, etc. I don't know of any other way to do that,
short of full OS virtualization.

- Ken



> On Mar 18, 2013, at 12:24, Ken Dreyer  wrote:
>
>> On Mon, Mar 18, 2013 at 12:46 PM, Johannes Ernst  wrote:
>>> It may not be so easy to run more than one installation of Gitorious on the 
>>> same server.
>>
>> I've recently been looking into this exact problem, after I found out
>> to my disappointment that my server hardware doesn't support
>> virtualization.
>>
>> My thought was that it should be possible to run Gitorious and sshd
>> inside chroots on separate IPs. It's not a pretty solution any way you
>> slice it.
>>
>> It's also interesting to me from a packaging perspective, because the
>> dependency on a "git" user means that Gitorious will also conflict
>> with any other software that needs a "git" user, like Gitolite or
>> GitLab.
>>
>> - Ken

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-18 Thread Johannes Ernst
Presumably you could run multiple sshd's at either multiple IP addresses 
assigned to the same machine, or at different ports. That doesn't need chroots, 
but it's still very messy ...

On Mar 18, 2013, at 12:24, Ken Dreyer  wrote:

> On Mon, Mar 18, 2013 at 12:46 PM, Johannes Ernst  wrote:
>> It may not be so easy to run more than one installation of Gitorious on the 
>> same server.
> 
> I've recently been looking into this exact problem, after I found out
> to my disappointment that my server hardware doesn't support
> virtualization.
> 
> My thought was that it should be possible to run Gitorious and sshd
> inside chroots on separate IPs. It's not a pretty solution any way you
> slice it.
> 
> It's also interesting to me from a packaging perspective, because the
> dependency on a "git" user means that Gitorious will also conflict
> with any other software that needs a "git" user, like Gitolite or
> GitLab.
> 
> - Ken
> 
> -- 
> -- 
> To post to this group, send email to gitorious@googlegroups.com
> To unsubscribe from this group, send email to
> gitorious+unsubscr...@googlegroups.com
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Gitorious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to gitorious+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gitorious] Virtual hosts ponderings ...

2013-03-18 Thread Ken Dreyer
On Mon, Mar 18, 2013 at 12:46 PM, Johannes Ernst  wrote:
> It may not be so easy to run more than one installation of Gitorious on the 
> same server.

I've recently been looking into this exact problem, after I found out
to my disappointment that my server hardware doesn't support
virtualization.

My thought was that it should be possible to run Gitorious and sshd
inside chroots on separate IPs. It's not a pretty solution any way you
slice it.

It's also interesting to me from a packaging perspective, because the
dependency on a "git" user means that Gitorious will also conflict
with any other software that needs a "git" user, like Gitolite or
GitLab.

- Ken

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.