Skip to content

Commit

Permalink
Update configure-webui-authentication.sh, using the custom path
Browse files Browse the repository at this point in the history
this change appends the REAPER_AUTH_USER to the custom shiro.ini path instead of the default
  • Loading branch information
santiago-requena-despegar authored Jul 5, 2024
1 parent 92ddde6 commit 00b4616
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions src/server/src/main/docker/configure-webui-authentication.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,19 @@ if [ "false" = "${REAPER_AUTH_ENABLED}" ]; then
exit 0
fi

if [ ! -z "${REAPER_SHIRO_INI}" ]; then
cat <<EOT >> /etc/cassandra-reaper/config/cassandra-reaper.yml
accessControl:
sessionTimeout: PT10M
shiro:
iniConfigs: ["file:${REAPER_SHIRO_INI}"]
EOT
elif [ ! -z "${REAPER_AUTH_USER}" ]; then
cat <<EOT >> /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 <<EOT >> "${_ACTUAL_REAPER_SHIRO_INI_}"
${REAPER_AUTH_USER} = ${REAPER_AUTH_PASSWORD}, operator
EOT
_REAPER_SHIRO_INI_PATH_="file:${_ACTUAL_REAPER_SHIRO_INI_}"
else
cat <<EOT >> /etc/cassandra-reaper/config/cassandra-reaper.yml
_REAPER_SHIRO_INI_PATH_="classpath:shiro.ini"
fi

cat <<EOT2 >> /etc/cassandra-reaper/config/cassandra-reaper.yml
accessControl:
sessionTimeout: PT10M
shiro:
iniConfigs: ["classpath:shiro.ini"]
EOT
fi

if [ ! -z "${REAPER_AUTH_USER}" ]; then
cat <<EOT2 >> /etc/cassandra-reaper/config/shiro.ini
${REAPER_AUTH_USER} = ${REAPER_AUTH_PASSWORD}, operator
iniConfigs: ["${_REAPER_SHIRO_INI_PATH_}"]
EOT2
fi

0 comments on commit 00b4616

Please sign in to comment.