nixos-config/machines/gitea/caddy.nix
Erwin Boskma 47b905bf47
The Big Network Update
Due to subnet overlap with the new company network, made the following changes:

- Set home network to 10.9.0.0/24
- Update work VPN configuration with new subnets and keys
2025-01-27 10:25:29 +01:00

42 lines
695 B
Nix

{
pkgs,
config,
...
}:
{
services.caddy = {
enable = true;
package = pkgs.caddy-cloudflare;
email = "erwin@datarift.nl";
virtualHosts = {
"git.datarift.nl" = {
extraConfig = ''
@local {
remote_ip 10.9.0.0/24
}
handle @local {
reverse_proxy 127.0.0.1:3000
}
handle {
error "Nope." 403
}
tls {
dns cloudflare {env.CF_API_TOKEN}
}
'';
};
};
};
networking.firewall.allowedTCPPorts = [
80
443
];
systemd.services.caddy.serviceConfig.EnvironmentFile = [ config.sops.secrets.caddy-env.path ];
}