Move client config file logic, docs

This commit is contained in:
binwiederhier
2026-01-17 17:51:33 -05:00
parent 353fedb93f
commit 220372d65a
10 changed files with 79 additions and 157 deletions

18
client/config_unix.go Normal file
View File

@@ -0,0 +1,18 @@
//go:build linux || dragonfly || freebsd || netbsd || openbsd
package client
import (
"os"
"os/user"
"path/filepath"
)
func init() {
u, err := user.Current()
if err == nil && u.Uid == "0" {
DefaultConfigFile = "/etc/ntfy/client.yml"
} else if configDir, err := os.UserConfigDir(); err == nil {
DefaultConfigFile = filepath.Join(configDir, "ntfy", "client.yml")
}
}