infrastructure/machines/storage01/influxdb.nix
Tom Hubrecht af61ae6e61 feat(dgn-web): Add simpleProxies
This proxies the required host to localhost:$port and enables SSL
2024-10-12 20:00:54 +02:00

50 lines
1,020 B
Nix

{ config, ... }:
let
secret = name: config.age.secrets."influxdb2-${name}".path;
token = user: secret "${user}_token_file";
host = "influx.dgnum.eu";
port = 8086;
in
{
services.influxdb2 = {
enable = true;
provision = {
enable = true;
organizations = {
dgnum = {
description = "DGNum org";
buckets.telegraf.description = "Telegraf bucket";
auths = {
telegraf = {
writeBuckets = [ "telegraf" ];
tokenFile = token "telegraf";
};
grafana = {
readPermissions = [ "buckets" ];
tokenFile = token "grafana";
};
};
};
};
initialSetup = {
tokenFile = token "initial";
passwordFile = secret "initial_password_file";
organization = "main";
bucket = "main";
};
};
};
dgn-web.simpleProxies.influxdb = {
inherit host port;
};
age-secrets.autoMatch = [ "influxdb2" ];
}