[JIRA] Commented: (CC-541) [PATCH] Make Cruisecontrol accessible via a Proxy
"Daniel Tihelka (JIRA)" <[email protected]> Wed, 16 Feb 2011 17:02:43 -0600 (CST)
| Newsgroups | gmane.comp.java.cruise-control.devel |
|---|---|
| Message-ID | <1781146965.1297897363566.JavaMail.root@chidmzhosting02.thoughtworks.com> |
[ http://jira.public.thoughtworks.org/browse/CC-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_19078 ]
Daniel Tihelka commented on CC-541:
-----------------------------------
Hallo,
I would like to ask for the state of this issue (still marked as opened).
We have just come up agains this issue - we were not able to set apache's mod_proxy to be able to correctly forward data from CC. The first page was OK (set to 'http://server/builds/' be proxy of localhost:8080), but problems occured when clicking on any link - the path was corrupted, as we expect 'http://server/builds/subpage', while we get 'http://server/subpage' instead, which is not valid of course ...
> [PATCH] Make Cruisecontrol accessible via a Proxy
> -------------------------------------------------
>
> Key: CC-541
> URL: http://jira.public.thoughtworks.org/browse/CC-541
> Project: CruiseControl
> Issue Type: Bug
> Components: Reporting Application
> Affects Versions: 2.6
> Reporter: Benjamin Francisoud
> Assigned To: Jeffrey Fredrick
> Priority: Critical
> Attachments: patch-03-nov-2006-CC-541-03.patch, patch-03-nov-2006-CC-541-03.zip, patch-25-oct-2006-CC-541-02.zip, patch-25-oct-2006-CC-541.patch, patch-25-oct-2006-CC-541.zip
>
>
> The CC-293 issue is quite a comments'mess so I prefer to open an other one just for the patch and link it to CC-293.
> -------------------------------------------
> Introduction
> -------------------------------------------
> So this patch has 3 different parts:
> * Replace canonical URL (http://host:port/context) with url link /context to adapt to any hostname (proxy or not proxy)
> * In cases (rss.jsp for example) where we really need full canonical url, use a new class that extract the proxy hostname
> from special headers
> * Make jmx available behind a proxy
> -------------------------------------------
> How I tested my patch:
> -------------------------------------------
> * Tested with both context / and /cruisecontrol
> * Tested with localhost:8080
> * Tested behind an apache mod_proxy using ssl but cruisecontrol jetty was no using ssl (Help to see tricky problems with
> request.getScheme())
> I ran ant (default target: release). Unit tests are ok, checkstyle too..
> -------------------------------------------
> Proxy configuration:
> -------------------------------------------
> {noformat}
> <Proxy *>
> Order deny,allow
> Allow from all
> </Proxy>
> # Warning the ProxyPath order is important
> # JMX proxy configuration
> ProxyPass /cruisecontrol/jmx http://localhost:8000
> ProxyPassReverse /cruisecontrol/jmx http://localhost:8000
> # Html pages configuration
> ProxyPass /cruisecontrol http://localhost:8080/cruisecontrol
> ProxyPassReverse /cruisecontrol http://localhost:8080/cruisecontrol
> {noformat}
> -------------------------------------------
> Details
> -------------------------------------------
> - First point "replace canonical urls":
> I really think this <base href> think is the worst invention of html ever (I already had problems with it in a previous
> project)
> The only way to get clean/always working urls is to remove this <base href> and use contextPath/img/foo.gif urls.
> That's what I did and tested everywhere and in different conditions.
> I had to change some custom tags to return "contextPath aware" url (ArtifactsLinkTag and TabSheetTag)
> - Second point "use canonical url behind proxy" mainly rss.jsp:
> More complex, I created a URLProxyResolver.java (and it's unit test) to extract special headers added by mod_proxy.
> That means my patch only works for Apache (tested on apache 2.2) but since that's the most use proxy that would fix 90% of
> "people using proxy"'s problems.
> URLProxyResolver use a new class HttpServletRequestWrapper that appeared in servlet 2.4, that means I need to replace
> servlet.jar to servlet-api-2.4.jar + jsp-api-2.0.jar (Sun splited the jar)
> Since in servlet-api-2.4 have new methods in some interfaces (Request, Response...), I needed to add those new methods to
> the mock objects under net.sourceforge.cruisecontrol.mock
> I added code in rss.jsp to check if request is proxied, if true use the proxy hostname to create url.
> There is still a problem in rss when the proxy is using ssl, url will use cruisecontrol scheme (don't know how to fix that
> but that not the common case)
> - Third point "jmx available behind a proxy":
> User need to setup their proxy with the above parameters "/cruisecontrol/jmx" thing.
> I used my new class URLProxyResolver to check if request is behind a proxy, if true, url will be like
> /contextPath/jmx/[mbean|invoke]
> If not we use the normal jmx url http://localhost:8000/[mbean|invoke]
> It work I can force a build via the proxy and watch/set param in the jmx bean in controlpanel.
> -------------------------------------------
> Conclusion
> -------------------------------------------
> I know this is a big patch but please give it a try.
> I putted lots of efforts in it :( and I really think I didn't broke anything :)
> Still if you find any bug please let me know...
> I will add a svn-diff text file for the patch and a zip file with all the modified files + the new jars (since they will not appear in the svn-diff text file)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.public.thoughtworks.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb