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