refactor(ops): make nixos.snix.cache grafana listen on unix socket
Change-Id: Iadd9850faadb3037825c0465b9aed45fa2826583 Reviewed-on: https://cl.snix.dev/c/snix/+/30495 Reviewed-by: Ryan Lahfa <masterancpp@gmail.com> Tested-by: besadii Autosubmit: Florian Klink <flokli@flokli.de>
This commit is contained in:
parent
7c3d029b8e
commit
ec9e7ee73c
1 changed files with 9 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
domain = config.machine.domain;
|
domain = config.machine.domain;
|
||||||
in
|
in
|
||||||
|
|
@ -115,16 +115,15 @@ in
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
server = {
|
server = {
|
||||||
|
protocol = "socket";
|
||||||
|
socket = "/run/grafana/web.sock";
|
||||||
|
socket_gid = config.ids.gids.nginx;
|
||||||
domain = domain;
|
domain = domain;
|
||||||
http_addr = "127.0.0.1";
|
|
||||||
http_port = 3000;
|
|
||||||
root_url = "https://%(domain)s/grafana";
|
root_url = "https://%(domain)s/grafana";
|
||||||
serve_from_sub_path = true;
|
serve_from_sub_path = true;
|
||||||
};
|
};
|
||||||
analytics.reporting_enabled = false;
|
analytics.reporting_enabled = false;
|
||||||
"auth.anonymous" = {
|
"auth.anonymous".enabled = true;
|
||||||
enabled = true;
|
|
||||||
};
|
|
||||||
auth.disable_login_form = true;
|
auth.disable_login_form = true;
|
||||||
"auth.basic".enabled = false;
|
"auth.basic".enabled = false;
|
||||||
"auth.github" = {
|
"auth.github" = {
|
||||||
|
|
@ -176,9 +175,12 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.grafana.serviceConfig.LoadCredential = "github_auth_client_secret:/etc/secrets/grafana_github_auth_client_secret";
|
systemd.services.grafana.serviceConfig.LoadCredential = "github_auth_client_secret:/etc/secrets/grafana_github_auth_client_secret";
|
||||||
|
systemd.services.grafana.serviceConfig.RuntimeDirectory = "grafana";
|
||||||
|
systemd.services.grafana.serviceConfig.SupplementaryGroups = "nginx";
|
||||||
|
|
||||||
|
services.nginx.upstreams.grafana.servers."unix:/run/grafana/web.sock" = { };
|
||||||
services.nginx.virtualHosts."${domain}".locations."/grafana" = {
|
services.nginx.virtualHosts."${domain}".locations."/grafana" = {
|
||||||
proxyPass = "http://localhost:3000";
|
proxyPass = "http://grafana";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue