feat: enable n8n AI assistant AZ-PRM-1

This commit is contained in:
2026-09-08 10:45:26 +02:00
parent 1772ab207e
commit ef563f1ce1
13 changed files with 887 additions and 744 deletions
+42 -1
View File
@@ -8,6 +8,15 @@
staticPort = config.m3ta.ports.get "netbox-static";
hostName = "nb.l.az-gruppe.com";
staticRoot = "${config.services.netbox.dataDir}/static";
# nixpkgs >= 25.11: Plugin-Pakete liegen im passthru-Set netbox.plugins
# (python3Packages.netbox-* sind Throw-Stubs); pluginName = NetBox-Modulname
netboxPlugins = with pkgs.unstable.netbox.plugins; [
netbox-dns
netbox-qrcode
netbox-routing
netbox-topology-views
netbox-floorplan-plugin
];
in {
services.netbox = {
enable = true;
@@ -22,13 +31,45 @@ in {
SECURE_SSL_REDIRECT = true;
SESSION_COOKIE_SECURE = true;
CSRF_COOKIE_SECURE = true;
# NetBox aktiviert Plugins erst über PLUGINS in configuration.py —
# der NixOS-NetBox-Modul trägt sie NICHT automatisch ein.
PLUGINS = map (p: p.pluginName) netboxPlugins;
};
# installiert die Pakete in NetBox' Python-Environment (extraBuildInputs)
plugins = _: netboxPlugins;
extraConfig = ''
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
'';
};
# Der Upgrade-Guard im NetBox-Modul (preStart) vergleicht /var/lib/netbox/version
# nur mit dem BASISPAKET (services.netbox.package). Reine Config-/Plugin-
# Änderungen bei gleicher NetBox-Version überspringen damit migrate +
# collectstatic → Plugin-Tabellen fehlen ("database migration missing").
# Deshalb Migrationen/Statics hier VOR jedem netbox.service-Start ausführen
# (idempotent, entspricht dem offiziellen NetBox-Upgrade-Pfad):
systemd.services.netbox = {
wants = ["netbox-migrate.service"];
after = ["netbox-migrate.service"];
};
systemd.services.netbox-migrate = {
description = "NetBox: DB-Migrationen & Statics (v. a. Plugins)";
wants = ["network-online.target"];
after = ["network-online.target" "postgresql.service" "redis-netbox.service"];
serviceConfig = {
Type = "oneshot";
User = "netbox";
Group = "netbox";
StateDirectory = "netbox";
TimeoutStartSec = "10min";
};
script = ''
/run/current-system/sw/bin/netbox-manage migrate --no-input
/run/current-system/sw/bin/netbox-manage collectstatic --no-input
'';
};
services.nginx = {
enable = true;
virtualHosts.netbox-static = {