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

@@ -219,7 +219,7 @@ the following precedence (highest to lowest):
|---------------------------------|--------------------------------------------|-------------|
| `PORT` | HTTP listen port | `8080` |
| `DNSWATCHER_DEBUG` | Enable debug logging | `false` |
| `DNSWATCHER_DATA_DIR` | Directory for state file | `./data` |
| `DNSWATCHER_DATA_DIR` | Directory for state file | `/var/lib/dnswatcher` |
| `DNSWATCHER_TARGETS` | Comma-separated DNS names (auto-classified via PSL) | `""` |
| `DNSWATCHER_SLACK_WEBHOOK` | Slack incoming webhook URL | `""` |
| `DNSWATCHER_MATTERMOST_WEBHOOK` | Mattermost incoming webhook URL | `""` |
@@ -244,7 +244,7 @@ list of DNS names before starting.
```sh
PORT=8080
DNSWATCHER_DEBUG=false
DNSWATCHER_DATA_DIR=./data
DNSWATCHER_DATA_DIR=/var/lib/dnswatcher
DNSWATCHER_TARGETS=example.com,example.org,www.example.com,api.example.com,mail.example.org
DNSWATCHER_SLACK_WEBHOOK=https://hooks.slack.com/services/T.../B.../xxx
DNSWATCHER_MATTERMOST_WEBHOOK=https://mattermost.example.com/hooks/xxx