From b5d11f51e6ed14b4a59505ec3436770a925efa00 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 1 May 2023 12:27:39 -0400 Subject: [PATCH] Propagate bus passwords at EG install time 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, 25 insertions(+), 4 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 a49ad74ce2..33610f0af8 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -261,6 +261,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..89b73e10cd 100644 --- a/configure.ac +++ b/configure.ac @@ -206,6 +206,22 @@ AC_ARG_WITH([perlbase], [PERL_BASE=x]) AC_SUBST([PERL_BASE]) +AC_ARG_WITH([redis-accounts], +[ --with-redis-accounts=path location of the hiredis headers (default is /usr/include/hiredis/)], +[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) +ADMIN_BUS_PASSWORD=$(grep 'ACL SETUSER admin on >' ${REDIS_ACCOUNTS} | cut -d'>' -f2) + +AC_SUBST([OPENSRF_BUS_PASSWORD]) +AC_SUBST([GATEWAY_BUS_PASSWORD]) +AC_SUBST([ROUTER_BUS_PASSWORD]) +AC_SUBST([ADMIN_BUS_PASSWORD]) + AM_CONDITIONAL(CHECK_TESTS, test x$enable_tests = xyes) if test "x$openils_core" = "xtrue"; then @@ -415,6 +431,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