mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 17:20:13 +00:00
switch to netdata cloud
fix performance issues with caddy mostly
This commit is contained in:
@ -1,42 +1,13 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options = {
|
||||
metricsServer = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for Metrics server";
|
||||
};
|
||||
metricsPasswordHashed = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Metrics password hashed with `caddy hash-password`";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [ ./caddy.nix ];
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = {
|
||||
|
||||
services.netdata.enable = true;
|
||||
services.netdata = {
|
||||
enable = true;
|
||||
|
||||
caddyRoutes = [{
|
||||
match = [{ host = [ config.metricsServer ]; }];
|
||||
handle = [
|
||||
{
|
||||
handler = "authentication";
|
||||
providers = {
|
||||
http_basic = {
|
||||
accounts = [{
|
||||
username = config.user;
|
||||
password = config.metricsPasswordHashed;
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:19999"; }];
|
||||
}
|
||||
];
|
||||
}];
|
||||
# Disable local dashboard (unsecured)
|
||||
config = { web.mode = "none"; };
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
@ -146,10 +146,7 @@ in {
|
||||
systemd.services.litestream-s3 = {
|
||||
requiredBy = [ "litestream.service" ];
|
||||
before = [ "litestream.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
serviceConfig = { Type = "oneshot"; };
|
||||
script = ''
|
||||
echo \
|
||||
LITESTREAM_SECRET_ACCESS_KEY=$(${pkgs.age}/bin/age --decrypt \
|
||||
|
Reference in New Issue
Block a user