igniterealtime/Fastpath-webchat

option to configure via the environment

f1-outsourcing opened this issue · 0 comments

Since the configuration of the webchat only requires a few variables. It would be nice if we could set them via the environment. This way you will have an easy deployment of a container. Now I have to extract the war file and add a configuration file with something like this

cp webchat-4.2.0.war webchat.war && zip -r webchat.war WEB-INF

With such a file

<chat-settings>
  <serverDomain>${envOpenfireServer}</serverDomain>
  <port>5222</port>
  <sslEnabled>false</sslEnabled>
  <sslPort>-1</sslPort>
</chat-settings>

And something like this in the entrypoint.sh

export JAVA_OPTS="$JAVA_OPTS -DenvHttpPort=$TOMCAT_HTTP_PORT -DenvHttpsPort=$TOMCAT_HTTPS_PORT -DenvShutdown=$TOMCAT_SHUTDOWN -DenvOpenfireServer=$OPENFIRE_SERVER"

I can configure the container with an environment variable setting.

I think you need to enable the java variables for the chat-settings.xml, because the above is not working, while this substitution is working in eg. the tomcat server.xml

Server: ${envOpenfireServer}
Port: 5222
SSL Enabled: false
Test Connection