influxdb: experiment with user auth

This commit is contained in:
Daniel Frank 2022-01-22 19:17:02 +01:00
parent b53bb1cb76
commit 8638be01ac
Signed by: tokudan
GPG key ID: 063CCCAD04182D32

View file

@ -67,12 +67,13 @@
read -r adminpw < /var/lib/influxdb/admin.pw
read -r knotendatenpw < /var/lib/influxdb/knotendaten.pw
read -r grafanapw < /var/lib/influxdb/grafana.pw
${config.services.influxdb.package}/bin/influx -execute 'create database freifunk'
${config.services.influxdb.package}/bin/influx -database freifunk -execute "create user admin with password '$adminpw'"
${config.services.influxdb.package}/bin/influx -database freifunk -execute "create user grafana with password '$grafanapw'"
${config.services.influxdb.package}/bin/influx -database freifunk -execute "create user knotendaten with password '$knotendatenpw'"
${config.services.influxdb.package}/bin/influx -database freifunk -execute "grant read on freifunk to grafana"
${config.services.influxdb.package}/bin/influx -database freifunk -execute "grant all on freifunk to admin"
${config.services.influxdb.package}/bin/influx -execute "create user admin with password '$adminpw' WITH ALL PRIVILEGES"
${config.services.influxdb.package}/bin/influx -username admin -password "$adminpw" -execute 'create database freifunk'
${config.services.influxdb.package}/bin/influx -username admin -password "$adminpw" -database freifunk -execute "grant all on freifunk to admin"
${config.services.influxdb.package}/bin/influx -username admin -password "$adminpw" -database freifunk -execute "create user grafana with password '$grafanapw'"
${config.services.influxdb.package}/bin/influx -username admin -password "$adminpw" -database freifunk -execute "create user knotendaten with password '$knotendatenpw'"
${config.services.influxdb.package}/bin/influx -username admin -password "$adminpw" -database freifunk -execute "grant read on freifunk to grafana"
${config.services.influxdb.package}/bin/influx -username admin -password "$adminpw" -database freifunk -execute "grant write on freifunk to knotendaten"
fi
'') ];
};