SIEMbitwardendnscrypthome assistantjellyfinjitsimulti-factor authenticationnextcloudonlyofficepiholeraspberry pirocket.chatsyncthingtorwazuhwireguard
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
900 B
22 lines
900 B
|
5 years ago
|
#!/bin/bash
|
||
|
|
|
||
|
|
set -e
|
||
|
|
|
||
|
|
if [[ -f "/opt/mistborn_volumes/extra/elasticsearch/init/internal_users.yml" ]]; then
|
||
|
|
echo "internal_users.yml exists. Proceeding."
|
||
|
|
exit 0
|
||
|
|
fi
|
||
|
|
|
||
|
|
mkdir -p /opt/mistborn_volumes/extra/elasticsearch/init/ >/dev/null 2>&1
|
||
|
|
chmod -R +x /opt/mistborn_volumes/extra/elasticsearch/init/
|
||
|
|
cp /opt/mistborn/scripts/services/elasticsearch/files/internal_users.yml /opt/mistborn_volumes/extra/elasticsearch/init/
|
||
|
|
|
||
|
5 years ago
|
ELASTICSEARCH_MISTBORN_HASHED="$(docker run --rm amazon/opendistro-for-elasticsearch:1.12.0 bash /usr/share/elasticsearch/plugins/opendistro_security/tools/hash.sh -p ${MISTBORN_DEFAULT_PASSWORD} | tr -d '\n')"
|
||
|
|
|
||
|
|
if [[ -z "${ELASTICSEARCH_MISTBORN_HASHED}" ]]; then
|
||
|
|
echo "Elasticsearch password hash not generated properly"
|
||
|
|
exit 1;
|
||
|
|
fi
|
||
|
5 years ago
|
|
||
|
|
sed -i "s|__MISTBORN_HASH__|${ELASTICSEARCH_MISTBORN_HASHED}|" /opt/mistborn_volumes/extra/elasticsearch/init/internal_users.yml
|