diff --git a/smartgears/smartgears_egi_image/templates/get-gcube-keys.sh.j2 b/smartgears/smartgears_egi_image/templates/get-gcube-keys.sh.j2 index 7c80138..f4b8276 100644 --- a/smartgears/smartgears_egi_image/templates/get-gcube-keys.sh.j2 +++ b/smartgears/smartgears_egi_image/templates/get-gcube-keys.sh.j2 @@ -24,11 +24,17 @@ if [ "$INFRA_NAME" == "gcube" ] ; then wget {{ gcube_dkey_1 }} --no-check-certificate -o $LOG_FILE.gcube -O gcube.gcubekey wget {{ gcube_dkey_2 }} --no-check-certificate -o $LOG_FILE.devsec -O devsec.gcubekey wget {{ gcube_dkey_3 }} --no-check-certificate -o $LOG_FILE.devNext -O devNext.gcubekey + wget {{ gcube_prekey_1 }} --no-check-certificate -o $LOG_FILE.preprod -O preprod.gcubekey elif [ "$INFRA_NAME" == "d4science.research-infrastructures.eu" ] ; then echo "Downloading the keys for the $INFRA_NAME infra" >> $LOG_FILE wget {{ gcube_pkey_1 }} --no-check-certificate -o $LOG_FILE.d4science -O d4science.research-infrastructures.eu.gcubekey wget {{ gcube_pkey_2 }} --no-check-certificate -o $LOG_FILE.FARM -O FARM.gcubekey wget {{ gcube_pkey_3 }} --no-check-certificate -o $LOG_FILE.gCubeApps -O gCubeApps.gcubekey + wget {{ gcube_pkey_4 }} --no-check-certificate -o $LOG_FILE.D4Research -O D4Research.gcubekey + wget {{ gcube_pkey_3 }} --no-check-certificate -o $LOG_FILE.SoBigData -O SoBigData.gcubekey + wget {{ gcube_pkey_3 }} --no-check-certificate -o $LOG_FILE.OpenAIRE -O OpenAIRE.gcubekey + wget {{ gcube_pkey_3 }} --no-check-certificate -o $LOG_FILE.Edison -O Edison.gcubekey + wget {{ gcube_pkey_3 }} --no-check-certificate -o $LOG_FILE.SmartArea -O SmartArea.gcubekey chmod 400 $SM_LIB_DIR/*.gcubekey else echo "The Infra name is unknown, no keys downloaded" >> $LOG_FILE diff --git a/smartgears/smartgears_egi_image/templates/smartgears-setup.sh.j2 b/smartgears/smartgears_egi_image/templates/smartgears-setup.sh.j2 index b596964..fe28134 100755 --- a/smartgears/smartgears_egi_image/templates/smartgears-setup.sh.j2 +++ b/smartgears/smartgears_egi_image/templates/smartgears-setup.sh.j2 @@ -1,9 +1,10 @@ #!/bin/bash SM_DIR={{ smartgears_install_path }} -SM_CONF_F={{ smartgears_user_home }}/.containerxml/1-container.xml -SM_CONF_TOKENS_F={{ smartgears_user_home }}/.containerxml/2-container.xml -SM_CONF_TAIL_F={{ smartgears_user_home }}/.containerxml/3-container.xml +SM_DOT_CONF_D={{ smartgears_user_home }}/.containerxml +SM_CONF_F=${SM_DOT_CONF_D}/1-container.xml +SM_CONF_TOKENS_F=${SM_DOT_CONF_D}/2-container.xml +SM_CONF_TAIL_F=${SM_DOT_CONF_D}/3-container.xml SM_CONF_SCOPES_F=/usr/local/etc/scopes.list SM_CONF_DEST_F=${SM_DIR}/container.xml SM_LIB_DIR=${SM_DIR}/lib @@ -126,6 +127,7 @@ function populate_head_containerxml() { sed -i -e "s#@SMARTGEARS_VO_NAME@#${SCOPE}#g" $SM_CONF_F sed -i -e "s#@SMARTGEARS_COUNTRY@#${COUNTRY}#g" $SM_CONF_F sed -i -e "s#@SMARTGEARS_LOCATION@#${LOCATION}#g" $SM_CONF_F + sed -i -e "s#@SMARTGEARS_AUTHORIZE_CHILDREN@#${AUTHORIZE_CHILDREN}#g" $SM_CONF_F } function fix_wps_configuration() { @@ -174,6 +176,14 @@ function get_smartgears_scope_tokens() { fi } +function fix_containerxml_perms() { + chown -R gcube:gcube + chmod 640 ${SM_DOT_CONF_D}/.* + chown gcube:gcube $SM_CONF_DEST_F + chmod 640 $SM_CONF_DEST_F +} + + function merge_container_xml() { echo "-- merge_container_xml: compose the file" >> $LOG_FILE cat $SM_CONF_F $SM_CONF_TOKENS_F $SM_CONF_TAIL_F > $SM_CONF_DEST_F @@ -231,7 +241,7 @@ populate_head_containerxml fix_wps_configuration fix_get_scopes get_smartgears_scope_tokens -merge_container_xml +fix_containerxml_perms get_gcube_keys set_java_heap cleanup_cloud_user_data