2023-09-11 13:31:13 +00:00
|
|
|
{ config, ... }: let
|
2019-07-19 22:09:47 +00:00
|
|
|
port = 3000;
|
|
|
|
in {
|
|
|
|
networking.firewall.allowedTCPPorts = [ port ]; # legacy
|
|
|
|
services.nginx.virtualHosts."grafana.shack" = {
|
2023-06-03 13:46:40 +00:00
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:${toString port}";
|
|
|
|
extraConfig =''
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
2019-07-19 22:09:47 +00:00
|
|
|
};
|
|
|
|
services.grafana = {
|
|
|
|
enable = true;
|
|
|
|
port = port;
|
|
|
|
addr = "0.0.0.0";
|
|
|
|
users.allowSignUp = true;
|
|
|
|
users.allowOrgCreate = true;
|
|
|
|
users.autoAssignOrg = true;
|
|
|
|
auth.anonymous.enable = true;
|
2023-09-11 13:31:13 +00:00
|
|
|
security = import "${config.krebs.secret.directory}/grafana_security.nix";
|
2019-07-19 22:09:47 +00:00
|
|
|
};
|
|
|
|
}
|