Browse Source

fix: dev: [apache] fix merging error when no configuration is provided in relation.

framadate
Valentin Lab 6 years ago
parent
commit
2b3a9025e0
  1. 12
      apache/lib/common

12
apache/lib/common

@ -61,12 +61,14 @@ export -f apache_publish_dir
## ##
apache_vhost_create() { 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" export APACHE_CONFIG_LOCATION="$SERVICE_CONFIGSTORE/etc/apache2/sites-enabled"
if [ "$cfg" == "None" ]; then
cfg=
fi
if [ -z "$protocols" ]; then if [ -z "$protocols" ]; then
protocols=$(__vhost_cfg_normalize_protocol "$cfg") || return 1 protocols=$(__vhost_cfg_normalize_protocol "$cfg") || return 1
fi fi
@ -105,7 +107,7 @@ $(if [ "$custom_rules" ]; then
cfg=$(merge_yaml_str "$cfg" "$(yaml_key_val_str "apache-custom-rules" "$redirect_rule cfg=$(merge_yaml_str "$cfg" "$(yaml_key_val_str "apache-custom-rules" "$redirect_rule
$(if [ "$custom_rules" ]; then $(if [ "$custom_rules" ]; then
echo "- |"$'\n'"$(echo "$custom_rules" | prefix " ")" echo "- |"$'\n'"$(echo "$custom_rules" | prefix " ")"
fi)")")
fi)")") || return 1
fi fi
[ "$RELATION_DATA_FILE" ] && \ [ "$RELATION_DATA_FILE" ] && \
relation-set protocol https relation-set protocol https
@ -201,7 +203,7 @@ __vhost_cfg_normalize_protocol() {
case "$protocol" in case "$protocol" in
auto) auto)
ssl=$(_get_ssl_option_value "$cfg" 2>/dev/null) ssl=$(_get_ssl_option_value "$cfg" 2>/dev/null)
if [ "$ssl" ] ; then
if [ "$ssl" ]; then
protocol="http,https" protocol="http,https"
else else
protocol="http" protocol="http"

Loading…
Cancel
Save