Browse Source

HUE-9209 [Hue] Adding SAML dependancies for Hue docker container (#1086)

Prakash Ranade 5 years ago
parent
commit
0ac734b51d
3 changed files with 17 additions and 2 deletions
  1. 4 1
      tools/container/base/hue/Dockerfile
  2. 1 1
      tools/container/build.sh
  3. 12 0
      tools/container/hue/hue.sh

+ 4 - 1
tools/container/base/hue/Dockerfile

@@ -39,9 +39,10 @@ RUN set -eux; \
         libtidy \
         libxml2-devel \
         libxslt-devel \
-        nmap-ncat \
         ncurses-devel \
+        nmap-ncat \
         openldap-devel \
+        openssl \
         openssl-devel \
         postgresql \
         postgresql-libs \
@@ -50,8 +51,10 @@ RUN set -eux; \
         readline-devel \
         sqlite-devel \
         sudo \
+        swig \
         which \
         xmlsec1 \
+        xmlsec1-openssl \
         zlib-devel
 
 RUN set -eux; easy_install supervisor pip

+ 1 - 1
tools/container/build.sh

@@ -9,7 +9,7 @@ HUE_DIR=$WORK_DIR/hue
 APACHE_DIR=$WORK_DIR/huelb
 BASEHUE_DIR=$WORK_DIR/base/hue
 BASEHUELB_DIR=$WORK_DIR/base/huelb
-HUEBASE_VERSION=huebase_centos:7.6
+HUEBASE_VERSION=huebase_centos:7.6.0.1
 HUELBBASE_VERSION=huelb_httpd:2.4.7.6
 HUEUSER="hive"
 

+ 12 - 0
tools/container/hue/hue.sh

@@ -46,6 +46,17 @@ function db_connectivity_check() {
   echo "$ret"
 }
 
+function set_saml() {
+  mkdir -pm 755 $HUE_CONF_DIR/samlcert
+  cd $HUE_CONF_DIR/samlcert
+  openssl genrsa -des3 -out hue.key -passout pass:cloudera 2048
+  openssl rsa -inform PEM -outform PEM -in hue.key -pubout -out hue-nopass.pem -passin pass:cloudera
+  echo "#!/bin/bash" >> samlscript.sh
+  echo "echo cloudera" >> samlscript.sh
+  chmod a+x samlscript.sh
+  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64
+}
+
 # If database connectivity is not set then fail
 ret=$(db_connectivity_check)
 if [[ $ret == "fail" ]];  then
@@ -63,6 +74,7 @@ if [[ $1 == kt_renewer ]]; then
     $HUE_BIN/hue kt_renewer
   fi
 elif [[ $1 == runcpserver ]]; then
+    set_saml
     $HUE_BIN/hue runcherrypyserver
 fi