From 9bf5be7a3b9b0b2f8775935cd8bbc15983ac55fd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 26 Nov 2019 21:07:04 +0100 Subject: [PATCH] Bug 24151: Add key to the config Sponsored-by: Association KohaLa - https://koha-fr.org/ --- debian/scripts/koha-create | 3 +++ debian/templates/koha-conf-site.xml.in | 3 +++ etc/koha-conf.xml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index 9c6b211620..f40b210185 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -108,6 +108,7 @@ generate_config_file() { -e "s/__UNIXGROUP__/$username/g" \ -e "s#__TEMPLATE_CACHE_DIR__#$TEMPLATE_CACHE_DIR#g" \ -e "s#__TIMEZONE__#$TIMEZONE#g" \ + -e "s#__KEY__#$KEY#g" \ -e "s#__UPLOAD_PATH__#$UPLOAD_PATH#g" \ -e "s#__TMP_PATH__#$TMP_PATH#g" \ -e "s/__LOG_DIR__/\/var\/log\/koha\/$name/g" \ @@ -483,6 +484,8 @@ if [ "$CLO_TIMEZONE" != "" ]; then TIMEZONE=$CLO_TIMEZONE fi +KEY=$(htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/'); + if [ "$ENABLE_SRU" != "no" ]; then enable_sru_server fi diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 0f14556e4a..ad1a206cfb 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -403,6 +403,9 @@ __END_SRU_PUBLICSERVER__ server. e.g. Antarctica/South_Pole --> __TIMEZONE__ + + __KEY__ + + + __KEY__ +