From 00b46160093a43061d8d23ac082a7d1b5f3b76e5 Mon Sep 17 00:00:00 2001 From: santiago-requena-despegar <86979681+santiago-requena-despegar@users.noreply.github.com> Date: Fri, 5 Jul 2024 09:59:41 -0300 Subject: [PATCH] Update configure-webui-authentication.sh, using the custom path this change appends the REAPER_AUTH_USER to the custom shiro.ini path instead of the default --- .../docker/configure-webui-authentication.sh | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/server/src/main/docker/configure-webui-authentication.sh b/src/server/src/main/docker/configure-webui-authentication.sh index b3c5780d4..468081782 100644 --- a/src/server/src/main/docker/configure-webui-authentication.sh +++ b/src/server/src/main/docker/configure-webui-authentication.sh @@ -17,31 +17,19 @@ if [ "false" = "${REAPER_AUTH_ENABLED}" ]; then exit 0 fi -if [ ! -z "${REAPER_SHIRO_INI}" ]; then -cat <> /etc/cassandra-reaper/config/cassandra-reaper.yml -accessControl: - sessionTimeout: PT10M - shiro: - iniConfigs: ["file:${REAPER_SHIRO_INI}"] -EOT -elif [ ! -z "${REAPER_AUTH_USER}" ]; then -cat <> /etc/cassandra-reaper/config/cassandra-reaper.yml -accessControl: - sessionTimeout: PT10M - shiro: - iniConfigs: ["file:/etc/cassandra-reaper/config/shiro.ini"] +if [ ! -z "${REAPER_AUTH_USER}" ]; then + _ACTUAL_REAPER_SHIRO_INI_="${REAPER_SHIRO_INI:-/etc/cassandra-reaper/config/shiro.ini}" + cat <> "${_ACTUAL_REAPER_SHIRO_INI_}" +${REAPER_AUTH_USER} = ${REAPER_AUTH_PASSWORD}, operator EOT + _REAPER_SHIRO_INI_PATH_="file:${_ACTUAL_REAPER_SHIRO_INI_}" else -cat <> /etc/cassandra-reaper/config/cassandra-reaper.yml + _REAPER_SHIRO_INI_PATH_="classpath:shiro.ini" +fi + +cat <> /etc/cassandra-reaper/config/cassandra-reaper.yml accessControl: sessionTimeout: PT10M shiro: - iniConfigs: ["classpath:shiro.ini"] -EOT -fi - -if [ ! -z "${REAPER_AUTH_USER}" ]; then -cat <> /etc/cassandra-reaper/config/shiro.ini -${REAPER_AUTH_USER} = ${REAPER_AUTH_PASSWORD}, operator + iniConfigs: ["${_REAPER_SHIRO_INI_PATH_}"] EOT2 -fi