kolla/docker/opensearch/opensearch-dashboards/extend_start.sh
Michal Nasiadka 6786e4384c opensearch-dashboards: Fix permissions
Since we moved to using rpm/deb packages, the user has changed.

Related-Bug: #2020152
Change-Id: I2a5a0d761223b4e99c8df59f80261108380d5038
2023-05-23 14:27:51 +00:00

18 lines
609 B
Bash

#!/bin/bash
if [[ ! -d "/var/log/kolla/opensearch-dashboards" ]]; then
mkdir -p /var/log/kolla/opensearch-dashboards
fi
if [[ $(stat -c %a /var/log/kolla/opensearch-dashboards) != "755" ]]; then
chmod 755 /var/log/kolla/opensearch-dashboards
fi
export DASHBOARDS_HOME=/usr/share/opensearch-dashboards
PLUGIN_LIST=$($DASHBOARDS_HOME/bin/opensearch-dashboards-plugin list)
if [[ "${OPENSEARCH_DASHBOARDS_SECURITY_PLUGIN:-True}" == "False" ]]; then
if [[ ${PLUGIN_LIST} =~ "securityDashboards" ]]; then
$DASHBOARDS_HOME/bin/opensearch-dashboards-plugin remove securityDashboards
fi
fi