~xenrox/ntfy-alertmanager

a9fa7e4b230e75b2d1e1ffa020a65296fc2f4313 — Thorben Günther 10 months ago 3f545ef
config: Switch default values of alert mode and cache type

By default alerts will no longer be split apart and any caching
functionality will be disabled. With this the behaviour will be closer
to what the user has configured in Alertmanger/Prometheus itself.
2 files changed, 4 insertions(+), 4 deletions(-)

M README.md
M config/config.go
M README.md => README.md +2 -2
@@ 34,7 34,7 @@ http-address :8080
# Log level (either debug, info, warning, error)
log-level info
# When multiple alerts are grouped together by Alertmanager, they can either be sent
# each on their own (single mode) or be kept together (multi mode) (either single or multi; default is single)
# each on their own (single mode) or be kept together (multi mode) (either single or multi; default is multi)
alert-mode single
# Optionally protect with HTTP basic authentication
user webhookUser


@@ 104,7 104,7 @@ alertmanager {
# When the alert-mode is set to single, ntfy-alertmanager will cache each single alert
# to avoid sending recurrences.
cache {
    # The type of cache that will be used (either disabled, memory or redis; default is memory).
    # The type of cache that will be used (either disabled, memory or redis; default is disabled).
    type memory
    # How long messages stay in the cache for
    duration 24h

M config/config.go => config/config.go +2 -2
@@ 90,9 90,9 @@ func ReadConfig(path string) (*Config, error) {
	// Set default values
	config.HTTPAddress = "127.0.0.1:8080"
	config.LogLevel = "info"
	config.AlertMode = Single
	config.AlertMode = Multi

	config.Cache.Type = "memory"
	config.Cache.Type = "disabled"
	config.Cache.Duration = time.Hour * 24
	// memory
	config.Cache.CleanupInterval = time.Hour