Add additional docker env variables for commonly changed settings#26757
Add additional docker env variables for commonly changed settings#26757yolabingo wants to merge 4 commits into
Conversation
${CMS_MAX_HTTP_HEADER_SIZE:-"16384"}
${CMS_ANTI_CLICK_JACKING_ENABLED:-"true"}
${CMS_ANTI_CLICK_JACKING_OPTION:-"SAMEORIGIN"}
${CMS_HSTS_ENABLED:-"true"}
${CMS_HSTS_MAX_AGE_SECONDS:-"31536000"}
${CMS_HSTS_INCLUDE_SUB_DOMAINS:-"true"}
export CMS_SESSION_TIMEOUT=${CMS_SESSION_TIMEOUT:-"30"}
Adds web.xml docker template file
override webapps/ROOT/WEB-INF/web.xml
Adds additional docker env vars for tomcat config
…com:dotCMS/core into issue-26751-provide-docker-web.xml-template
spbolton
left a comment
There was a problem hiding this comment.
docker/dotcms is no longer used in maven and we should be removing this. The equivalent is in dotCMS/src/main/docker/original
We currently also have dotCMS/src/main/docker/original/ROOT/srv/OVERRIDE/tomcat/conf that is copied in as the original Dockerfile scripts from dotCMS/src/main/docker/original/ROOT/srv/20-copy-overriden-files.sh
The use of these files in the OVERRIDE folder are deprecated and we should end up removing these. The base tomcat files already gets overriden from the files in dotCMS/src/main/container/tomcat9x/conf. Changing the old script may impact how engineering overrides these files at startup so for the time being server.xml and context.xml in dotCMS/src/main/docker/original/ROOT/srv/OVERRIDE/tomcat/conf and dotCMS/src/main/container/tomcat9x/conf should be kept in sync. The former only ends up running when using docker rather than local tomcat and the latter will only run when not using docker. We want these to end up being consistent.
| @@ -0,0 +1,617 @@ | |||
| <?xml version="1.0"?> | |||
There was a problem hiding this comment.
I think we discussed adding some changes to web.xml for a temporary basis, but already I cannot work out easily what is different in here to the base file in dotCMS/src/main/webapp/WEB-INF/web.xml. We are going to setting ourselves up for more confusion and pain with differences we may miss.
Is it just the addition of the parametized values like ${CMS_HSTS_ENABLED}. If this works can we not change the base web.xml.
Note in the new base maven server.xml dotCMS/src/main/docker/original/ROOT/srv/OVERRIDE/tomcat/conf/server.xml. we have integrated the configurable parameters that were in the override files and then separately defaulted in 00-config-defaults.sh. We do not need to separate these out as we can set the default value in place e.g. I am not sure if we can use the same thing in the web.xml also. It would be good to keep the configurable logic for web.xml in just the one file
There was a problem hiding this comment.
Is it just the addition of the parameterized values like ${CMS_HSTS_ENABLED}. If this works can we not change the base web.xml.
Yes, the only changes to web.xml are these parameterized values. We also set the defaults for these params in 00-config-defaults.sh.
If we can refactor this PR to provide the same functionality by modifying dotCMS/src/main/webapp/WEB-INF/web.xml instead of using having to duplicate that file as we do with server.xml, all the better.
I realize this "shell template" mechanism is deprecated, but this is an urgent need. The current situation is becoming untenable. It puts a considerable burden on the engineering team to not be able to set the commonly-changed settings in web.xml with environment variables. Rather than having to manage 2 versions of web.xml in a single repo, we currently have to manage dozens of custom web.xml files.
There was a problem hiding this comment.
I will test to see if web.xml will fetch parameters from environment variables.
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled with no activity. |
Proposed Changes
web.xmlfile to docker templates, which is copied bydocker/dotcms/ROOT/srv/20-copy-overriden-files.shcp /srv/OVERRIDE/WEB-INF/web.xml $TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xmlWe currently have template files for
server.xmlandcontext.xml.docker/dotcms/ROOT/srv/00-config-defaults.shNote -
CMS_HSTS_MAX_AGE_SECONDSandCMS_MAX_HTTP_HEADER_SIZEincrease the current default settings.Do we want to increase default
CMS_SESSION_TIMEOUTfrom 30 minutes?maxHttpHeaderSizeinserver.xmltemplate and exposes it as an env variableRelated Issues
#26751 provide web.xml template in docker image
#20515 Increase Tomcat maxHttpHeaderSize above 8k default