Browse Source

chg: [onlyoffice] rebuild config when new image is used

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/1/head
Valentin Lab 4 years ago
parent
commit
671ac64441
  1. 20
      onlyoffice/hooks/init

20
onlyoffice/hooks/init

@ -13,9 +13,23 @@
set -e set -e
if ! [ -e "$SERVICE_CONFIGSTORE/etc/onlyoffice/documentserver/local.json" ]; then
image_id=$(service_base_image_id "$SERVICE_NAME") || {
err "couldn't get image id of $SERVICE_NAME."
exit 1
}
CONTROL_FILE="$SERVICE_CONFIGSTORE/etc/onlyoffice/.image_id"
if [ "$(cat "$CONTROL_FILE")" != "$image_id" ]; then
## first time we need to extract configuration from image ## first time we need to extract configuration from image
rm -rf "$SERVICE_CONFIGSTORE/etc/onlyoffice"
mkdir -p "$SERVICE_CONFIGSTORE/etc/onlyoffice" mkdir -p "$SERVICE_CONFIGSTORE/etc/onlyoffice"
service_base_image_export_dir "$SERVICE_NAME" /etc/onlyoffice/documentserver "$SERVICE_CONFIGSTORE/etc/onlyoffice/" service_base_image_export_dir "$SERVICE_NAME" /etc/onlyoffice/documentserver "$SERVICE_CONFIGSTORE/etc/onlyoffice/"
fi
printf "%s" "$image_id" > "$CONTROL_FILE"
else
## probably not needed to regenerate fonts
init-config-add "\
$MASTER_BASE_SERVICE_NAME:
environment:
GENERATE_FONTS: \"false\"
"
fi
Loading…
Cancel
Save