voxpupuli / puppet-confluence

A puppet module to install confluence
https://forge.puppet.com/puppet/confluence
MIT License
21 stars 76 forks source link

setenv.sh is being broken by the puppet-confluence module #155

Closed vrmerlin closed 5 years ago

vrmerlin commented 6 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

  class { 'confluence':
    version             => '6.8.1',
    user                => 'confluenceuser',
    uid                 => '3200',
    installdir          => '/opt/atlassian-confluence',
    homedir             => '/atlassian_tools_data/confluence',
    javahome            => '/usr/java/default',
    manage_service      => false,
    tomcat_proxy        => {
      scheme     => 'https',
      proxyName  => $hostname,
      proxyPort  => '443',
    }
  }

What are you seeing

It all installed fine, and confluence came up as expected and appeared to behave well. But, the websocket mechanism for simultaneous editing didn't work. After researching with Atlassian, they said my setenv.sh file had been changed from their version. And, they're right, it looks like the puppet-confluence module has changing the file a lot, and leading to the websocket configuration to break. Here's the diff for the file:

# diff puppet_changed_setenv.sh atlassian_shipped_setenv.sh
1,13c1
< #
< # The following 2 settings control the minimum and maximum given to the Confluence Java virtual machine.  In larger Confluence instances, the maximum amount will need to be increased.
< #
< JVM_MINIMUM_MEMORY="256m"
< JVM_MAXIMUM_MEMORY="1024m"
< JVM_PERMGEN_MEMORY="256m"
<
< #
< # Additional JAVA_OPTS
< #
< JAVA_OPTS=" $JAVA_OPTS"
< JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} -XX:MaxPermSize=${JVM_PERMGEN_MEMORY} $JAVA_OPTS -Djava.awt.headless=true "
< export JAVA_OPTS
---
> # See the CATALINA_OPTS below for tuning the JVM arguments used to start Confluence.
15c3
< echo "If you encounter issues starting up Confluence Standalone, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide"
---
> echo "If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide"
48a37,77
> # IMPORTANT NOTE: Only set JAVA_HOME or JRE_HOME above this line
> # Get standard Java environment variables
> if $os400; then
>   # -r will Only work on the os400 if the files are:
>   # 1. owned by the user
>   # 2. owned by the PRIMARY group of the user
>   # this will not work if the user belongs in secondary groups
>   . "$CATALINA_HOME"/bin/setjre.sh
> else
>   if [ -r "$CATALINA_HOME"/bin/setjre.sh ]; then
>     . "$CATALINA_HOME"/bin/setjre.sh
>   else
>     echo "Cannot find $CATALINA_HOME/bin/setjre.sh"
>     echo "This file is needed to run this program"
>     exit 1
>   fi
> fi
>
> echo "---------------------------------------------------------------------------"
> echo "Using Java: $JRE_HOME/bin/java"
> CONFLUENCE_CONTEXT_PATH=`$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/confluence-context-path-extractor.jar $CATALINA_HOME`
> export CONFLUENCE_CONTEXT_PATH
> $JRE_HOME/bin/java -jar $CATALINA_HOME/bin/synchrony-proxy-watchdog.jar $CATALINA_HOME
> echo "---------------------------------------------------------------------------"
>
> # Set the JVM arguments used to start Confluence. For a description of the options, see
> # http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
> CATALINA_OPTS="-XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution ${CATALINA_OPTS}"
> CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
> CATALINA_OPTS="-XX:G1ReservePercent=20 ${CATALINA_OPTS}"
> CATALINA_OPTS="-Djava.awt.headless=true ${CATALINA_OPTS}"
> CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}"
> CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:+UseG1GC ${CATALINA_OPTS}"
> CATALINA_OPTS="-Dsynchrony.enable.xhr.fallback=true ${CATALINA_OPTS}"
> CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 ${CATALINA_OPTS}"
> CATALINA_OPTS="${START_CONFLUENCE_JAVA_OPTS} ${CATALINA_OPTS}"
> CATALINA_OPTS="-Dconfluence.context.path=${CONFLUENCE_CONTEXT_PATH} ${CATALINA_OPTS}"
>
>
> export CATALINA_OPTS
>

What behaviour did you expect instead

I expected minimal changes to setenv.sh, if any, and the websockets to work as expected, so users can do simultaneous editing.

Output log

Any additional information you'd like to impart

vrmerlin commented 6 years ago

btw, i can confirm that if i revert back to the shipped setenv.sh, then the websocket stuff works. So, the setenv.sh changes made by puppet are indeed breaking things.