Build XWIki from SVN and conversion of an old xwiki install
Hi, just built xwiki from the latest svn. I noticed, that the build.xml file is "wrong". It references the exo 1.0 jars (which are not present any more). I've attached the svn diff below. I just converted our wiki to the latest svn release (it was 0.9-840 before). The first thing I've noticed (which doesn't work anymore) is the reverse proxy through a https server. all urls are correct but point to "http" instead of "https". My guess is, that it is in XWikiServerURLFactory.getServerURL which always adds a "http" in front of the host if the x-forwarded-host was found. CU Christian -- ------------------------------------------ Logic United GmbH Email: [email protected] Tel: +49-89-189488-66 Index: build.xml =================================================================== --- build.xml (revision 972) +++ build.xml (working copy) @@ -109,7 +109,8 @@ includes="servlet-api-2.4.jar" /> <fileset id="libs.exo.fileset" dir="${lib.dir}" - includes="picocontainer-1.0.jar,exoplatform.container-1.0.jar,exoplatform.services.chart.api-1.0.jar,exoplatform.services.chart.impl-1.0.jar,exoplatform.services.common.api-1.0.jar,exoplatform.services.organization.api-1.0.jar,exoplatform.services.organization.impl-1.0.jar,exoplatform.services.security.api-1.0.jar,exoplatform.services.security.impl-1.0.jar,exoplatform.services.database.api-1.0.jar,exoplatform.services.database.impl-1.0.jar,exo-base-services-1.0.jar,exo-chart-service-1.0.jar,exo-chart-service-impl-1.0.jar,exo-commons-1.0.jar,exo-organization-service-1.0.jar,exo-security-service-1.0.jar" /> + includes="picocontainer-1.0.jar,exo-platform.commons.jar,exo-platform.container-2.0.jar,exo-platform.service.chart.api-2.0.jar,exo-platform.service.chart.impl-2.0.jar,exo-platform.service.common.api-2.0.jar,exo-platform.service.database.api-2.0.jar,exo-platform.service.database.impl-2.0.jar,exo-platform.service.organization.api-2.0.jar,exo-platform.service.organization.impl-2.0.jar,exo-platform.service.sercurity.api-2.0.jar,exo-platform.service.sercurity.impl-2.0.jar" /> + <!-- includes="picocontainer-1.0.jar,exoplatform.container-1.0.jar,exoplatform.services.chart.api-1.0.jar,exoplatform.services.chart.impl-1.0.jar,exoplatform.services.common.api-1.0.jar,exoplatform.services.organization.api-1.0.jar,exoplatform.services.organization.impl-1.0.jar,exoplatform.services.security.api-1.0.jar,exoplatform.services.security.impl-1.0.jar,exoplatform.services.database.api-1.0.jar,exoplatform.services.database.impl-1.0.jar,exo-base-services-1.0.jar,exo-chart-service-1.0.jar,exo-chart-service-impl-1.0.jar,exo-commons-1.0.jar,exo-organization-service-1.0.jar,exo-security-service-1.0.jar" /> --> <fileset id="libs.tests.fileset" dir="${lib.dir}" includes="cactus-1.7.jar,cactus-ant-1.7.jar,aspectjrt-1.2.1.jar,httpunit-1.6.jar,junit-3.8.1.jar,nekohtml-0.9.1.jar,clover-1.3.9.jar,jmock-1.0.1.jar,jmock-cglib-1.0.1.jar,org.mortbay.jetty-5.1.3.jar" />
Hi, Yes indeed we forgot to update the build.xml. Concerning the code in XWikiServerURLFactory, I'm not sure what would need to be done In this code final String host = context.getRequest().getHeader("x-forwarded-host"); // apache modproxy host if (host!=null) { int comaind = host.indexOf(','); final String host1 = comaind>0 ? host.substring(0, comaind) : host; if (!host1.equals("")) return new URL("http://"+host1); } Clearly "http://" is hardcoded, but would there be any way to know it should be https:// ? Ludovic Christian van der Leeden a écrit :
Hi,
just built xwiki from the latest svn. I noticed, that the build.xml file is "wrong". It references the exo 1.0 jars (which are not present any more).
I've attached the svn diff below.
I just converted our wiki to the latest svn release (it was 0.9-840 before).
The first thing I've noticed (which doesn't work anymore) is the reverse proxy through a https server. all urls are correct but point to "http" instead of "https". My guess is, that it is in XWikiServerURLFactory.getServerURL which always adds a "http" in front of the host if the x-forwarded-host was found.
CU
Christian
------------------------------------------------------------------------
Index: build.xml =================================================================== --- build.xml (revision 972) +++ build.xml (working copy) @@ -109,7 +109,8 @@ includes="servlet-api-2.4.jar" />
<fileset id="libs.exo.fileset" dir="${lib.dir}" - includes="picocontainer-1.0.jar,exoplatform.container-1.0.jar,exoplatform.services.chart.api-1.0.jar,exoplatform.services.chart.impl-1.0.jar,exoplatform.services.common.api-1.0.jar,exoplatform.services.organization.api-1.0.jar,exoplatform.services.organization.impl-1.0.jar,exoplatform.services.security.api-1.0.jar,exoplatform.services.security.impl-1.0.jar,exoplatform.services.database.api-1.0.jar,exoplatform.services.database.impl-1.0.jar,exo-base-services-1.0.jar,exo-chart-service-1.0.jar,exo-chart-service-impl-1.0.jar,exo-commons-1.0.jar,exo-organization-service-1.0.jar,exo-security-service-1.0.jar" /> + includes="picocontainer-1.0.jar,exo-platform.commons.jar,exo-platform.container-2.0.jar,exo-platform.service.chart.api-2.0.jar,exo-platform.service.chart.impl-2.0.jar,exo-platform.service.common.api-2.0.jar,exo-platform.service.database.api-2.0.jar,exo-platform.service.database.impl-2.0.jar,exo-platform.service.organization.api-2.0.jar,exo-platform.service.organization.impl-2.0.jar,exo-platform.service.sercurity.api-2.0.jar,exo-platform.service.sercurity.impl-2.0.jar" /> + <!-- includes="picocontainer-1.0.jar,exoplatform.container-1.0.jar,exoplatform.services.chart.api-1.0.jar,exoplatform.services.chart.impl-1.0.jar,exoplatform.services.common.api-1.0.jar,exoplatform.services.organization.api-1.0.jar,exoplatform.services.organization.impl-1.0.jar,exoplatform.services.security.api-1.0.jar,exoplatform.services.security.impl-1.0.jar,exoplatform.services.database.api-1.0.jar,exoplatform.services.database.impl-1.0.jar,exo-base-services-1.0.jar,exo-chart-service-1.0.jar,exo-chart-service-impl-1.0.jar,exo-commons-1.0.jar,exo-organization-service-1.0.jar,exo-security-service-1.0.jar" /> -->
<fileset id="libs.tests.fileset" dir="${lib.dir}" includes="cactus-1.7.jar,cactus-ant-1.7.jar,aspectjrt-1.2.1.jar,httpunit-1.6.jar,junit-3.8.1.jar,nekohtml-0.9.1.jar,clover-1.3.9.jar,jmock-1.0.1.jar,jmock-cglib-1.0.1.jar,org.mortbay.jetty-5.1.3.jar" />
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
Hi, How about evaluating a 2nd header that one can add with mod_header? I've called it x-request-scheme. So if this is set, it is used instead of "http". I haven't found a way to suppress the x-forwarded-host header which is sent by mod_proxy. Like: if (!host1.equals("")) { String scheme = context.getRequest().getHeader("x-request-scheme"); scheme = scheme == null ? "http" : scheme; return new URL(scheme + "//"+host1); } Christian Ludovic Dubost wrote:
Hi,
Yes indeed we forgot to update the build.xml. Concerning the code in XWikiServerURLFactory, I'm not sure what would need to be done In this code
final String host = context.getRequest().getHeader("x-forwarded-host"); // apache modproxy host if (host!=null) { int comaind = host.indexOf(','); final String host1 = comaind>0 ? host.substring(0, comaind) : host; if (!host1.equals("")) return new URL("http://"+host1); }
Clearly "http://" is hardcoded, but would there be any way to know it should be https:// ?
Ludovic
Christian van der Leeden a écrit :
Hi,
just built xwiki from the latest svn. I noticed, that the build.xml file is "wrong". It references the exo 1.0 jars (which are not present any more).
I've attached the svn diff below.
I just converted our wiki to the latest svn release (it was 0.9-840 before).
The first thing I've noticed (which doesn't work anymore) is the reverse proxy through a https server. all urls are correct but point to "http" instead of "https". My guess is, that it is in XWikiServerURLFactory.getServerURL which always adds a "http" in front of the host if the x-forwarded-host was found.
CU
Christian
------------------------------------------------------------------------
Index: build.xml =================================================================== --- build.xml (revision 972) +++ build.xml (working copy) @@ -109,7 +109,8 @@ includes="servlet-api-2.4.jar" />
<fileset id="libs.exo.fileset" dir="${lib.dir}" - includes="picocontainer-1.0.jar,exoplatform.container-1.0.jar,exoplatform.services.chart.api-1.0.jar,exoplatform.services.chart.impl-1.0.jar,exoplatform.services.common.api-1.0.jar,exoplatform.services.organization.api-1.0.jar,exoplatform.services.organization.impl-1.0.jar,exoplatform.services.security.api-1.0.jar,exoplatform.services.security.impl-1.0.jar,exoplatform.services.database.api-1.0.jar,exoplatform.services.database.impl-1.0.jar,exo-base-services-1.0.jar,exo-chart-service-1.0.jar,exo-chart-service-impl-1.0.jar,exo-commons-1.0.jar,exo-organization-service-1.0.jar,exo-security-service-1.0.jar" /> + includes="picocontainer-1.0.jar,exo-platform.commons.jar,exo-platform.container-2.0.jar,exo-platform.service.chart.api-2.0.jar,exo-platform.service.chart.impl-2.0.jar,exo-platform.service.common.api-2.0.jar,exo-platform.service.database.api-2.0.jar,exo-platform.service.database.impl-2.0.jar,exo-platform.service.organization.api-2.0.jar,exo-platform.service.organization.impl-2.0.jar,exo-platform.service.sercurity.api-2.0.jar,exo-platform.service.sercurity.impl-2.0.jar" /> + <!-- includes="picocontainer-1.0.jar,exoplatform.container-1.0.jar,exoplatform.services.chart.api-1.0.jar,exoplatform.services.chart.impl-1.0.jar,exoplatform.services.common.api-1.0.jar,exoplatform.services.organization.api-1.0.jar,exoplatform.services.organization.impl-1.0.jar,exoplatform.services.security.api-1.0.jar,exoplatform.services.security.impl-1.0.jar,exoplatform.services.database.api-1.0.jar,exoplatform.services.database.impl-1.0.jar,exo-base-services-1.0.jar,exo-chart-service-1.0.jar,exo-chart-service-impl-1.0.jar,exo-commons-1.0.jar,exo-organization-service-1.0.jar,exo-security-service-1.0.jar" /> -->
<fileset id="libs.tests.fileset" dir="${lib.dir}"
includes="cactus-1.7.jar,cactus-ant-1.7.jar,aspectjrt-1.2.1.jar,httpunit-1.6.jar,junit-3.8.1.jar,nekohtml-0.9.1.jar,clover-1.3.9.jar,jmock-1.0.1.jar,jmock-cglib-1.0.1.jar,org.mortbay.jetty-5.1.3.jar" />
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- ------------------------------------------ Logic United GmbH Email: [email protected] Tel: +49-89-189488-66
participants (2)
-
Christian van der Leeden -
Ludovic Dubost