summaryrefslogtreecommitdiffstats
path: root/makefu/3modules/tinc_graphs.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-10-21 17:13:12 +0200
committermakefu <github@syntax-fehler.de>2015-10-21 17:13:12 +0200
commitba4708f2638722c8d18e560847946fdb5c87484d (patch)
tree10263b549d0d300b5cf64ad59ef516e6e61d1eef /makefu/3modules/tinc_graphs.nix
parent90683369be019254c2b86bfc4ca3c8de3b441ff0 (diff)
m 3 tinc_graphs: new api for nginx
Diffstat (limited to 'makefu/3modules/tinc_graphs.nix')
-rw-r--r--makefu/3modules/tinc_graphs.nix51
1 files changed, 30 insertions, 21 deletions
diff --git a/makefu/3modules/tinc_graphs.nix b/makefu/3modules/tinc_graphs.nix
index ff2f55873..42b08d62a 100644
--- a/makefu/3modules/tinc_graphs.nix
+++ b/makefu/3modules/tinc_graphs.nix
@@ -20,26 +20,37 @@ 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 {
+ 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" ];
+ };
+
};
};
@@ -110,8 +121,7 @@ let
};
krebs.nginx.servers = mkIf cfg.krebsNginx.enable {
- tinc_graphs_complete = {
- server-names = cfg.krebsNginx.hostnames_complete;
+ tinc_graphs_complete = cfg.nginx.complete {
locations = [
(nameValuePair "/" ''
autoindex on;
@@ -119,8 +129,7 @@ let
'')
];
};
- tinc_graphs_anonymous = {
- server-names = cfg.krebsNginx.hostnames_anonymous;
+ tinc_graphs_anonymous = cfg.nginx.anonymous // {
locations = [
(nameValuePair "/" ''
autoindex on;