Radish alpha
r
rad:z254T5p17bdFPmzfDojsdjo4HjpoZ
Radicle Infrastructure as Code (NixOS, OpenTofu, …)
Radicle
Git
os/host/seed: Setup monitoring stack
erikli committed 10 months ago
commit 79599eeb71960370c4373856dca3a1f6a1c71660
parent e3f046b
3 files changed +61 -0
modified os/host/seed/default.nix
@@ -19,6 +19,8 @@
    ./ssh.nix
    ./tor.nix
    ./radicle.nix
+
    ./grafana.nix
+
    ./victorialogs.nix

    (modulesPath + "/profiles/qemu-guest.nix")
  ];
@@ -82,6 +84,7 @@
        22 # ssh
        80 # http
        443 # https
+
        3000 # grafana
        8776 # radicle-node
      ];

added os/host/seed/grafana.nix
@@ -0,0 +1,35 @@
+
{
+
  config,
+
  pkgs,
+
  ...
+
}: let
+
  domain = "grafana.radicle.xyz";
+
  port = 3000;
+
in {
+
  services = {
+
    grafana = {
+
      enable = true;
+
      settings = {
+
        server = {
+
          http_addr = "127.0.0.1";
+
          http_port = port;
+
          domain = domain;
+
        };
+
      };
+
    };
+

+
    nginx.virtualHosts.${domain} = {
+
      addSSL = true;
+
      enableACME = true;
+
      serverName = domain;
+
      locations."/" = {
+
        proxyPass = "http://127.0.0.1:${builtins.toString port}";
+
        extraConfig = ''
+
          client_max_body_size 512m;
+
          proxy_set_header Host ${domain};
+
          proxy_set_header Origin https://${domain};
+
        '';
+
      };
+
    };
+
  };
+
}
added os/host/seed/victorialogs.nix
@@ -0,0 +1,23 @@
+
{
+
  config,
+
  pkgs,
+
  systemSettings,
+
  userSettings,
+
  ...
+
}: {
+
  # Default port: 9428
+
  services = {
+
    victorialogs = {
+
      enable = true;
+
      extraOptions = [
+
        "-retentionPeriod=14d"
+
        "-journald.maxRequestSize=1024MB"
+
      ];
+
    };
+

+
    journald.upload = {
+
      enable = true;
+
      settings.Upload.URL = "http://localhost:9428/insert/journald";
+
    };
+
  };
+
}