mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #1492] Allow loading WebPush secrets from private file #1053
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#1053
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 @ntninja on GitHub (Nov 20, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1492
💡 Idea
Similar to #590, it would be nice to have to ability to load WebPush secrects from file (preferable the file generated by
ntfy webpush keys). When using NTFY on NixOS there is otherwise no way to not make these keys world-readable.💻 Target components
ntfy server
@binwiederhier commented on GitHub (Feb 1, 2026):
I don't think I would want to implement this. The server.yml file can be easily made read-only by only the user that runs ntfy. There are many other secrets in the config file that would also need special handling.
@ntninja commented on GitHub (Feb 2, 2026):
With closing this, your saying that you won’t implement this or that you don't want anyone to implement this?
I was specifically talking about NixOS where the server configuration file is not managed by any user that run ntfy, it is managed by the Nix configuration system and that means, since it is stored as a build result in the local Nix store, it will always be world-readable.
Given this, may I instead propose adding “YAML includes” (not really a YAML thing) like GitLab CI/CD does: https://docs.gitlab.com/ci/yaml/includes/#include-a-single-configuration-file
That is: A top-level list key named
includethat will cause the referenced file paths to be read as YAML file and merged on top of the main configuration file.Conveniently, that than also happens to match the output of
ntfy webpush keys -f …, meaning you then just need to add the path of the generated web-push secrets file to the includes list.@binwiederhier commented on GitHub (Feb 2, 2026):
ntfy uses a CLI library that does not support this. And the entire thing also has to be supported for env variables. I wouldn't know how to. If you have a great idea how, supply a PR and it works for ALL the secrets, then I'll absolutely merge it if it isn't too hacky.
@ntninja commented on GitHub (Feb 2, 2026):
Ok, I just looked and the code to adapt for this right here:
github.com/binwiederhier/ntfy@68e22ebe7d/cmd/config_loader.go (L42-L60)Your loading the YAML file using a YAML parser, then match reach CLI flag to an option in the parsed YAML file.
Adaption would be to first check for item named
include, then open each path specified therein and also parse them as YAML, then perform the flag search for each opened YAML file in order.