From 05ed9f5375a63944b969e0ac4e396f2e96e0eea2 Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Tue, 17 Nov 2026 14:14:50 +0400 Subject: [PATCH] asxpio: route asxp.io and admin.asxp.io to the service on asxpio-services Priority 2000 over the container's labels until it is removed; admin.asxp.io keeps the internal-only allowlist (WireGuard + VPC). The failed-login alert and the Security dashboard count asxpio's routers by their new names, and the dashboard's Grafana panel by grafana@file, the name it has had since Grafana became a native service. Assisted-by: Claude:opus-5-5 --- .../hosts/asxpio-ops/monitoring/alert-rules.yaml | 2 +- .../monitoring/dashboards/Security/security.json | 4 ++-- nixos/hosts/asxpio-ops/traefik.nix | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/nixos/hosts/asxpio-ops/monitoring/alert-rules.yaml b/nixos/hosts/asxpio-ops/monitoring/alert-rules.yaml index 6c4ed76..b5a2364 100644 --- a/nixos/hosts/asxpio-ops/monitoring/alert-rules.yaml +++ b/nixos/hosts/asxpio-ops/monitoring/alert-rules.yaml @@ -534,7 +534,7 @@ groups: - refId: A relativeTimeRange: { from: 600, to: 0 } datasourceUid: loki - model: { refId: A, expr: "sum(count_over_time({job=\"traefik-access\"} |= `\"asxpio@docker\"` |~ `\"POST /admin/login HTTP/[0-9.]+\" (401|429) ` [10m]))", queryType: instant, intervalMs: 60000, maxDataPoints: 43200 } + model: { refId: A, expr: "sum(count_over_time({job=\"traefik-access\"} |~ `\"asxpio(-admin)?@file\"` |~ `\"POST /admin/login HTTP/[0-9.]+\" (401|429) ` [10m]))", queryType: instant, intervalMs: 60000, maxDataPoints: 43200 } - refId: C datasourceUid: __expr__ model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [4] } } ] } diff --git a/nixos/hosts/asxpio-ops/monitoring/dashboards/Security/security.json b/nixos/hosts/asxpio-ops/monitoring/dashboards/Security/security.json index 3e7fbe3..46b5d9a 100644 --- a/nixos/hosts/asxpio-ops/monitoring/dashboards/Security/security.json +++ b/nixos/hosts/asxpio-ops/monitoring/dashboards/Security/security.json @@ -2068,7 +2068,7 @@ "type": "loki", "uid": "loki" }, - "expr": "sum(count_over_time({job=\"traefik-access\"} |= `\"grafana@docker\"` |~ `\"POST /login HTTP/[0-9.]+\" 401 ` [$__interval]))", + "expr": "sum(count_over_time({job=\"traefik-access\"} |= `\"grafana@file\"` |~ `\"POST /login HTTP/[0-9.]+\" 401 ` [$__interval]))", "legendFormat": "Grafana", "refId": "B", "instant": false, @@ -2079,7 +2079,7 @@ "type": "loki", "uid": "loki" }, - "expr": "sum(count_over_time({job=\"traefik-access\"} |= `\"asxpio@docker\"` |~ `\"POST /admin/login HTTP/[0-9.]+\" (401|429) ` [$__interval]))", + "expr": "sum(count_over_time({job=\"traefik-access\"} |~ `\"asxpio(-admin)?@file\"` |~ `\"POST /admin/login HTTP/[0-9.]+\" (401|429) ` [$__interval]))", "legendFormat": "asxp.io admin", "refId": "C", "instant": false, diff --git a/nixos/hosts/asxpio-ops/traefik.nix b/nixos/hosts/asxpio-ops/traefik.nix index d750ba8..689f751 100644 --- a/nixos/hosts/asxpio-ops/traefik.nix +++ b/nixos/hosts/asxpio-ops/traefik.nix @@ -241,6 +241,21 @@ in ]; url = "http://10.10.0.20:3002"; }; + asxpio = { + hosts = [ + "asxp.io" + "www.asxp.io" + ]; + url = "http://10.10.0.20:3001"; + priority = 2000; # over the container's labels until it is removed + }; + # Superuser logins only work here (SUPERUSER_HOST): WireGuard + VPC + asxpio-admin = { + hosts = [ "admin.asxp.io" ]; + url = "http://10.10.0.20:3001"; + middlewares = [ "internal-only" ]; + priority = 2000; + }; }; users.users.traefik.extraGroups = [ "podman" ];