summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/graphs.nix
blob: e7dc54dd039443ed212677f1b7588d24786a647d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ config, lib, pkgs, ... }:

with import <stockholm/lib>;
let
  external-ip = config.krebs.build.host.nets.internet.ip4.addr;
  internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr;
  hn = config.krebs.build.host.name;
in {
  krebs.tinc_graphs = {
    enable = true;
    nginx = {
      enable = true;
      # TODO: remove hard-coded hostname
      complete = {
        extraConfig = ''
          if ( $server_addr = "${external-ip}" ) {
            return 403;
          }
        '';
        serverAliases = [
          "graph.r"
          "graph.${hn}" "graph.${hn}.r"
        ];
      };
      anonymous = {
        forceSSL = true;
        enableACME = true;
      };
    };
  };
}