From 8638be01ac6bd8dcd1500832728019b6f8803a9d Mon Sep 17 00:00:00 2001 From: Daniel Frank Date: Sat, 22 Jan 2022 19:17:02 +0100 Subject: [PATCH] influxdb: experiment with user auth --- influxdb.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/influxdb.nix b/influxdb.nix index c1e339b..28106aa 100644 --- a/influxdb.nix +++ b/influxdb.nix @@ -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 '') ]; };