Add Get Content compress option to Yeoman Generator.

This commit is contained in:
Angel Borroy
2020-01-22 10:37:37 +01:00
parent 9d477a5fcc
commit 2882b8edc2
5 changed files with 38 additions and 4 deletions

View File

@@ -111,7 +111,8 @@ When using Community, some different options can be combined:
? Would you like to use HTTP or mTLS for Alfresco-SOLR communication? http
? Would you like to use HTTP or HTTPs for Web Proxy? http
? Would you like to protect the access to SOLR REST API? Yes
? Would you like to use a SOLR Replication (2 nodes in master-slave)? No
? Would you like to use a SOLR Replication? No
? Would you like to compress Get Content responses? No
```
**Note** that when choosing *mTLS* or *HTTPs*, default certificates, truststores and keystores are provided for testing purposes. If you are planning to use this Docker Compose template for real environments, replace these cryptographic stores with another generated by yourself to increase the security of your system.

View File

@@ -56,7 +56,7 @@ module.exports = class extends Generator {
type: 'confirm',
name: 'protectSolr',
message: 'Would you like to protect the access to SOLR REST API?',
default: 'true'
default: true
},
{
whenFunction: response => response.httpMode == 'http',
@@ -69,6 +69,13 @@ module.exports = class extends Generator {
{ name: "Yes - two nodes in a master-master configuration", value: "master-master" }
]
},
{
whenFunction: response => response.acsVersion == '6.2',
type: 'confirm',
name: 'gzip',
message: 'Would you like to compress Get Content responses?',
default: false
},
// Enterprise only options
{
whenFunction: response => response.alfrescoVersion == 'enterprise' && !response.replication,
@@ -208,7 +215,8 @@ module.exports = class extends Generator {
searchPath: searchBasePath,
zeppelin: (this.props.zeppelin ? "true" : "false"),
sharding: (this.props.sharding ? "true" : "false"),
shardingMethod: (this.props.shardingMethod)
shardingMethod: (this.props.shardingMethod),
gzip: (this.props.gzip ? "true" : "false")
}
);

View File

@@ -13,6 +13,7 @@ services:
TRUSTSTORE_PASS: kT9X6oe68t
KEYSTORE_TYPE: JCEKS
KEYSTORE_PASS: kT9X6oe68t <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
mem_limit: 1800m
environment:
JAVA_OPTS : "
@@ -66,6 +67,7 @@ services:
KEYSTORE_TYPE: JCEKS <% } %> <% if (replication) { %>
ENABLE_MASTER: "true"
ENABLE_SLAVE: "false" <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
@@ -108,6 +110,7 @@ services:
ENABLE_MASTER: <% if (replication == 'master-master') { %>"true"<% } else { %>"false"<% } %>
ENABLE_SLAVE: <% if (replication == 'master-master') { %>"false"<% } else { %>"true"<% } %>
MASTER_HOST: solr6 <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco

View File

@@ -40,13 +40,27 @@ RUN if [ "$SOLR_COMMS" == "https" ] ; then \
[[:space:]]\+<\/Engine>/\n\
<\/Engine>\n\
<Connector port=\"8443\" protocol=\"org.apache.coyote.http11.Http11Protocol\"\n\
connectionTimeout=\"20000\"\n\
SSLEnabled=\"true\" maxThreads=\"150\" scheme=\"https\"\n\
keystoreFile=\"\/usr\/local\/tomcat\/alf_data\/keystore\/ssl.keystore\"\n\
keystorePass=\"${KEYSTORE_PASS}\" keystoreType=\"${KEYSTORE_TYPE}\" secure=\"true\" connectionTimeout=\"240000\"\n\
keystorePass=\"${KEYSTORE_PASS}\" keystoreType=\"${KEYSTORE_TYPE}\" secure=\"true\"\n\
truststoreFile=\"\/usr\/local\/tomcat\/alf_data\/keystore\/ssl.truststore\"\n\
truststorePass=\"${TRUSTSTORE_PASS}\" truststoreType=\"${TRUSTSTORE_TYPE}\" clientAuth=\"want\" sslProtocol=\"TLS\">\n\
<\/Connector>/g" ${TOMCAT_DIR}/conf/server.xml; \
fi
# GZIP COMPRESSION
ARG COMPRESS_CONTENT
ENV COMPRESS_CONTENT $COMPRESS_CONTENT
RUN if [ "$COMPRESS_CONTENT" == "true" ] ; then \
sed -i "s/\
[[:space:]]\+connectionTimeout=\"20000\"/\n\
connectionTimeout=\"20000\"\n\
compression=\"on\"\n\
compressionMinSize=\"1\"\n\
/g" ${TOMCAT_DIR}/conf/server.xml; \
fi
# Copy custom content model to deployment folder
COPY model/* $TOMCAT_DIR/shared/classes/alfresco/extension/

View File

@@ -125,6 +125,14 @@ RUN if [ "$ENABLE_SHARDING" == "true" ] ; then \
fi; \
fi
# GZIP COMPRESSION
ARG COMPRESS_CONTENT
ENV COMPRESS_CONTENT $COMPRESS_CONTENT
RUN if [ "$COMPRESS_CONTENT" == "true" ] ; then \
sed -i '/^bash.*/i sed -i "'"s/solr.request.content.compress=false/solr.request.content.compress=true/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties\n' \
${DIST_DIR}/solr/bin/search_config_setup.sh; \
fi
# Useless for 'none'/'http' communications with Alfresco
RUN mkdir ${DIST_DIR}/keystore \
&& chown -R solr:solr ${DIST_DIR}/keystore