// Copyright 2026 Moko Consulting <hello@mokoconsulting.tech>
// SPDX-License-Identifier: GPL-3.0-or-later

package setting

// Ntfy holds ntfy push notification settings.
var Ntfy = struct {
	Enabled      bool
	ServerURL    string
	DefaultTopic string
	Token        string
}{
	Enabled:      false,
	ServerURL:    "https://ntfy.mokoconsulting.tech",
	DefaultTopic: "mokogitea",
}

func loadNtfyFrom(cfg ConfigProvider) {
	sec := cfg.Section("ntfy")
	Ntfy.Enabled = sec.Key("ENABLED").MustBool(false)
	Ntfy.ServerURL = sec.Key("SERVER_URL").MustString(Ntfy.ServerURL)
	Ntfy.DefaultTopic = sec.Key("DEFAULT_TOPIC").MustString(Ntfy.DefaultTopic)
	Ntfy.Token = sec.Key("TOKEN").String()
}
