2005
9216cbbf62
added logging to all nginx routes added loki, promtail to scrape nginx logs turned i2pd back on, updated my websites version upgraded all hosts to 24.05 forgejo added bigger limit to upload limit due to docker images privacy frontends: added priviblur libreddit -> redlib added biblioreads ddns-updater, changed credentials but there is a bug with porkbun added penpot brought back anonymousoverflow added readme privacy respecting frontends
52 lines
1.3 KiB
Nix
52 lines
1.3 KiB
Nix
{ pkgs, config, lib, ... }: {
|
|
|
|
|
|
networking.firewall = {
|
|
allowedTCPPorts = [ config.services.promtail.configuration.server.http_listen_port ];
|
|
allowedUDPPorts = [ config.services.promtail.configuration.server.http_listen_port ];
|
|
};
|
|
|
|
#$ var/ sudo setfacl -R -m u:promtail:rX log
|
|
#$ sudo chown promtail:promtail /tmp/positions.yaml
|
|
#$ sudo usermod -a -G systemd-journal promtail
|
|
# makeshift permission since promtail by default has no permission to read /var
|
|
|
|
services.promtail = {
|
|
enable = true;
|
|
configuration =
|
|
{
|
|
server = {
|
|
http_listen_port = 6177;
|
|
grpc_listen_port = 0;
|
|
log_level = "debug";
|
|
};
|
|
positions = {
|
|
filename = "/tmp/positions.yaml";
|
|
};
|
|
clients = [
|
|
{
|
|
url = "http://32.54.31.99:3100/loki/api/v1/push";
|
|
tenant_id = 1;
|
|
}
|
|
];
|
|
|
|
scrape_configs = [
|
|
{
|
|
job_name = "nginx";
|
|
static_configs = [
|
|
{
|
|
targets = [ "localhost" ];
|
|
labels = {
|
|
job = "nginx";
|
|
host = "carbon";
|
|
agent = "promtail";
|
|
__path__ = ''/var/log/nginx/*-access.log'';
|
|
};
|
|
}
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|