Disable hgweb browsing

Martin Geisler mg at lazybytes.net
Mon May 30 07:44:27 UTC 2011


moroswitie <moroswitie at gmail.com> writes:

> 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.

Try running 'hg serve' and access http://localhost:8000/ in your
browser. Now access it with hg, the command line client.

> 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.

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.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20110530/1bacd1fc/attachment.asc>


More information about the Mercurial mailing list