public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: "Frank Ch. Eigler" <fche@elastic.org>
Cc: "Frank Ch. Eigler" <fche@redhat.com>, overseers@sourceware.org
Subject: Re: git through http (or https)
Date: Sun, 08 Jan 2017 23:31:00 -0000	[thread overview]
Message-ID: <20170108233119.GA3341@stream> (raw)
In-Reply-To: <20170105202501.GB3962@elastic.org>

On Thu, Jan 05, 2017 at 03:25:01PM -0500, Frank Ch. Eigler wrote:
> > [...]  Yes, that is what the rewrite rules would fix.  If you enable
> > the rules in htdocs/git/.htaccess [...]
> 
> I put you on the fileacl for /sourceware/www/sourceware/htdocs/git/.htaccess
> to play (carefully) with.  It may not be quite so easy due to our symlinks
> and various group permissions.

You are right. It isn't simple because of the symlinks inside the directory
which seem to get resolved/matched/rewritten before/after any explicit
rewrite rule. In the end the best I could come up with was the following.
It makes sure the "advertised" http[s]://sourceware.org/git/foobar.git
links resolve. But they don't result in "pretty" URLs. I do think it is
better than the current Forbidden results though.

# This seems to be the best we can do given directory/.htaccess rewrite rules
# do get rewritten/matched themselves before/after the rewrite rules even if
# we use the [L] flag. So we match on the ending '/' that comes from following
# the symlink to the underlying directory. Then we do a browser [R]edirect so
# that the results doesn't get rewritten/matched again. This at least rewrite
# the user visible http://sourceware.org/git/foobar.git URLs to something that
# isn't Forbidden (the underlying git directory).
RewriteEngine on
RewriteBase /git/
RewriteRule ^([a-zA-Z/_-]+\.git)/$ ?p=$1 [R,L]

I believe the above is safe and keeps everything working as intended.
But please feel free to revert/remove the rewrite rule if it doesn't
or if you are afraid it might conflict with something.

Thanks,

Mark

  reply	other threads:[~2017-01-08 23:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 21:22 Mark Wielaard
2017-01-03 23:41 ` Frank Ch. Eigler
2017-01-04 12:43   ` Mark Wielaard
2017-01-05 16:03     ` Frank Ch. Eigler
2017-01-05 17:26       ` Mark Wielaard
2017-01-05 20:25         ` Frank Ch. Eigler
2017-01-08 23:31           ` Mark Wielaard [this message]
2017-01-08 23:33             ` Frank Ch. Eigler

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=20170108233119.GA3341@stream \
    --to=mark@klomp.org \
    --cc=fche@elastic.org \
    --cc=fche@redhat.com \
    --cc=overseers@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).