nix-config/modules/data-hoarder/socket.nix

41 lines
874 B
Nix
Raw Normal View History

2022-08-24 18:48:33 +02:00
{ config, ... }:
2022-07-13 21:24:00 +02:00
let
serice_number = 2;
2022-08-24 18:48:33 +02:00
in
{
2022-07-09 19:10:09 +02:00
dump-dvb.funnel = {
enable = true;
GRPC = {
host = "127.0.0.1";
2022-07-13 21:24:00 +02:00
port = 50050 + serice_number;
2022-07-09 19:10:09 +02:00
};
defaultWebsocket = {
host = "127.0.0.1";
2022-07-13 21:24:00 +02:00
port = 9000 + serice_number;
2022-05-01 13:52:41 +02:00
};
2022-12-09 23:16:10 +01:00
metrics = {
port = 9010;
host = "0.0.0.0";
};
2022-12-05 23:08:50 +01:00
apiAddress = "127.0.0.1:${toString config.dump-dvb.api.port}";
2022-05-01 13:52:41 +02:00
};
services = {
nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"socket.${config.deployment-dvb.domain}" = {
forceSSL = true;
2022-05-01 13:52:41 +02:00
enableACME = true;
locations = {
"/" = {
2022-07-13 21:24:00 +02:00
proxyPass = with config.dump-dvb.funnel.defaultWebsocket; "http://${host}:${toString port}/";
2022-05-01 13:52:41 +02:00
proxyWebsockets = true;
};
};
};
};
};
};
}