From: Michael Tremer Date: Wed, 24 Sep 2025 15:32:04 +0000 (+0000) Subject: generator: Open the database in read-only mode X-Git-Tag: 0.4~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=256fa384af38d949a0695db2e21e634acbee2ea6;p=suricata-reporter.git generator: Open the database in read-only mode The generator does not need to write to the database at all. Therefore we can tell the driver to open it in read-only mode to be able to generate reports from any user that is allowed to read from the database, but not write to it (i.e. the web UI). Signed-off-by: Michael Tremer --- diff --git a/src/suricata-report-generator.in b/src/suricata-report-generator.in index 6f88fd1..3a29253 100644 --- a/src/suricata-report-generator.in +++ b/src/suricata-report-generator.in @@ -75,7 +75,7 @@ class ReportGenerator(object): self.path = path # Open the database - self.db = sqlite3.connect(path) + self.db = sqlite3.connect("file://%s?mode=ro" % path, uri=True) self.db.row_factory = row_factory # Load a default stylesheet for our document