From: Michael Tremer Date: Thu, 21 Aug 2025 14:49:47 +0000 (+0000) Subject: Dynamically replace the logging directory X-Git-Tag: 0.1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=318d255c0da5810fe18ec9ba639d958dfcb52fcf;p=suricata-reporter.git Dynamically replace the logging directory Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index b388025..6f0c75a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 $@) && \ diff --git a/src/suricata-report-generator.in b/src/suricata-report-generator.in index b253b40..7ee1125 100644 --- a/src/suricata-report-generator.in +++ b/src/suricata-report-generator.in @@ -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) diff --git a/src/suricata-reporter.in b/src/suricata-reporter.in index 38a2a9d..ec934b1 100644 --- a/src/suricata-reporter.in +++ b/src/suricata-reporter.in @@ -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)