Commit 02062052 authored by k.elaammari's avatar k.elaammari
Browse files

removed admin.pw file

parent 8258a753
......@@ -10,11 +10,15 @@ fi
influx="/var/lib/influxdb"
credentials="$(cat $influx/backup/admin.pw)"
cacert=$influx/https/cacert.pem
backup_path=""
# credentials
echo "Please enter the Admin-Credentials in format user:password. "
read credentials
# check program args
if [ "$1" == "" ];then
#backup_path="/vagrant/backup/default_inc"
......
admin:longpassword
\ No newline at end of file
# These queries should be exectuted after each other for setup
q=CREATE USER admin WITH PASSWORD 'longpassword' WITH ALL PRIVILEGES
q=CREATE DATABASE prom
q=GRANT ALL ON prom TO admin
......
......@@ -7,14 +7,24 @@ sleep 5
provision=/home/vagrant/fileprovision
cacertpath=/var/lib/influxdb/https/cacert.pem
credentials="$(cat $provision/config/admin.pw)"
queries="$provision/config/setup.queries"
# Here you can set the initial admin credentials
name=admin
password=test
echo "Query: CREATE USER $name WITH PASSWORD '$password' WITH ALL PRIVILEGES"
curl -XPOST https://localhost:8086/query --cacert $cacertpath -u "$name:$password" --data "q=CREATE USER $name WITH PASSWORD '$password' WITH ALL PRIVILEGES" -H "Content-Type: application/x-www-form-urlencoded" 2> /dev/null
echo " "
# Execute 'setup.queries'
while read LINE;
do
if [[ $LINE == \q* ]]
then
echo "Query: ${LINE:2}"
curl -XPOST https://localhost:8086/query --cacert $cacertpath -u $credentials --data "$LINE" -H "Content-Type: application/x-www-form-urlencoded" 2> /dev/null
curl -XPOST https://localhost:8086/query --cacert $cacertpath -u "$name:$password" --data "$LINE" -H "Content-Type: application/x-www-form-urlencoded" 2> /dev/null
echo " "
else
continue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment