diff --git a/smartgears/dataminer_app/templates/wps-config-fixer.j2 b/smartgears/dataminer_app/templates/wps-config-fixer.j2 index a9b7cfef..05c7ca62 100644 --- a/smartgears/dataminer_app/templates/wps-config-fixer.j2 +++ b/smartgears/dataminer_app/templates/wps-config-fixer.j2 @@ -5,26 +5,27 @@ WPS_CONFIG_FILE='{{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }} # Fix the hostname {% if hostname is defined %} -sed -Ei 's/hostname=\".*\"\ hostport/hostname="{{ hostname }}" hostport/' $WPS_CONFIG_FILE +sed -Ei 's/hostname=\".*\"\ hostport/hostname="{{ hostname }}" hostport/' "$WPS_CONFIG_FILE" {% else %} -sed -Ei 's/hostname=\".*\"\ hostport/hostname="{{ smartgears_hostname }}" hostport/' $WPS_CONFIG_FILE +sed -Ei 's/hostname=\".*\"\ hostport/hostname="{{ smartgears_hostname }}" hostport/' "$WPS_CONFIG_FILE" {% endif %} # Fix the port -{%if setup_nginx %} +{% if setup_nginx %} {% if https_port is defined %} -{% if http_redirect_to_https is defined and http_redirect_to_https %} -sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ https_port }}" includeDataInputsInResponse/' $WPS_CONFIG_FILE +# {% if http_redirect_to_https is defined and http_redirect_to_https %} +sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ https_port }}" includeDataInputsInResponse/' "$WPS_CONFIG_FILE" +sed -Ei 's/protocol=\".*\"\ hostname/protocol="https" hostname/' "$WPS_CONFIG_FILE" +# {% else %} +# sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ http_port }}" includeDataInputsInResponse/' "$WPS_CONFIG_FILE" +#{% endif %} {% else %} -sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ http_port }}" includeDataInputsInResponse/' $WPS_CONFIG_FILE -{% endif %} -{% else %} -{%if http_port is defined %} -sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ http_port }}" includeDataInputsInResponse/' $WPS_CONFIG_FILE +{% if http_port is defined %} +sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ http_port }}" includeDataInputsInResponse/' "$WPS_CONFIG_FILE" {% endif %} {% endif %} {% else %} -sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ item.http_port }}" includeDataInputsInResponse/' $WPS_CONFIG_FILE +sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ item.http_port }}" includeDataInputsInResponse/' "$WPS_CONFIG_FILE" {% endif %} exit 0