[release] 3.0.0-HXP-A2

* Fix ready probe in libreoffice & imagemagick
* Add switch for behind-proxy
This commit is contained in:
alandavis
2022-08-09 08:59:09 +01:00
parent 02cded4c0d
commit 664d2b84b2
5 changed files with 17 additions and 8 deletions

View File

@@ -37,6 +37,7 @@ import org.alfresco.transform.registry.TransformServiceRegistry;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
@@ -104,6 +105,8 @@ public class TransformController
private String coreVersion; private String coreVersion;
@Autowired @Autowired
private OptionLister optionLister; private OptionLister optionLister;
@Value("${container.behind-ingres}")
private boolean behindIngres;
TransformEngine transformEngine; TransformEngine transformEngine;
@@ -181,14 +184,19 @@ public class TransformController
return "log"; // display log.html return "log"; // display log.html
} }
private static Object getPathPrefix(String transformEngineName) private Object getPathPrefix(String transformEngineName)
{ {
int i = transformEngineName.lastIndexOf('-'); String pathPrefix = "";
if (i != -1) if (behindIngres)
{ {
transformEngineName = transformEngineName.substring(i+1); int i = transformEngineName.lastIndexOf('-');
if (i != -1)
{
transformEngineName = transformEngineName.substring(i + 1);
}
pathPrefix = "/" + transformEngineName.toLowerCase();
} }
return "/"+transformEngineName.toLowerCase(); return pathPrefix;
} }
/** /**

View File

@@ -53,6 +53,7 @@ management:
container: container:
name: ${HOSTNAME:t-engine} name: ${HOSTNAME:t-engine}
behind-ingres: true
async-task-executor: async-task-executor:
core-pool-size: 1 core-pool-size: 1

View File

@@ -36,7 +36,7 @@
<div> <div>
<br/> <br/>
<a th:href="${proxyPathPrefix+'/'}">Test</a> <a th:href="${proxyPathPrefix+'/'}">Test</a>
<a th:href="${proxyPathPrefix+'/log'}">Log</a> Log
<a th:href="${proxyPathPrefix+'/ready'}">Ready</a> <a th:href="${proxyPathPrefix+'/ready'}">Ready</a>
<a th:href="${proxyPathPrefix+'/live'}">Live</a> <a th:href="${proxyPathPrefix+'/live'}">Live</a>
<a th:href="${proxyPathPrefix+'/transform/config?configVersion=9999'}">Config</a> <a th:href="${proxyPathPrefix+'/transform/config?configVersion=9999'}">Config</a>

View File

@@ -69,6 +69,6 @@ public class ImageMagickTransformEngine implements TransformEngine
public ProbeTransform getProbeTransform() public ProbeTransform getProbeTransform()
{ {
return new ProbeTransform("probe.jpg", MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, Collections.emptyMap(), return new ProbeTransform("probe.jpg", MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, Collections.emptyMap(),
35593, 1024, 150, 1024, 60 * 15 + 1, 60 * 15); 25383, 1024, 150, 1024, 60 * 15 + 1, 60 * 15);
} }
} }

View File

@@ -69,7 +69,7 @@ public class LibreOfficeTransformEngine implements TransformEngine
@Override @Override
public ProbeTransform getProbeTransform() public ProbeTransform getProbeTransform()
{ {
return new ProbeTransform("probe.jpg", MIMETYPE_WORD, MIMETYPE_PDF, Collections.emptyMap(), return new ProbeTransform("probe.doc", MIMETYPE_WORD, MIMETYPE_PDF, Collections.emptyMap(),
11817, 1024, 150, 10240, 60 * 30 + 1, 60 * 15 + 20); 11817, 1024, 150, 10240, 60 * 30 + 1, 60 * 15 + 20);
} }
} }