1
0
Fork 0
forked from pub-solar/infra
pub-solar-infra-new/modules/apps/caddy.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.2 KiB
Nix
Raw Normal View History

2023-11-06 20:28:05 +00:00
{ config
, lib
, pkgs
, flake
, ...
}:
{
systemd.tmpfiles.rules = [
2024-04-28 15:25:40 +00:00
"d '/data/srv/www/os/download/' 0750 ${config.pub-solar-os.authentication.robot.username} ${config.pub-solar-os.authentication.robot.username} - -"
2023-11-06 20:28:05 +00:00
];
services.caddy = {
enable = lib.mkForce true;
2024-04-28 15:25:40 +00:00
group = config.pub-solar-os.authentication.robot.username;
email = config.pub-solar-os.adminEmail;
2023-11-06 20:28:05 +00:00
enableReload = true;
globalConfig = lib.mkForce ''
grace_period 60s
'';
virtualHosts = {
"flora-6.pub.solar" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
basicauth * {
2024-04-28 15:25:40 +00:00
${config.pub-solar-os.authentication.robot.username} $2a$14$mmIAy/Ezm6YGohUtXa2mWeW6Bcw1MQXPhrRbz14jAD2iUu3oob/t.
}
reverse_proxy :${toString config.services.loki.configuration.server.http_listen_port}
'';
};
2023-11-06 20:28:05 +00:00
"obs-portal.pub.solar" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
reverse_proxy obs-portal.svc.e5756d08-36fd-424b-f8bc-acdb92ca7b82.lev-1.int.greenbaum.zone:3000
'';
};
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
}