close firewall on prometheus

This commit is contained in:
Philipp Hochkamp 2022-08-09 02:06:28 +02:00
parent 5c5202f4d7
commit 5b8e13008a
3 changed files with 9 additions and 11 deletions

View file

@ -3,14 +3,12 @@ hostname = "ds9"
ip = "100.83.96.25" # tailscale ip = "100.83.96.25" # tailscale
[hostOverrides] [hostOverrides]
wormhole = "10.0.0.1"
picard = "ragon.xyz"
#[exporters.nginx] [exporters.nginx]
#hosts = [ hosts = [
# "ds9", "ds9",
# "wormhole" "picard"
#] ]
[exporters.node] [exporters.node]
hosts = [ "ds9", "picard" ] hosts = [ "ds9", "picard" ]

View file

@ -70,7 +70,7 @@
"~(?P<ip>.*)" $ip; "~(?P<ip>.*)" $ip;
} }
log_format anonymized '$ip_anonymized - $remote_user [$time_local] ' log_format anonymized '$ip_anonymized - - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent ' '"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"'; '"$http_referer" "$http_user_agent"';

View file

@ -11,7 +11,7 @@ let
( (
if (builtins.elem y (builtins.attrNames cfg.hostOverrides)) if (builtins.elem y (builtins.attrNames cfg.hostOverrides))
then cfg.hostOverrides.${y} then cfg.hostOverrides.${y}
else "${y}.hailsatan.eu" else y
) )
); );
in in
@ -124,7 +124,7 @@ in
services.prometheus.exporters.nginxlog.settings = { services.prometheus.exporters.nginxlog.settings = {
namespaces = [{ namespaces = [{
name = "nginx"; name = "nginx";
format = "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\""; format = "$remote_addr - - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"";
source.files = [ "/var/log/nginx/access.log" ]; source.files = [ "/var/log/nginx/access.log" ];
}]; }];
}; };
@ -135,7 +135,7 @@ in
configuration = { configuration = {
server.http_listen_port = 28183; server.http_listen_port = 28183;
positions.filename = "/tmp/positions.yaml"; positions.filename = "/tmp/positions.yaml";
clients = [{ url = "http://${getHost cfg.master.hostname}:3100/loki/api/v1/push"; }]; clients = [{ url = "http://${cfg.master.ip}:3100/loki/api/v1/push"; }];
scrape_configs = [ scrape_configs = [
{ {
job_name = "journal"; job_name = "journal";