Commit Graph

309 Commits

Author SHA1 Message Date
Matt Harbison
2d103b7f95 optionally print tracebacks when the Mercurial hook swallows an exception
If `ui.traceback=True` is set on the server, this prints the stacktrace for the
exception on the client side.  Otherwise, nothing happens.  I tried allowing the
exception to propagate back to Mercurial, but then the client sees this message
with 4.4.2 and 4.6.1:

    abort: remote error:
    Mercurial/Python process ends with return code 1

Something odd changed when upgrading from CentOS 7.4 to 7.5 around forwarding
requests from the loopback address that I don't fully understand.  First, we
were getting a ValueError from inside `opener.open()` saying that 'localhost'
didn't match the host listed in the SSL certificate.  That wasn't visible until
adding this.

Then what happened is a connection refused out of the same function, so the
traceback is added to the other handler too.  Running the equivalent command on
the command line from the 'vcs' host stopped working in 7.5:

  $ curl https://vcs.domain.com/hook/hg/?ping=true
  curl: (7) Failed connect to vcs.domain.com:443; Connection refused

But it works when run on another machine targeting that same 'vcs' host.  Adding
another firewall rule allows everything to work from the 'vcs' host again:

  $ iptables -t nat -I OUTPUT -p tcp -o lo --dport 443 -j REDIRECT --to-ports 8443
2018-06-22 16:33:52 -04:00
Matt Harbison
a051eb159c #989 load global configuration in hgweb on Mercurial 4.1 and later 2018-06-22 16:06:35 -04:00
Sebastian Sdorra
e826b833cc switch from jersey 1.x to resteasy 2017-06-27 20:16:05 +02:00
Gábor Stefanik
e230c0f4cd make {extras} work on old versions of Hg 2018-04-06 20:30:15 +00:00
Sebastian Sdorra
7ed4dbcf00 fix hgweb execution for mercurial versions prior 4.1 2018-04-06 14:01:00 +02:00
Sebastian Sdorra
3d401b93ea #970 added help text for enable httppostargs 2018-04-03 11:56:51 +02:00
Sebastian Sdorra
acebd0f25e #970 wrap requests only if http postargs is enabled 2018-04-03 11:14:05 +02:00
Sebastian Sdorra
8047d36028 #970 use iso-8859-1 for http post args instead of us-ascii 2018-04-03 11:00:16 +02:00
Sebastian Sdorra
b43e406b76 #970 initial support of mercurials httppostargs protocol 2018-03-30 11:20:22 +02:00
Sebastian Sdorra
a34acd8ed4 #970 added option to enable the experimental httppostargs protocol of mercurial 2018-03-29 22:14:28 +02:00
Sebastian Sdorra
8aaa67cd6a #970 inspect mercurial commands in order to detect write requests
The HgPermissionFilter will now inspect the used mercurial command, of all requests which are using a read method like GET, HEAD, OPTIONS or TRACE and tread every one as write request, expect:
- no command was specified with the request (this is required for the hgweb ui)
- the command in the query string was found in the list of read commands
- if query string contains the batch command, then all commands specified in X-HgArg headers must be in the list of read commands
This change is required, in order to fix CVE-2018-1000132 for SCM-Manager.
2018-03-29 20:26:56 +02:00
Sebastian Sdorra
e7dd54c133 #970 added ngrep dumps for mercurial wire protocol and more realistic tests for isWriteRequest 2018-03-29 10:21:34 +02:00
Sebastian Sdorra
7d94b03a04 #959 added option to disable ssl validation for scm mercurial hook 2018-02-23 08:44:22 +01:00
Gábor Stefanik
77eea15417 oops... don't interpret "close=junk" as "close=1" 2017-09-18 12:34:50 +00:00
Gábor Stefanik
14ee6ef0d6 prevent binary data in {extras} from interfering with UTF-8 decoding 2017-09-18 12:30:20 +00:00
Sebastian Sdorra
b51fba2282 fix repository browsing with mercurial 4.x 2017-06-06 08:14:04 +02:00
Sebastian Sdorra
7e6f4e1a7f fix some warning and removed some unused imports 2017-01-14 12:05:53 +01:00
Sebastian Sdorra
c149b180a1 use newer repository client api 2017-01-14 11:48:42 +01:00
Sebastian Sdorra
c6f66c1a32 merge with branch issue-859 2016-10-03 10:53:26 +02:00
Sebastian Sdorra
264a1af634 treat HEAD, OPTIONS and TRACE as mercurial read requests not only GET, see issue #859 2016-09-30 22:23:14 +02:00
Sebastian Sdorra
c988b01ab7 remove test hook 2016-09-29 09:23:13 +02:00
Sebastian Sdorra
617ed81b53 implemented HookTagProvider api for mercurial 2016-09-29 09:11:53 +02:00
Sebastian Sdorra
1cf399ab2d implement mercurial repository test client 2016-07-26 00:16:14 +02:00
Sebastian Sdorra
b5383f4073 fix loading of repository handler informations on some systems, see issue #841 2016-06-24 17:58:02 +02:00
Sebastian Sdorra
0f1ac3f952 expose latest changeset id of branch 2015-06-13 19:56:16 +02:00
Sebastian Sdorra
bdb202dd8c track time for processing mercurial request on debug logging 2015-06-11 22:10:32 +02:00
Sebastian Sdorra
656085c698 use ahc for internal http operations 2015-05-17 14:04:58 +02:00
Sebastian Sdorra
e5184ac6a0 merge with branch issue-627 2015-02-10 20:50:06 +01:00
Sebastian Sdorra
436b27e8fc introducing HookBranchProvider to get informations about changed branches during a hook, see issue #668 2015-01-24 11:08:16 +01:00
Sebastian Sdorra
d707f0ee47 servlet fields should be final 2015-01-23 21:44:04 +01:00
Sebastian Sdorra
31bb6dfe6d return a property for closed branches 2015-01-19 17:54:57 +01:00
Sebastian Sdorra
75c244fcdb improve bundle/unbundle api, by using ByteSource and ByteSink 2014-11-02 10:44:17 +01:00
Sebastian Sdorra
a6ecd7ba00 implement push/pull for remote urls 2014-11-01 12:32:21 +01:00
Sebastian Sdorra
8e608d2439 created small user-agent detection framework to choose the right encoding for basic authentication 2014-10-17 15:43:28 +02:00
Sebastian Sdorra
72978a05af remove unused imports 2014-05-08 21:27:15 +02:00
Sebastian Sdorra
9f654293a0 execute HgHealthCheck only for mercurial repositories 2014-05-08 21:11:51 +02:00
Sebastian Sdorra
ac5b2ddd0e implement simple health check for mercurial repositories 2014-05-08 21:09:45 +02:00
Sebastian Sdorra
1388052ace return authentication header, if the login attempt limit is disabled 2014-04-20 13:11:41 +02:00
Sebastian Sdorra
5c44df3e4c use userAgentStartsWith method for user agent check 2014-03-16 11:49:44 +01:00
Sebastian Sdorra
9db7284f27 use client messages 2014-03-16 11:28:09 +01:00
Sebastian Sdorra
b131d4b804 improve error handling for failed authentication and not enough privileges 2014-03-15 16:12:14 +01:00
Sebastian Sdorra
2cb3e668db fix mercurial out of scope exception on startup 2014-03-09 14:48:43 +01:00
Sebastian Sdorra
bc61218bf8 fix bug with passwords which contains a colon 2014-01-17 15:56:18 +01:00
Sebastian Sdorra
05052d9584 merge with branch issue-499 2013-12-13 08:06:54 +01:00
Sebastian Sdorra
b8480ac58d fix python path for scm mercurial packages 2013-12-10 08:22:18 +01:00
Sebastian Sdorra
e135fdc715 remove unused imports 2013-12-06 08:49:28 +01:00
Sebastian Sdorra
5637c1a8a2 allow multi line mercurial messages 2013-10-01 21:40:27 +02:00
Sebastian Sdorra
1b09dc4d56 merge with branch issue-451 2013-09-30 07:51:13 +02:00
Sebastian Sdorra
2b91053909 fix out of scope exception on access hgcontext 2013-09-27 17:59:53 +02:00
Sebastian Sdorra
86c6ecd9e8 added support for git diff output format to the mercurial repository provider 2013-08-23 13:24:24 +02:00