Make saved objects less hacky

This commit is contained in:
Mike Reeves
2021-03-09 10:03:29 -05:00
parent 1ecb079066
commit 49258a13a3

View File

@@ -14,14 +14,9 @@ cp /opt/so/conf/kibana/saved_objects.ndjson.template /opt/so/conf/kibana/saved_o
# SOCtopus and Manager # SOCtopus and Manager
sed -i "s/PLACEHOLDER/{{ MANAGER }}/g" /opt/so/conf/kibana/saved_objects.ndjson sed -i "s/PLACEHOLDER/{{ MANAGER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
## This hackery will be removed with Elastic Auth ## ## This hackery will be removed if using Elastic Auth ##
# Remove the cold cookie if its there
rm /tmp/cookie.txt
# Let's snag a cookie from Kibana # Let's snag a cookie from Kibana
curl -c /tmp/cookie.txt -X GET http://localhost:5601/ THECOOKIE=$(curl -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
THECOOKIE=$(cat /tmp/cookie.txt | grep sid | awk '{print $7}')
# Load saved objects # Load saved objects
curl -b "sid=$THECOOKIE" -L -X POST "localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson > /dev/null 2>&1 curl -b "sid=$THECOOKIE" -L -X POST "localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson > /dev/null 2>&1