ci.docker icon indicating copy to clipboard operation
ci.docker copied to clipboard

Entrypoint always trying to populate keystore.xml

Open pierrepook opened this issue 5 years ago • 4 comments

The docker-server.sh entrypoint I believe has a bug

  # Add the keystore password to server configuration
  if [ ! -e $keystorePath ]; then
    sed "s|REPLACE|$PASSWORD|g" $SNIPPETS_SOURCE/keystore.xml > $SNIPPETS_TARGET_DEFAULTS/keystore.xml
  fi
  if [ -e $TRUSTSTORE_FILE ]; then
    sed "s|PWD_TRUST|$TRUSTSTORE_PASSWORD|g" $SNIPPETS_SOURCE/truststore.xml > $SNIPPETS_TARGET_OVERRIDES/truststore.xml
  elif [ ! -z $SEC_TLS_TRUSTDEFAULTCERTS ]; then 
    cp $SNIPPETS_SOURCE/trustDefault.xml $SNIPPETS_TARGET_OVERRIDES/trustDefault.xml  
  fi

The section where it checks for keystore is always adding the keystore if it doesnt exist but it should only populate if it does exist. If the keystore is there, its because I passed the arg at BUILD time then it should populate it.

Always populating it regardless and giving me no option seems like a bug

I believe it should be if [ -e $keystorePath ]; then

pierrepook avatar Oct 22 '20 15:10 pierrepook

@arturdzm could you please have a look at this? Thanks.

leochr avatar Nov 16 '20 16:11 leochr

When user provides their own keystore.xml and keystore file and build time this will be skipped.

If the user does not provide any keystore information the XML is generated to make sure the password is set and keystore is generated at runtime by Liberty.

arturdzm avatar Nov 16 '20 19:11 arturdzm

The problem is that in order for it to work I have to provide the key store in a specific location. However, with the cloud vendor I am using I don’t necessarily have control of where I can put the keystone

pierrepook avatar Nov 16 '20 19:11 pierrepook

Therefore I am not using the configure.sh and would like to switch off the auto adding of the keystore which is not possible

pierrepook avatar Nov 16 '20 19:11 pierrepook