config: use /var/lib/dnswatcher as default data directory
All checks were successful
check / check (push) Successful in 46s

Change the default DATA_DIR from the relative path './data' to the
absolute path '/var/lib/dnswatcher', following the FHS convention for
application state data.

The default is derived from the application name passed to setupViper,
so it will always match /var/lib/<appname>.

Updated README environment variable table and .env example to reflect
the new default. Tests updated accordingly.
This commit is contained in:
user
2026-03-17 05:11:01 -07:00
parent b64db3e10f
commit b4f986a2e5
3 changed files with 5 additions and 5 deletions

View File

@@ -94,7 +94,7 @@ func setupViper(name string) {
viper.SetDefault("PORT", defaultPort)
viper.SetDefault("DEBUG", false)
viper.SetDefault("DATA_DIR", "./data")
viper.SetDefault("DATA_DIR", "/var/lib/"+name)
viper.SetDefault("TARGETS", "")
viper.SetDefault("SLACK_WEBHOOK", "")
viper.SetDefault("MATTERMOST_WEBHOOK", "")