Compare commits
1 Commits
feature/62
...
fix/88-abs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4f986a2e5 |
@@ -219,7 +219,7 @@ the following precedence (highest to lowest):
|
|||||||
|---------------------------------|--------------------------------------------|-------------|
|
|---------------------------------|--------------------------------------------|-------------|
|
||||||
| `PORT` | HTTP listen port | `8080` |
|
| `PORT` | HTTP listen port | `8080` |
|
||||||
| `DNSWATCHER_DEBUG` | Enable debug logging | `false` |
|
| `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_TARGETS` | Comma-separated DNS names (auto-classified via PSL) | `""` |
|
||||||
| `DNSWATCHER_SLACK_WEBHOOK` | Slack incoming webhook URL | `""` |
|
| `DNSWATCHER_SLACK_WEBHOOK` | Slack incoming webhook URL | `""` |
|
||||||
| `DNSWATCHER_MATTERMOST_WEBHOOK` | Mattermost incoming webhook URL | `""` |
|
| `DNSWATCHER_MATTERMOST_WEBHOOK` | Mattermost incoming webhook URL | `""` |
|
||||||
@@ -244,7 +244,7 @@ list of DNS names before starting.
|
|||||||
```sh
|
```sh
|
||||||
PORT=8080
|
PORT=8080
|
||||||
DNSWATCHER_DEBUG=false
|
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_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_SLACK_WEBHOOK=https://hooks.slack.com/services/T.../B.../xxx
|
||||||
DNSWATCHER_MATTERMOST_WEBHOOK=https://mattermost.example.com/hooks/xxx
|
DNSWATCHER_MATTERMOST_WEBHOOK=https://mattermost.example.com/hooks/xxx
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ func setupViper(name string) {
|
|||||||
|
|
||||||
viper.SetDefault("PORT", defaultPort)
|
viper.SetDefault("PORT", defaultPort)
|
||||||
viper.SetDefault("DEBUG", false)
|
viper.SetDefault("DEBUG", false)
|
||||||
viper.SetDefault("DATA_DIR", "./data")
|
viper.SetDefault("DATA_DIR", "/var/lib/"+name)
|
||||||
viper.SetDefault("TARGETS", "")
|
viper.SetDefault("TARGETS", "")
|
||||||
viper.SetDefault("SLACK_WEBHOOK", "")
|
viper.SetDefault("SLACK_WEBHOOK", "")
|
||||||
viper.SetDefault("MATTERMOST_WEBHOOK", "")
|
viper.SetDefault("MATTERMOST_WEBHOOK", "")
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ func TestNew_DefaultValues(t *testing.T) {
|
|||||||
|
|
||||||
assert.Equal(t, 8080, cfg.Port)
|
assert.Equal(t, 8080, cfg.Port)
|
||||||
assert.False(t, cfg.Debug)
|
assert.False(t, cfg.Debug)
|
||||||
assert.Equal(t, "./data", cfg.DataDir)
|
assert.Equal(t, "/var/lib/dnswatcher", cfg.DataDir)
|
||||||
assert.Equal(t, time.Hour, cfg.DNSInterval)
|
assert.Equal(t, time.Hour, cfg.DNSInterval)
|
||||||
assert.Equal(t, 12*time.Hour, cfg.TLSInterval)
|
assert.Equal(t, 12*time.Hour, cfg.TLSInterval)
|
||||||
assert.Equal(t, 7, cfg.TLSExpiryWarning)
|
assert.Equal(t, 7, cfg.TLSExpiryWarning)
|
||||||
@@ -245,7 +245,7 @@ func TestStatePath(t *testing.T) {
|
|||||||
dataDir string
|
dataDir string
|
||||||
want string
|
want string
|
||||||
}{
|
}{
|
||||||
{"default", "./data", "./data/state.json"},
|
{"default", "/var/lib/dnswatcher", "/var/lib/dnswatcher/state.json"},
|
||||||
{"absolute", "/var/lib/dw", "/var/lib/dw/state.json"},
|
{"absolute", "/var/lib/dw", "/var/lib/dw/state.json"},
|
||||||
{"nested", "/opt/app/data", "/opt/app/data/state.json"},
|
{"nested", "/opt/app/data", "/opt/app/data/state.json"},
|
||||||
{"empty", "", "/state.json"},
|
{"empty", "", "/state.json"},
|
||||||
|
|||||||
Reference in New Issue
Block a user