Closed bobemoe closed 1 month ago
It is mentioned briefly in the first paragraph of this section (https://docs.ntfy.sh/subscribe/cli/#install-configure), but the client CLI is only configured to look at /etc/ntfy/client.yml
for the root user. When the ntfy client CLI is run as a non-profit user, the CLI looks in ~/.config/ntfy/client.yml
.
You can tell the CLI to load a non-default config file by including it as a command line parameter: ntfy pub --config /etc/ntfy/client.yml test test
Ok, I was beginning to think it was expected behaviour. Your --config trick is useful but still a bit of a pain to implement for all users, I liked the idea of the CLI being simpler than curl where I have to include a -H Authorise... line. If I have to include a --config it is adding back a similar complexity.
Its not really the end of the world and I'm happy now I have the hang of it.
Maybe convert this to a feature request for a global "all users" config? Otherwise close as working.
Thanks.
It is expected that each user would have their own config (e.g., their own default server, their own default auth credentials, their own subscriptions, their own set of commands to run when a message is received, etc.). That's why, by default, the client CLI looks in the user's config directory.
If you want to easily use the /etc/ntfy/client.yml file, you can sudo ntfy pub test test
or you can set up a command alias/function in your terminal to automatically include "--config /etc/ntfy/client.yml" (but I recognize that is also something you'd need to do/configure for each individual user)
All good suggestions, thanks :)
:lady_beetle: Describe the bug
I have set
/etc/ntfy/client.yml
with a customdefault-host
anddefault-token
and when i run as rootntfy pub test test
it works just fine!The issue is when I run as a normal user it seems to be ignoring
/etc/ntfy/client.yml
and publishing tontfy.sh
rather than my custom server.I have confirmed my normal user can read
/etc/ntfy/client.yml
and that no~/.config/ntfy/client.yml
or ENV vars are overriding the config.Additionally I try to debug with --debug and --trace but these add no extra output.
It works if I:
But I dont want to have to do that for all users :/
:computer: Components impacted
Devuan Linux, server running in docker and client using static binaries. ntfy 2.11.0 (d11b100), runtime go1.22.2, built at 2024-05-13T20:16:12Z
:bulb: Screenshots and/or logs
:crystal_ball: Additional context