<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Oops, forgot the mailinglist, apologies.<br>
    Jakob<br>
    <br>
    -------- Original Message --------
    <table class="moz-email-headers-table" border="0" cellpadding="0"
      cellspacing="0">
      <tbody>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject: </th>
          <td>Re: Disable hgweb browsing</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
          <td>Tue, 31 May 2011 09:04:53 +0200</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
          <td>J.S. van Bethlehem <a class="moz-txt-link-rfc2396E" href="mailto:j.s.van.bethlehem@astro.rug.nl">&lt;j.s.van.bethlehem@astro.rug.nl&gt;</a></td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
          <td>Martin Geisler <a class="moz-txt-link-rfc2396E" href="mailto:mg@lazybytes.net">&lt;mg@lazybytes.net&gt;</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    <br>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    On 05/30/2011 09:44 AM, Martin Geisler wrote:
    <blockquote cite="mid:87hb8c1vl0.fsf@hbox.dyndns.org" type="cite">
      <pre wrap="">moroswitie <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:moroswitie@gmail.com">&lt;moroswitie@gmail.com&gt;</a> writes:

</pre>
      <blockquote type="cite">
        <pre wrap="">I'm currently starting to work on a custom mercurial project web
application and need to disable the build in repository browser.

I wasn't able to find such an option, and a quick work around would be
to redirect all repository browser requests. The problemd is I
couldn't find the format that the hgweb.cgi scripts accepts to show
the repository browser.
</pre>
      </blockquote>
      <pre wrap="">Try running 'hg serve' and access <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://localhost:8000/">http://localhost:8000/</a> in your
browser. Now access it with hg, the command line client.

</pre>
      <blockquote type="cite">
        <pre wrap="">Could anybody point me in the right direction so I know how to rewrite
the request so that I can serve up a nice error message saying that
repository browsing is disabled with the build in browser.

Disabling the browser should not disable pull or push. So I think I
also need to know the urls for the push and pull commands.
</pre>
      </blockquote>
      <pre wrap="">If people can pull, then they can just run 'hg serve' locally and do
what you are trying to disable... so why do you want to disable the
repository browser on your server?

All the commands done by the command line client access URLs of the form

  /?cmd=COMMAND

so you can direct other requests to your error page.

</pre>
      <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
</pre>
    </blockquote>
    <br>
    Wouldn't simply setting 'deny_read = *' in the [web]-section of the
    .hg/hgrc file of your repository do the trick?<br>
    (Look here <a moz-do-not-send="true" class="moz-txt-link-freetext"
      href="http://www.selenic.com/mercurial/hgrc.5.html">http://www.selenic.com/mercurial/hgrc.5.html</a>
    for the [web] section -&gt; deny_read option)<br>
    Jakob<br>
    <br>
  </body>
</html>