Change the wps-fixer script so that it uses https as the protocol if it's enabled in the reverse proxy.

This commit is contained in:
Andrea Dell'Amico 2018-12-12 19:00:13 +01:00
parent 1dee266626
commit 3765cedc5b
1 changed files with 12 additions and 11 deletions

View File

@ -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