Propagate bus passwords at EG install time
authorBill Erickson <berickxx@gmail.com>
Mon, 1 May 2023 16:27:39 +0000 (12:27 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 1 May 2023 16:27:39 +0000 (12:27 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/examples/opensrf_core.xml.example
Open-ILS/src/Makefile.am
configure.ac

index ede4e42..3537e30 100644 (file)
@@ -56,7 +56,7 @@ Example OpenSRF bootstrap configuration file for Evergreen
     <!-- Our domain should match that of the private router -->
     <domain>private.localhost</domain>
     <username>opensrf</username>
-    <passwd>password</passwd>
+    <passwd>OPENSRF_BUS_PASSWORD</passwd>
     <port>6379</port>
 
     <!-- 
@@ -101,7 +101,7 @@ Example OpenSRF bootstrap configuration file for Evergreen
 
     <!-- jabber login info -->
     <username>gateway</username>
-    <passwd>password</passwd>
+    <passwd>GATEWAY_BUS_PASSWORD</passwd>
     <port>6379</port>
     <loglevel>3</loglevel>
     <logfile>LOCALSTATEDIR/log/gateway.log</logfile>
@@ -135,7 +135,7 @@ Example OpenSRF bootstrap configuration file for Evergreen
         <port>6379</port>
         <unixpath>LOCALSTATEDIR/sock/unix_sock</unixpath>
         <username>router</username>
-        <password>password</password>
+        <password>ROUTER_BUS_PASSWORD</password>
         <resource>router</resource>
         <connect_timeout>10</connect_timeout>
         <max_reconnect_attempts>5</max_reconnect_attempts>
@@ -160,7 +160,7 @@ Example OpenSRF bootstrap configuration file for Evergreen
         <server>private.localhost</server>
         <port>6379</port>
         <username>router</username>
-        <password>password</password>
+        <password>ROUTER_BUS_PASSWORD</password>
         <resource>router</resource>
         <connect_timeout>10</connect_timeout>
         <max_reconnect_attempts>5</max_reconnect_attempts>
index a49ad74..33610f0 100644 (file)
@@ -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'
index d1b7ce6..89b73e1 100644 (file)
@@ -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([----------------------------------------------------------------------])