feat(server): setup beszel for monitoring vps's.
This commit is contained in:
parent
9a8286e43b
commit
9a5b0770e2
4 changed files with 100 additions and 0 deletions
47
modules/servers/heimdall/beszel-hub.nix
Normal file
47
modules/servers/heimdall/beszel-hub.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{pkgs, ...}: {
|
||||
systemd.services.beszel-hub = {
|
||||
enable = true;
|
||||
description = "Beszel agent";
|
||||
after = ["network.target"];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
RestartSec = 3;
|
||||
User = "beszel";
|
||||
Group = "beszel";
|
||||
WorkingDirectory = "/var/lib/beszel";
|
||||
};
|
||||
|
||||
script = "${pkgs.beszel}/bin/beszel-hub serve --http '127.0.0.1:6789'";
|
||||
|
||||
wantedBy = ["multi-user.target"];
|
||||
};
|
||||
|
||||
users = {
|
||||
users.beszel = {
|
||||
isSystemUser = true;
|
||||
home = "/var/lib/beszel";
|
||||
createHome = true;
|
||||
group = "beszel";
|
||||
};
|
||||
groups.beszel = {};
|
||||
};
|
||||
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.beszel.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:6789";
|
||||
}
|
||||
];
|
||||
|
||||
routers.beszel = {
|
||||
rule = "Host(`beszel.cronyakatsuki.xyz`)";
|
||||
tls = {
|
||||
certResolver = "porkbun";
|
||||
};
|
||||
service = "beszel";
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue