]> git.ipfire.org Git - suricata-reporter.git/commitdiff
Dynamically replace the logging directory
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 21 Aug 2025 14:49:47 +0000 (14:49 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 21 Aug 2025 14:49:47 +0000 (14:49 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/suricata-report-generator.in
src/suricata-reporter.in

index b3880257b314dfc344053386a1244a811bf3c1e3..6f0c75a8fccad34fb45c2ab93bbf0ff7c920ce07 100644 (file)
@@ -33,6 +33,8 @@ SUBDIRS = . po
 CLEANFILES =
 EXTRA_DIST =
 
+suricatalogdir = $(localstatedir)/log/suricata
+
 @INTLTOOL_POLICY_RULE@
 
 .PHONY: update-po
@@ -77,7 +79,8 @@ substitutions = \
        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
        '|PYTHON=$(PYTHON)|' \
        '|bindir=$(bindir)|' \
-       '|sysconfdir=$(sysconfdir)|'
+       '|sysconfdir=$(sysconfdir)|' \
+       '|suricatalogdir=$(suricatalogdir)|'
 
 SED_PROCESS = \
        $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
index b253b40f5a2afd7a1344328347df68e2eb9b71b8..7ee11257eaaef0218ed1bcdc23f77d7e541bc59f 100644 (file)
@@ -426,7 +426,7 @@ def main():
        # Command Line Arguments
        parser.add_argument("--verbose", "-v", action="count", help="Be more verbose")
        parser.add_argument("--database", help="Database",
-               default="/var/log/suricata/reporter.db")
+               default="@suricatalogdir@/reporter.db")
 
        # Require some output parameters
        group = parser.add_mutually_exclusive_group(required=True)
index 38a2a9da5f63f90e4913aff24f43542f9552b46b..ec934b147acdcdace403b0d47e70ea03fe6ceb5e 100644 (file)
@@ -282,7 +282,7 @@ class Worker(multiprocessing.Process):
                """
                # Fetch the path
                path = self.config.get("DEFAULT", "database",
-                       fallback="/var/log/suricata/reporter.db")
+                       fallback="@suricatalogdir@/reporter.db")
 
                # Open the database
                db = sqlite3.connect(path)