2022-07-10 15:27:31 +02:00
|
|
|
{ config, ... }:
|
|
|
|
{
|
2022-12-30 18:29:13 +01:00
|
|
|
TLMS.dataAccumulator = {
|
2022-07-10 15:27:31 +02:00
|
|
|
enable = true;
|
|
|
|
host = "0.0.0.0";
|
|
|
|
port = 8080;
|
2022-09-03 00:25:10 +02:00
|
|
|
database = {
|
2022-07-10 15:27:31 +02:00
|
|
|
host = "127.0.0.1";
|
2022-07-13 21:24:00 +02:00
|
|
|
port = config.services.postgresql.port;
|
2022-09-03 00:25:10 +02:00
|
|
|
passwordFile = config.sops.secrets.postgres_password.path;
|
2023-03-05 14:12:50 +01:00
|
|
|
user = "tlms";
|
|
|
|
database = "tlms";
|
2022-07-10 15:27:31 +02:00
|
|
|
};
|
|
|
|
GRPC = [
|
|
|
|
{
|
2023-03-20 03:56:14 +01:00
|
|
|
name = "CHEMO";
|
|
|
|
host = config.TLMS.chmo.host;
|
|
|
|
port = config.TLMS.chemo.port;
|
2022-12-09 23:16:10 +01:00
|
|
|
}
|
2022-07-10 15:27:31 +02:00
|
|
|
];
|
|
|
|
};
|
2022-07-13 18:19:46 +02:00
|
|
|
systemd.services."data-accumulator" = {
|
|
|
|
after = [ "postgresql.service" ];
|
|
|
|
wants = [ "postgresql.service" ];
|
|
|
|
};
|
2022-09-14 22:53:45 +02:00
|
|
|
|
|
|
|
services = {
|
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
virtualHosts = {
|
2022-12-30 18:29:13 +01:00
|
|
|
"dump.${config.deployment-TLMS.domain}" = {
|
2022-09-14 22:53:45 +02:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations = {
|
|
|
|
"/" = {
|
2022-12-30 18:29:13 +01:00
|
|
|
proxyPass = with config.TLMS.dataAccumulator; "http://${host}:${toString port}/";
|
2022-09-14 22:53:45 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-07-10 15:27:31 +02:00
|
|
|
}
|