From 2e6408b5ff1e0bcd90324cde7ca5d5768262106b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 1 May 2023 12:27:39 -0400 Subject: [PATCH] LP2017941 Propagate bus passwords at EG install time Copy Redis passwords into EG's opensrf_core.xml.example file at build/install time, so it all Just Works. Signed-off-by: Bill Erickson --- Open-ILS/examples/opensrf_core.xml.example | 8 ++++---- Open-ILS/src/Makefile.am | 3 +++ configure.ac | 18 +++++++++++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Open-ILS/examples/opensrf_core.xml.example b/Open-ILS/examples/opensrf_core.xml.example index ede4e429d3..3537e30c2c 100644 --- a/Open-ILS/examples/opensrf_core.xml.example +++ b/Open-ILS/examples/opensrf_core.xml.example @@ -56,7 +56,7 @@ Example OpenSRF bootstrap configuration file for Evergreen private.localhost opensrf - password + OPENSRF_BUS_PASSWORD 6379 gateway - password + GATEWAY_BUS_PASSWORD 6379 3 LOCALSTATEDIR/log/gateway.log @@ -135,7 +135,7 @@ Example OpenSRF bootstrap configuration file for Evergreen 6379 LOCALSTATEDIR/sock/unix_sock router - password + ROUTER_BUS_PASSWORD router 10 5 @@ -160,7 +160,7 @@ Example OpenSRF bootstrap configuration file for Evergreen private.localhost 6379 router - password + ROUTER_BUS_PASSWORD router 10 5 diff --git a/Open-ILS/src/Makefile.am b/Open-ILS/src/Makefile.am index 36ea466e9c..653668efae 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -262,6 +262,9 @@ ilscore-install: sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example' sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example' sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example' + sed -i 's|OPENSRF_BUS_PASSWORD|@OPENSRF_BUS_PASSWORD@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example' + sed -i 's|GATEWAY_BUS_PASSWORD|@GATEWAY_BUS_PASSWORD@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example' + sed -i 's|ROUTER_BUS_PASSWORD|@ROUTER_BUS_PASSWORD@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example' sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example' sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example' sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example' diff --git a/configure.ac b/configure.ac index d1b7ce6a95..f5e53b4a08 100644 --- a/configure.ac +++ b/configure.ac @@ -190,7 +190,7 @@ AC_SUBST([LIBXML2_HEADERS]) PKG_CHECK_MODULES([DBI], [dbi]) AC_ARG_WITH([hiredis], -[ --with-hiredis=path location of the hiredis headers (default is /usr/include/hiredis/))], +[ --with-hiredis=path location of the hiredis headers (default is /usr/include/hiredis/))], [HIREDIS_HEADERS=${withval}], [HIREDIS_HEADERS=/usr/include/hiredis/]) AC_SUBST([HIREDIS_HEADERS]) @@ -206,6 +206,20 @@ AC_ARG_WITH([perlbase], [PERL_BASE=x]) AC_SUBST([PERL_BASE]) +AC_ARG_WITH([redis-accounts], +[ --with-redis-accounts=path location of the redis accounts file (default is $sysconfdir/redis-accounts.txt)], +[REDIS_ACCOUNTS=${withval}], +[REDIS_ACCOUNTS=$sysconfdir/redis-accounts.txt]) +AC_SUBST([REDIS_ACCOUNTS]) + +OPENSRF_BUS_PASSWORD=$(grep 'ACL SETUSER opensrf on >' ${REDIS_ACCOUNTS} | cut -d'>' -f2) +GATEWAY_BUS_PASSWORD=$(grep 'ACL SETUSER gateway on >' ${REDIS_ACCOUNTS} | cut -d'>' -f2) +ROUTER_BUS_PASSWORD=$(grep 'ACL SETUSER router on >' ${REDIS_ACCOUNTS} | cut -d'>' -f2) + +AC_SUBST([OPENSRF_BUS_PASSWORD]) +AC_SUBST([GATEWAY_BUS_PASSWORD]) +AC_SUBST([ROUTER_BUS_PASSWORD]) + AM_CONDITIONAL(CHECK_TESTS, test x$enable_tests = xyes) if test "x$openils_core" = "xtrue"; then @@ -415,6 +429,8 @@ AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS}) AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS}) AC_MSG_RESULT(libhiredis headers location: ${HIREDIS_HEADERS}) +AC_MSG_RESULT(REDIS: ${REDIS_ACCOUNTS}) +AC_MSG_RESULT(PASS: ${OPENSRF_BUS_PASS}) AC_MSG_RESULT([----------------------------------------------------------------------]) -- 2.11.0