2023-11-25 20:56:46 +01:00
|
|
|
{ config, registry, ... }: {
|
2022-12-30 18:29:13 +01:00
|
|
|
TLMS.datacare = {
|
2022-07-10 15:27:31 +02:00
|
|
|
enable = true;
|
2023-11-25 20:56:46 +01:00
|
|
|
http = registry.port-datacare;
|
2023-11-25 21:39:32 +01:00
|
|
|
database = registry.postgres;
|
2023-05-15 00:30:28 +02:00
|
|
|
allowedIpsExport = [ "10.13.37.0/24" ];
|
2022-07-10 15:27:31 +02:00
|
|
|
saltFile = config.sops.secrets.postgres_password_hash_salt.path;
|
2022-12-23 01:02:06 +01:00
|
|
|
user = "datacare";
|
2023-03-05 14:12:50 +01:00
|
|
|
group = config.users.groups.postgres-tlms.name;
|
2022-07-10 15:27:31 +02:00
|
|
|
};
|
2022-12-23 01:02:06 +01:00
|
|
|
systemd.services."datacare" = {
|
2022-07-13 18:19:46 +02:00
|
|
|
after = [ "postgresql.service" ];
|
|
|
|
wants = [ "postgresql.service" ];
|
|
|
|
};
|
|
|
|
|
2022-07-10 15:27:31 +02:00
|
|
|
services = {
|
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
virtualHosts = {
|
2023-11-25 20:56:46 +01:00
|
|
|
"datacare.${
|
|
|
|
(builtins.replaceStrings [ "tlm.solutions" ] [ "dvb.solutions" ]
|
|
|
|
config.deployment-TLMS.domain)
|
|
|
|
}" = {
|
2023-04-18 21:48:32 +02:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
extraConfig = ''
|
|
|
|
rewrite ^ https://datacare.${config.deployment-TLMS.domain}$request_uri permanent;
|
|
|
|
'';
|
|
|
|
};
|
2022-12-30 18:29:13 +01:00
|
|
|
"datacare.${config.deployment-TLMS.domain}" = {
|
2022-07-10 15:27:31 +02:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations = {
|
|
|
|
"/" = {
|
2023-12-22 20:51:11 +01:00
|
|
|
proxyPass = with registry.port-datacare;
|
2023-11-25 20:56:46 +01:00
|
|
|
"http://${host}:${toString port}/";
|
2022-07-10 15:27:31 +02:00
|
|
|
proxyWebsockets = true;
|
2023-03-10 19:47:08 +01:00
|
|
|
extraConfig = ''
|
2023-05-14 17:28:02 +02:00
|
|
|
more_set_headers "Access-Control-Allow-Credentials: true";
|
|
|
|
'';
|
2022-07-10 15:27:31 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|