summaryrefslogtreecommitdiffstats
path: root/makefu/3modules/tinc_graphs.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-10-21 19:06:48 +0200
committerlassulus <lass@aidsballs.de>2015-10-21 19:06:48 +0200
commit692a59423ab3ab8fb2f5323af15cdec033d94fda (patch)
treedb9cc8ee6e8299a642a4267354477ba7989782a6 /makefu/3modules/tinc_graphs.nix
parent27a4aa4a49b9befe278bb4dfa68a749822aea2c0 (diff)
parent6eb195b0bc1b2ecd1a39c842da4d14d4837d98cc (diff)
Merge remote-tracking branch 'pnp/master'
Diffstat (limited to 'makefu/3modules/tinc_graphs.nix')
-rw-r--r--makefu/3modules/tinc_graphs.nix58
1 files changed, 34 insertions, 24 deletions
diff --git a/makefu/3modules/tinc_graphs.nix b/makefu/3modules/tinc_graphs.nix
index ff2f55873..1f87f00cc 100644
--- a/makefu/3modules/tinc_graphs.nix
+++ b/makefu/3modules/tinc_graphs.nix
@@ -20,26 +20,38 @@ let
default = "${pkgs.geolite-legacy}/share/GeoIP/GeoIPCity.dat";
};
- krebsNginx = {
- # configure krebs nginx to serve the new graphs
- enable = mkEnableOption "tinc_graphs nginx";
+ nginx = {
+ enable = mkEnableOption "enable tinc_graphs to be served with nginx";
+
+ anonymous = {
+ server-names = mkOption {
+ type = with types; listOf str;
+ description = "hostnames which serve anonymous graphs";
+ default = [ "graphs.${config.krebs.build.host.name}" ];
+ };
+
+ listen = mkOption {
+ # use the type of the nginx listen option
+ type = with types; listOf str;
+ description = "listen address for anonymous graphs";
+ default = [ "80" ];
+ };
- hostnames_complete = mkOption {
- #TODO: this is not a secure way to serve these graphs,better listen to
- # the correct interface, krebs.nginx does not support this yet
-
- type = with types; listOf str;
- description = "hostname which serves complete graphs";
- default = [ "graphs.${config.krebs.build.host.name}" ];
};
- hostnames_anonymous = mkOption {
- type = with types; listOf str;
- description = ''
- hostname which serves anonymous graphs
- must be different from hostname_complete
- '';
- default = [ "anongraphs.${config.krebs.build.host.name}" ];
+ complete = {
+ server-names = mkOption {
+ type = with types; listOf str;
+ description = "hostname which serves complete graphs";
+ default = [ "graphs.${config.krebs.build.host.name}" ];
+ };
+
+ listen = mkOption {
+ type = with types; listOf str;
+ description = "listen address for complete graphs";
+ default = [ "127.0.0.1:80" ];
+ };
+
};
};
@@ -109,25 +121,23 @@ let
createHome = true;
};
- krebs.nginx.servers = mkIf cfg.krebsNginx.enable {
- tinc_graphs_complete = {
- server-names = cfg.krebsNginx.hostnames_complete;
+ krebs.nginx.servers = mkIf cfg.nginx.enable {
+ tinc_graphs_complete = mkMerge [ cfg.nginx.complete {
locations = [
(nameValuePair "/" ''
autoindex on;
root ${internal_dir};
'')
];
- };
- tinc_graphs_anonymous = {
- server-names = cfg.krebsNginx.hostnames_anonymous;
+ }] ;
+ tinc_graphs_anonymous = mkMerge [ cfg.nginx.anonymous {
locations = [
(nameValuePair "/" ''
autoindex on;
root ${external_dir};
'')
];
- };
+ }];
};
};