updated network_aliases.json path

- Load network_aliases.json by default from /etc/opensnitchd.
 - Don't exit if network_aliases.json doesn't exist.
 - Updated Makefile to install network aliases definitions.
This commit is contained in:
Gustavo Iñiguez Goia 2024-12-17 00:38:30 +01:00
parent ed84394dfc
commit 7d2ca8d039
Failed to generate hash of commit
2 changed files with 4 additions and 2 deletions

View file

@ -14,6 +14,8 @@ install:
-t $(DESTDIR)/etc/opensnitchd/
@install -Dm644 system-fw.json \
-t $(DESTDIR)/etc/opensnitchd/
@install -Dm644 network_aliases.json \
-t $(DESTDIR)/etc/opensnitchd/
@systemctl daemon-reload
opensnitchd: $(SRC)

View file

@ -64,7 +64,7 @@ var (
logMicro = false
rulesPath = ""
configFile = "/etc/opensnitchd/default-config.json"
aliasFile = "network_aliases.json"
aliasFile = "/etc/opensnitchd/network_aliases.json"
fwConfigFile = ""
ebpfModPath = "" // /usr/lib/opensnitchd/ebpf
noLiveReload = false
@ -579,7 +579,7 @@ func main() {
err := rule.LoadAliases(aliasFile)
if err != nil {
log.Fatal("Error loading network aliases: %v", err)
log.Warning("Error loading network aliases: %v", err)
}
log.Info("Loading network aliases from %s ...", aliasFile)