This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
     new b4c6f8d  [UNOMI-551] - Utilise SSL in docker entrypoint (#385)
b4c6f8d is described below

commit b4c6f8da4d5a90ddee1ef2258715853a38dcc76c
Author: Max Pogonowski <[email protected]>
AuthorDate: Tue Feb 15 00:27:05 2022 +1100

    [UNOMI-551] - Utilise SSL in docker entrypoint (#385)
    
    * allow https schema in entrypoint.sh
    
    * account for absent env var
---
 docker/src/main/docker/entrypoint.sh | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/docker/src/main/docker/entrypoint.sh 
b/docker/src/main/docker/entrypoint.sh
index 9db9246..c601be4 100755
--- a/docker/src/main/docker/entrypoint.sh
+++ b/docker/src/main/docker/entrypoint.sh
@@ -16,13 +16,19 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
################################################################################
-# Wait for heathy ElasticSearch
+# Wait for healthy ElasticSearch
 # next wait for ES status to turn to Green
 
+if [ "$UNOMI_ELASTICSEARCH_SSL_ENABLE" == 'true' ]; then
+  schema='https'
+else
+  schema='http'
+fi
+
 if [ -v UNOMI_ELASTICSEARCH_USERNAME ] && [ -v UNOMI_ELASTICSEARCH_PASSWORD ]; 
then
-  
elasticsearch_addresses="$UNOMI_ELASTICSEARCH_USERNAME:$UNOMI_ELASTICSEARCH_PASSWORD@$UNOMI_ELASTICSEARCH_ADDRESSES/_cat/health?h=status"
+  
elasticsearch_addresses="$schema://$UNOMI_ELASTICSEARCH_USERNAME:$UNOMI_ELASTICSEARCH_PASSWORD@$UNOMI_ELASTICSEARCH_ADDRESSES/_cat/health?h=status"
 else
-  elasticsearch_addresses="$UNOMI_ELASTICSEARCH_ADDRESSES/_cat/health?h=status"
+  
elasticsearch_addresses="$schema://$UNOMI_ELASTICSEARCH_ADDRESSES/_cat/health?h=status"
 fi
 
 health_check="$(curl -fsSL "$elasticsearch_addresses")"
@@ -34,4 +40,4 @@ until ([ "$health_check" = 'yellow' ] || [ "$health_check" = 
'green' ]); do
 done
 
 # Run Unomi in current bash session, if Unomi crash or shutdown the container 
will stop
-$UNOMI_HOME/bin/karaf run
\ No newline at end of file
+$UNOMI_HOME/bin/karaf run

Reply via email to