Browse Source

fix: [apache] detect changes of embedded cert files to force restart

framadate
Valentin Lab 6 years ago
parent
commit
c7cad96943
  1. 10
      apache/lib/common

10
apache/lib/common

@ -1,5 +1,6 @@
# -*- mode: shell-script -*- # -*- mode: shell-script -*-
config_hash=
apache_proxy_dir () { apache_proxy_dir () {
DOMAIN=$(relation-get domain) || { DOMAIN=$(relation-get domain) || {
@ -150,6 +151,7 @@ ssl_fallback_prepare() {
if [ "$content" ]; then if [ "$content" ]; then
location="$(eval echo "\$__vhost_cfg_SSL_${label^^}_LOCATION")" location="$(eval echo "\$__vhost_cfg_SSL_${label^^}_LOCATION")"
echo "$content" | file_put "$dst$location" echo "$content" | file_put "$dst$location"
config_hash=$(printf "%s\0" "$config_hash" "$label" "$content" | md5_compat)
volumes="$volumes volumes="$volumes
- $dst$location:$location:ro" - $dst$location:$location:ro"
fi fi
@ -314,6 +316,7 @@ apache_core_rules_add() {
local conf="$1" dst="/etc/apache2/conf-enabled/$BASE_SERVICE_NAME.conf" local conf="$1" dst="/etc/apache2/conf-enabled/$BASE_SERVICE_NAME.conf"
debug "Adding core rule." debug "Adding core rule."
echo "$conf" | file_put "$CONFIGSTORE/$BASE_SERVICE_NAME$dst" echo "$conf" | file_put "$CONFIGSTORE/$BASE_SERVICE_NAME$dst"
config_hash=$(printf "%s\0" "$config_hash" "$conf" | md5_compat)
config-add " config-add "
$MASTER_BASE_SERVICE_NAME: $MASTER_BASE_SERVICE_NAME:
volumes: volumes:
@ -514,8 +517,11 @@ EOF
apache_config_hash() { apache_config_hash() {
debug "Adding config hash to enable recreating upon config change." debug "Adding config hash to enable recreating upon config change."
config_hash=$(find "$SERVICE_CONFIGSTORE/etc/apache2/sites-enabled" \
-name \*.conf -exec md5sum {} \; | md5_compat) || exit 1
config_hash=$({
printf "%s\0" "$config_hash"
find "$SERVICE_CONFIGSTORE/etc/apache2/sites-enabled" \
-name \*.conf -exec md5sum {} \;
} | md5_compat) || exit 1
init-config-add " init-config-add "
$MASTER_BASE_SERVICE_NAME: $MASTER_BASE_SERVICE_NAME:
labels: labels:

Loading…
Cancel
Save