From 6ef0aec20eb2da7862f95c16ae47056c0d787d4d Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 19 Apr 2018 01:19:53 +0000 Subject: [PATCH] Bug 16690: Make DB_HOST environment variable override. Actually use __WEBSERVER_HOST__ in rewrite-config.PL --- debian/templates/koha-conf-site.xml.in | 2 +- etc/koha-conf.xml | 2 +- rewrite-config.PL | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 3a66cc4..1ff0524 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -253,7 +253,7 @@ __END_SRU_PUBLICSERVER__ __DB_HOST__ - __DB_HOST__ + __WEBSERVER_HOST__ 3306 __DB_USER__ __DB_PASS__ diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index cb008b08..2fef44c 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -81,7 +81,7 @@ __PAZPAR2_TOGGLE_XML_POST__ __DB_HOST__ - __DB_HOST__ + __WEBSERVER_HOST__ __DB_PORT__ __DB_USER__ __DB_PASS__ diff --git a/rewrite-config.PL b/rewrite-config.PL index 5366493..cf46206 100644 --- a/rewrite-config.PL +++ b/rewrite-config.PL @@ -49,13 +49,14 @@ WEBSERVER_HOST, WEBSERVER_IP, WEBSERVER_PORT, WEBSERVER_PORT_LIBRARIAN, ZEBRA_PA =head1 EXAMPLES -To override the guessed hostname and email address, run: +To override the guessed hostnames and email address, run: + DB_HOST=mysecrethostname.com.invalid \ WEBSERVER_HOST=mysecrethostname.com.invalid \ WEBMASTER_EMAIL=webmaster@publichost.com make install Note that if WEBSERVER_HOST does not resolve to an IP address, you will -also need to override WEBSERVER_IP. +also need to override WEBSERVER_IP. DB_HOST defaults to the WEBSERVER_HOST value. =cut @@ -73,6 +74,7 @@ unless ( $myip = $ENV{WEBSERVER_IP} ) { or die "can't inet_ntoa ($!)"; } +$mydbhost = $ENV{DB_HOST} || $myhost; $prefix = $ENV{'INSTALL_BASE'} || "/usr"; @@ -85,7 +87,7 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr"; "__PLUGINS_DIR__" => "/var/lib/koha/plugins", "__DB_TYPE__" => "mysql", "__DB_NAME__" => "koha", - "__DB_HOST__" => $myhost, + "__DB_HOST__" => $mydbhost, "__DB_PORT__" => "3306", "__DB_USER__" => "kohaadmin", "__DB_PASS__" => "katikoan", -- 2.1.4