diff options
author | makefu <github@syntax-fehler.de> | 2015-10-21 17:13:12 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-10-21 17:13:12 +0200 |
commit | dbc72b0617abf3898e5ee5c5cbcfa0d3244fd7c5 (patch) | |
tree | 16d47520a8b3624bd830b5066d466205adff1c36 /3modules | |
parent | 85a42e1bcb332ed98b6ae015894e75cbb11fe3a6 (diff) |
m 3 tinc_graphs: new api for nginx
Diffstat (limited to '3modules')
-rw-r--r-- | 3modules/tinc_graphs.nix | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/3modules/tinc_graphs.nix b/3modules/tinc_graphs.nix index ff2f55873..42b08d62a 100644 --- a/3modules/tinc_graphs.nix +++ b/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; |