You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2022/02/14 13:29:25 UTC

[unomi] branch unomi-1.6.x updated: [UNOMI-551] - Utilise SSL in docker entrypoint (#385)

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

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


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

commit 75685451e0bc8d35d3bc0708b9b56208516d0b5b
Author: Max Pogonowski <ma...@gmail.com>
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
    
    (cherry picked from commit b4c6f8da4d5a90ddee1ef2258715853a38dcc76c)
---
 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