disable grafana on vps

This commit is contained in:
Dmitriy Kholkin 2024-08-04 13:47:52 +03:00
parent 0404c0457a
commit 332e9f84bc
Signed by: AtaraxiaDev
GPG Key ID: FD266B810DF48DF2

View File

@ -21,7 +21,7 @@ in {
ports = { ports = {
allowedTCPPorts = [ allowedTCPPorts = [
config.services.blocky.settings.ports.dns config.services.blocky.settings.ports.dns
config.services.grafana.settings.server.http_port # config.services.grafana.settings.server.http_port
]; ];
allowedUDPPorts = [ allowedUDPPorts = [
config.services.blocky.settings.ports.dns config.services.blocky.settings.ports.dns
@ -118,6 +118,9 @@ in {
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
startAt = "weekly"; startAt = "weekly";
}; };
# systemd.services.unbound = {
# after = [ "root-hints.service" ];
# };
# Blocky + prometheus + grafana # Blocky + prometheus + grafana
services.blocky = { services.blocky = {
enable = true; enable = true;
@ -160,72 +163,72 @@ in {
}; };
}; };
}; };
services.prometheus = { # services.prometheus = {
enable = true; # enable = true;
listenAddress = "127.0.0.1"; # listenAddress = "127.0.0.1";
globalConfig.scrape_interval = "15s"; # globalConfig.scrape_interval = "15s";
globalConfig.evaluation_interval = "15s"; # globalConfig.evaluation_interval = "15s";
scrapeConfigs = [{ # scrapeConfigs = [{
job_name = "blocky"; # job_name = "blocky";
static_configs = [{ # static_configs = [{
targets = [ config.services.blocky.settings.ports.http ]; # targets = [ config.services.blocky.settings.ports.http ];
}]; # }];
}]; # }];
}; # };
services.grafana = { # services.grafana = {
enable = true; # enable = true;
settings = { # settings = {
analytics.reporting_enabled = false; # analytics.reporting_enabled = false;
server = { # server = {
enable_gzip = true; # enable_gzip = true;
domain = "localhost"; # domain = "localhost";
http_addr = "0.0.0.0"; # http_addr = "0.0.0.0";
http_port = 3000; # http_port = 3000;
}; # };
# Grafana can be accessed only through wireguard, so it's secure enough # # Grafana can be accessed only through wireguard, so it's secure enough
security = { # security = {
admin_user = "admin"; # admin_user = "admin";
admin_password = "admin"; # admin_password = "admin";
}; # };
panels.disable_sanitize_html = true; # panels.disable_sanitize_html = true;
}; # };
provision = { # provision = {
enable = true; # enable = true;
datasources.settings = { # datasources.settings = {
datasources = [{ # datasources = [{
name = "Prometheus"; # name = "Prometheus";
type = "prometheus"; # type = "prometheus";
access = "proxy"; # access = "proxy";
orgId = 1; # orgId = 1;
uid = "Y4SSG429DWCGDQ3R"; # uid = "Y4SSG429DWCGDQ3R";
url = "http://127.0.0.1:${toString config.services.prometheus.port}"; # url = "http://127.0.0.1:${toString config.services.prometheus.port}";
isDefault = true; # isDefault = true;
jsonData = { # jsonData = {
graphiteVersion = "1.1"; # graphiteVersion = "1.1";
tlsAuth = false; # tlsAuth = false;
tlsAuthWithCACert = false; # tlsAuthWithCACert = false;
}; # };
version = 1; # version = 1;
editable = true; # editable = true;
}]; # }];
}; # };
dashboards = { # dashboards = {
settings = { # settings = {
providers = [{ # providers = [{
name = "My Dashboards"; # name = "My Dashboards";
options.path = "/etc/grafana-dashboards"; # options.path = "/etc/grafana-dashboards";
}]; # }];
}; # };
}; # };
}; # };
}; # };
environment.etc = { # environment.etc = {
"grafana-dashboards/blocky_rev3.json" = { # "grafana-dashboards/blocky_rev3.json" = {
source = ../../../misc/grafana_blocky_rev3.json; # source = ../../../misc/grafana_blocky_rev3.json;
group = "grafana"; # group = "grafana";
user = "grafana"; # user = "grafana";
}; # };
}; # };
persist.state.directories = [ persist.state.directories = [
"/var/lib/grafana" "/var/lib/grafana"