box: add smtp config to grafana, allow access to psql dbs
This commit is contained in:
parent
da8e4b25eb
commit
8c3924d942
|
@ -1,22 +1,23 @@
|
|||
{ self, config, pkgs, ... }: {
|
||||
age.secrets.smtp_password.file = "${self}/secrets/nullhex-smtp.age";
|
||||
age.secrets.smtp_password.owner = "nobody";
|
||||
age.secrets.nullhex-smtp.file = "${self}/secrets/nullhex-smtp.age";
|
||||
age.secrets.nullhex-smtp.owner = "grafana";
|
||||
|
||||
# grafana configuration
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
smtp = {
|
||||
enabled = false;
|
||||
password = "$__file{/run/secrets/smtp_password}";
|
||||
enabled = true;
|
||||
password = "$__file{/run/agenix/nullhex-smtp}";
|
||||
host = "smtp.nullhex.com";
|
||||
user = "ops@sealight.xyz";
|
||||
from_address = "ops@sealight.xyz";
|
||||
};
|
||||
server = {
|
||||
domain = "stats.mossnet.lan";
|
||||
http_port = 2342;
|
||||
http_addr = "127.0.0.1";
|
||||
http_port = 2342;
|
||||
root_url = "http://stats.mossnet.lan/";
|
||||
};
|
||||
};
|
||||
# TODO enable
|
||||
|
@ -24,14 +25,25 @@
|
|||
};
|
||||
|
||||
# nginx reverse proxy
|
||||
services.nginx.recommendedProxySettings = true; # Needed for new grafana versions
|
||||
# services.nginx.recommendedProxySettings = true; # Needed for new grafana versions
|
||||
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.grafana.settings.server.http_port}";
|
||||
proxyPass = "http://127.0.0.1:2342";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
ensureUsers = [{
|
||||
name = "grafana";
|
||||
ensurePermissions = {
|
||||
"DATABASE wallabag" = "SELECT";
|
||||
"DATABASE ulogger" = "SELECT";
|
||||
"DATABASE photoprism" = "SELECT";
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 9001;
|
||||
|
|
Loading…
Reference in a new issue