rudimentary grafana addition. Missing data sources, no clue how to get those.

This commit is contained in:
Grimmauld 2023-12-30 10:01:06 +00:00
parent d34dee84bd
commit 6eac33cc22
8 changed files with 89 additions and 0 deletions

View File

@ -28,6 +28,7 @@
./modules/matrix.nix ./modules/matrix.nix
./modules/puffer.nix ./modules/puffer.nix
./modules/gitea.nix ./modules/gitea.nix
./modules/grafana.nix
./modules/letsencrypt.nix ./modules/letsencrypt.nix
./modules/fail2ban.nix ./modules/fail2ban.nix
./modules/email.nix ./modules/email.nix

View File

@ -18,6 +18,9 @@ in {
hashedPasswordFile = ./mailpass/contact; hashedPasswordFile = ./mailpass/contact;
aliases = ["kontakt@${root_host}"]; aliases = ["kontakt@${root_host}"];
}; };
"admin@${root_host}" = {
hashedPasswordFile = ./mailpass/admin;
};
}; };
# Use Let's Encrypt certificates. Note that this needs to set up a stripped # Use Let's Encrypt certificates. Note that this needs to set up a stripped

40
modules/grafana.nix Normal file
View File

@ -0,0 +1,40 @@
{ config, ... }:
let
root_host = "grimmauld.de";
grafana_host = "grafana.${root_host}";
grafana_port = 8082;
in {
age.secrets.grafana_admin_pass = {
file = ../secrets/grafana_admin_pass.age;
owner = "grafana";
group = "grafana";
mode = "0600";
};
security.acme.certs."${root_host}".extraDomainNames = [ grafana_host ];
services.grafana = {
enable = true;
settings = {
security = {
admin_user = "admin";
admin_email = "admin@${root_host}";
admin_password = "$__file{${config.age.secrets.grafana_admin_pass.path}}";
};
server = {
http_port = grafana_port;
};
};
};
services.nginx = {
enable = true;
virtualHosts."${grafana_host}" = {
serverName = grafana_host;
forceSSL = true;
useACMEHost = root_host;
locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString config.services.grafana.settings.server.http_port}";
};
};
};
}

1
modules/mailpass/admin Normal file
View File

@ -0,0 +1 @@
$2b$05$9E2phVa/06fZW3daV3CeYuLTCLcBBDY7xF5TOpeHdCBGU5yNemBgy

View File

@ -57,15 +57,18 @@ host replication all ::1/128 md5
workers.normalSyncers = 1; workers.normalSyncers = 1;
workers.eventPersisters = 2; workers.eventPersisters = 2;
workers.useUserDirectoryWorker = true; workers.useUserDirectoryWorker = true;
mainLogConfig = ./matrix_synapse_log_config.yaml;
enableNginx = true; enableNginx = true;
enableSlidingSync = false; enableSlidingSync = false;
settings = { settings = {
suppress_key_server_warning = true;
server_name = root_host; server_name = root_host;
public_baseurl = "https://${root_host}"; public_baseurl = "https://${root_host}";
enable_registration = false; enable_registration = false;
enable_registration_without_verification = true; enable_registration_without_verification = true;
# mainLogConfig = ./matrix_synapse_log_config.yaml;
# registrations_require_3pid = [ "email" ]; # registrations_require_3pid = [ "email" ];
database = { database = {

View File

@ -0,0 +1,25 @@
version: 1
# In systemd's journal, loglevel is implicitly stored, so let's omit it
# from the message text.
formatters:
journal_fmt:
format: '%(name)s: [%(request)s] %(message)s'
filters:
context:
(): synapse.util.logcontext.LoggingContextFilter
request: ""
handlers:
journal:
class: systemd.journal.JournalHandler
formatter: journal_fmt
filters: [context]
SYSLOG_IDENTIFIER: synapse
root:
level: WARNING
handlers: [journal]
disable_existing_loggers: False

View File

@ -0,0 +1,15 @@
age-encryption.org/v1
-> ssh-rsa jWbwAg
ieBCGzdQNeFiy2vjh2SbQz2jM9SFsqESvydY3ok681KYIBZKhw0FkQQPADCJElnM
L0XxLSXkOB2l3hhie5i+O3iSHKlXAwPvbfxUcsZmDgV9F9MJtdqrDWrp8qpnIzau
qsecyM28o37laD0hr+Zt6nG8QWPDmSBnNfVfdflYUkMQCPaNHrMa0+XQqABAJ7mi
PssjYLHkVJzPTi4p0bYkewkBS45gsp7j6DlF2Gg5Ce+l2FxB+RWc5Pl8mp76IntR
Vxm8gaGXG667IjwFqfxhsIbygyIZ2SX38GUJbtn3Is0aSOQCZtSkdLTkrjFtB+LP
FUfvvqkPKC5ttQm6lkODrMo3Ai0VfT6kCo/F52A0T5mkrF5jVCQdeqo92zBPWI6S
Um93uNLFmQ+OIDNnSVZKO0znpw6Vq9N7Q7LUPG1etRasnH5agMzBVlAeotbvD9Y/
Y6jLOB7aTruX4Snw83WF8J4jjzr6MYG71wQ/0aGOA5EfS/njrWRT6PSgVERny/WW
h/TaVV+Zw7vm7kw4cxSmnwcnvpst2W4Xg2hulj2MPO0OXlXPvIuIg68Olcctclox
HR2BKjDDQ+9jScu0cQcYIsnXuJ5JillpETtYI5Z4AGmKLj0rqXxrZDmjr0WKE5AE
qlbOw6/Jpn5vtmS4qEuSnbK11vhm4EWN/tv0Zz7KShM
--- yNCRCxrMUj+Kx54kwJ0Tq3X/QmxRi3eUcDCIkAtnrk8
~‰E~ß}IÝR9•<39>â*·\™frèÿyÅUw¤BÔ 1<>!¨ÝÞã÷ðtez“yxX¾W<øs!ëÛ

View File

@ -6,4 +6,5 @@ in
# "duckdns_token.age".publicKeys = [ contabo_nix_pub ]; # "duckdns_token.age".publicKeys = [ contabo_nix_pub ];
"synapse_db_pass.age".publicKeys = [ contabo_nix_pub ]; "synapse_db_pass.age".publicKeys = [ contabo_nix_pub ];
"synapse_db_pass_prepared.age".publicKeys = [ contabo_nix_pub ]; "synapse_db_pass_prepared.age".publicKeys = [ contabo_nix_pub ];
"grafana_admin_pass".publicKeys = [ contabo_nix_pub ];
} }