From 2b3a9025e0213ce0fa4c362f2753c7441f7d09e8 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 20 Feb 2019 11:40:10 +0100 Subject: [PATCH] fix: dev: [apache] fix merging error when no configuration is provided in relation. --- apache/lib/common | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apache/lib/common b/apache/lib/common index 7b12783..ea727c4 100644 --- a/apache/lib/common +++ b/apache/lib/common @@ -61,12 +61,14 @@ export -f apache_publish_dir ## - apache_vhost_create() { - local type="$1" cfg="$2" protocols="$3" dest="$4" custom_rules vhost_statement creds + local type="$1" cfg="$2" protocols="$3" dest="$4" custom_rules vhost_statement creds \ + redirect domain ssl_plugin_fun ssl_cfg_value ssl_cfg_options export APACHE_CONFIG_LOCATION="$SERVICE_CONFIGSTORE/etc/apache2/sites-enabled" - + if [ "$cfg" == "None" ]; then + cfg= + fi if [ -z "$protocols" ]; then protocols=$(__vhost_cfg_normalize_protocol "$cfg") || return 1 fi @@ -105,7 +107,7 @@ $(if [ "$custom_rules" ]; then cfg=$(merge_yaml_str "$cfg" "$(yaml_key_val_str "apache-custom-rules" "$redirect_rule $(if [ "$custom_rules" ]; then echo "- |"$'\n'"$(echo "$custom_rules" | prefix " ")" - fi)")") + fi)")") || return 1 fi [ "$RELATION_DATA_FILE" ] && \ relation-set protocol https @@ -201,7 +203,7 @@ __vhost_cfg_normalize_protocol() { case "$protocol" in auto) ssl=$(_get_ssl_option_value "$cfg" 2>/dev/null) - if [ "$ssl" ] ; then + if [ "$ssl" ]; then protocol="http,https" else protocol="http"