[SOLVED] Re: Local git server can't serve https until repos owned by http, can't serve ssh unless repos owned by user after 2.45.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"David C. Rankin" <drankinatty@xxxxxxxxx> wrote:

>    I'd be happy if the docs were just updated with a concise explanation of 
> how to support both ssh and https to the same repo running under Apache -- if 
> that is doable.

Hi. I've done some investigating, and have discovered what the problem is (with
my setup, at least)

It only tries to access /etc/gitconfig (or /usr/local/etc/gitconfig) - putting
the rules in there allow it to work, but with the caveat mentioned by an
earlier poster - you need to add a path of "." as well as the required
directories. (or enable everything with a path of "*")

Now, I don't want to do that globally: "*" it's too risky, and I haven't
delved deep enough to determine if "." is a security risk too.

However, there is a better solution:

The problem is, the environment variable HOME isn't defined when the http
server calls cgi-http-backend.

I actually have an intermediate script that is called by httpd, that itself
execs git-http-backend, so all I needed to do was add the line

export HOME=/.../git-web-user/

before the exec, and it now works as expected, picking up .gitconfig from the
.../git-web-user/ directory.

If you call git-http-backend directly, you may be able to set the environment
variable in the httpd config. If not, just create an intermediate script,
something like

#!/bin/sh
export HOME=...
exec <path-to-git-http-backend>

, and change http to call that.

Now, I don't think that if not set, git should determine HOME itself (from
the password file etc.), as someone may want that disabled for other reasons,
HOWEVER, this should really be documented.

So, in my mind, the fix is to fix the "." directory requirement, and document
the potential need to set HOME.

Ler me know if this works for you!

Cheers, Jamie





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux