From 10fba201995d3693f6ebd73ff7899a2b230bba15 Mon Sep 17 00:00:00 2001 From: Daniel Frank Date: Fri, 28 Jan 2022 21:06:05 +0100 Subject: [PATCH] Set a retention policy for influxdb --- influxdb.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/influxdb.nix b/influxdb.nix index 9d89a32..0b1c174 100644 --- a/influxdb.nix +++ b/influxdb.nix @@ -70,7 +70,8 @@ read -N 32 -r knotendatenpw < /var/lib/influxdb/knotendaten.pw read -N 32 -r grafanapw < /var/lib/influxdb/grafana.pw ${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" -execute 'CREATE DATABASE freifunk' + ${config.services.influxdb.package}/bin/influx -username admin -password "$adminpw" -execute 'CREATE RETENTION POLICY "default" ON "freifunk" DURATION 90d REPLICATION 1 SHARD DURATION 1d DEFAULT' ${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'"