Skip to content

Commit

Permalink
updated network_aliases.json path
Browse files Browse the repository at this point in the history
 - 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.
  • Loading branch information
gustavo-iniguez-goya committed Dec 16, 2024
1 parent ed84394 commit 7d2ca8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions daemon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 7d2ca8d

Please sign in to comment.