2016-10-05 10:37:46 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#
|
2017-05-08 19:06:28 +02:00
|
|
|
WPS_CONFIG_FILE='{{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }}/config/wps_config.xml'
|
2016-10-05 10:37:46 +02:00
|
|
|
|
|
|
|
# Fix the hostname
|
2017-09-12 15:34:18 +02:00
|
|
|
{% if hostname is defined %}
|
2018-12-12 19:00:13 +01:00
|
|
|
sed -Ei 's/hostname=\".*\"\ hostport/hostname="{{ hostname }}" hostport/' "$WPS_CONFIG_FILE"
|
2017-09-12 15:34:18 +02:00
|
|
|
{% else %}
|
2018-12-12 19:00:13 +01:00
|
|
|
sed -Ei 's/hostname=\".*\"\ hostport/hostname="{{ smartgears_hostname }}" hostport/' "$WPS_CONFIG_FILE"
|
2017-09-12 15:34:18 +02:00
|
|
|
{% endif %}
|
2016-10-05 10:37:46 +02:00
|
|
|
|
2018-12-13 12:03:17 +01:00
|
|
|
# Set the port. It is different from the tomcat one if there is a reverse proxy before the service.
|
|
|
|
# https has the precedence if it is available
|
2018-12-14 17:08:15 +01:00
|
|
|
# TODO: change back to http and https_port when https://support.d4science.org/issues/13024 if fixed and the new dataminer deployed
|
2018-12-12 19:00:13 +01:00
|
|
|
{% if setup_nginx %}
|
2016-10-05 10:37:46 +02:00
|
|
|
{% if https_port is defined %}
|
2018-12-14 17:08:15 +01:00
|
|
|
sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ http_port | default('80') }}" includeDataInputsInResponse/' "$WPS_CONFIG_FILE"
|
|
|
|
sed -Ei 's/protocol=\".*\"\ hostname/protocol="http" hostname/' "$WPS_CONFIG_FILE"
|
2016-10-05 10:37:46 +02:00
|
|
|
{% else %}
|
2018-12-13 12:03:17 +01:00
|
|
|
sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ http_port | default('80') }}" includeDataInputsInResponse/' "$WPS_CONFIG_FILE"
|
2016-10-05 10:37:46 +02:00
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
2018-12-12 19:00:13 +01:00
|
|
|
sed -Ei 's/hostport=\".*\"\ includeDataInputsInResponse/hostport="{{ item.http_port }}" includeDataInputsInResponse/' "$WPS_CONFIG_FILE"
|
2016-10-05 10:37:46 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
exit 0
|