mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #1192] config ignored for non-root users, no debug output!? #840
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#840
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bobemoe on GitHub (Sep 30, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1192
🐞 Describe the bug
I have set
/etc/ntfy/client.ymlwith a customdefault-hostanddefault-tokenand when i run as rootntfy pub test testit works just fine!The issue is when I run as a normal user it seems to be ignoring
/etc/ntfy/client.ymland publishing tontfy.shrather than my custom server.I have confirmed my normal user can read
/etc/ntfy/client.ymland that no~/.config/ntfy/client.ymlor 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 :/
💻 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💡 Screenshots and/or logs
🔮 Additional context
@wunter8 commented on GitHub (Sep 30, 2024):
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.ymlfor 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@bobemoe commented on GitHub (Sep 30, 2024):
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.
@wunter8 commented on GitHub (Sep 30, 2024):
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 testor 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)@bobemoe commented on GitHub (Oct 1, 2024):
All good suggestions, thanks :)