forked from dadoonet/S01E02-index-templates-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.env.sh
31 lines (27 loc) · 961 Bytes
/
.env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
source .env
if [ -e .cloud ] ; then
source .cloud
if [ -z "$CLOUD_PASSWORD" ] || [ -z "$CLOUD_ID" ] ; then
echo ".cloud file is incorrect. It must contain:"
echo "CLOUD_ID=YOUR_CLOUD_ID"
echo "CLOUD_PASSWORD=YOUR_CLOUD_PASSWORD"
echo "Falling back to local configuration."
ELASTICSEARCH_URL=http://localhost:9200
KIBANA_URL=http://localhost:5601
ELASTIC_PASSWORD=changeme
else
# Decode CLOUD_ID
DOMAIN=$(echo $CLOUD_ID | cut -d':' -f2 | base64 -d | cut -d'$' -f1)
ES=$(echo $CLOUD_ID | cut -d':' -f2 | base64 -d | cut -d'$' -f2)
KI=$(echo $CLOUD_ID | cut -d':' -f2 | base64 -d | cut -d'$' -f3)
ELASTICSEARCH_URL=https://$ES.$DOMAIN
KIBANA_URL=https://$KI.$DOMAIN
ELASTIC_PASSWORD=$CLOUD_PASSWORD
fi
else
echo ".cloud file does not exist. Falling back to local configuration."
ELASTICSEARCH_URL=http://localhost:9200
KIBANA_URL=http://localhost:5601
ELASTIC_PASSWORD=changeme
fi
LOGSTASH_URL=http://localhost:8080