@@ -18,6 +18,7 @@ import (
1818 "github.com/VersusControl/versus-incident/pkg/controllers"
1919 "github.com/VersusControl/versus-incident/pkg/core"
2020 "github.com/VersusControl/versus-incident/pkg/middleware"
21+ "github.com/VersusControl/versus-incident/pkg/report"
2122 "github.com/VersusControl/versus-incident/pkg/routes"
2223 "github.com/VersusControl/versus-incident/pkg/services"
2324 "github.com/VersusControl/versus-incident/pkg/storage"
@@ -58,13 +59,11 @@ func main() {
5859 MaxIncidents : cfg .Storage .Redis .MaxIncidents ,
5960 },
6061 Database : storage.DatabaseOptions {
61- Driver : cfg .Storage .Database .Driver ,
62- DSN : cfg .Storage .Database .DSN ,
63- MaxIncidents : cfg .Storage .Database .MaxIncidents ,
62+ Driver : cfg .Storage .Database .Driver ,
63+ DSN : cfg .Storage .Database .DSN ,
6464 },
6565 Postgres : storage.PostgresOptions {
66- DSN : cfg .Storage .Postgres .DSN ,
67- MaxIncidents : cfg .Storage .Postgres .MaxIncidents ,
66+ DSN : cfg .Storage .Postgres .DSN ,
6867 },
6968 })
7069 if err != nil {
@@ -76,6 +75,25 @@ func main() {
7675 // alert + record acks).
7776 services .SetStorage (store )
7877
78+ // Wire the incident-report feature (OSS default). The renderer is the
79+ // pure-Go in-binary PNG card renderer; an enterprise build may swap it
80+ // via services.SetReportRenderer behind the same core.ReportRenderer
81+ // seam. Installed unconditionally so report works for webhook incidents
82+ // even when the AI agent is disabled.
83+ if renderer , rerr := report .NewRenderer (); rerr != nil {
84+ log .Printf ("report: renderer unavailable: %v" , rerr )
85+ } else {
86+ services .SetReportRenderer (renderer )
87+ }
88+ // Reuse the operator-configured redaction rules so every text field on
89+ // the shared card is scrubbed (defence-in-depth: webhook Content is
90+ // attacker-influenced). Built here independent of agent.enable.
91+ reportRedactor , redErrs := agent .NewRedactor (cfg .Agent .Redaction .Enable && cfg .Agent .Redaction .RedactIPs , cfg .Agent .Redaction .ExtraPatterns )
92+ for _ , e := range redErrs {
93+ log .Printf ("report: redactor warning: %v" , e )
94+ }
95+ services .SetReportRedactor (reportRedactor )
96+
7997 // Initialize the operator-defined teams / members registry on the
8098 // same storage backend. Nil-tolerant: the controller responds with
8199 // 503 if construction failed, but a healthy boot wires it in.
0 commit comments