[GH-ISSUE #255] YAML variables shouldn't use dashes #201

Closed
opened 2026-05-07 00:21:22 +02:00 by BreizhHardware · 3 comments

Originally created by @ajdelgado on GitHub (May 15, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/255

Hi,
The YAML specification defines a dash as a special character and can't be used for variables. This makes the configuration file for ntfy not complaint causing first an issue to check correct syntax but in my case an issue creating an Ansible Role. what could be a simple YAML2YAML process needs translation to set the dashes.
I guess the easier solution for the community would be allowing defining with dashes or underscores for a while, and deprecating the dashes at some point.
Maybe this should be a new feature request, but it actually breaks tests.

Originally created by @ajdelgado on GitHub (May 15, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/255 Hi, The YAML specification defines a dash as a special character and can't be used for variables. This makes the configuration file for ntfy not complaint causing first an issue to check correct syntax but in my case an issue creating an Ansible Role. what could be a simple YAML2YAML process needs translation to set the dashes. I guess the easier solution for the community would be allowing defining with dashes or underscores for a while, and deprecating the dashes at some point. Maybe this should be a new feature request, but it actually breaks tests.
Author
Owner

@binwiederhier commented on GitHub (May 16, 2022):

Thank you for using ntfy and for reporting this. Well that's a bummer with the config options. I'm using the urfave/cli library and it does all the config loading for me. It's using the config options as CLI options and config file options, which is why _ are kind of ugly. Maybe I could just make it support both. Aliases are already supported by the library. Could be a super simple ticket.

In the meantime, you could probably use environment variables in Ansible, no?

<!-- gh-comment-id:1127100338 --> @binwiederhier commented on GitHub (May 16, 2022): Thank you for using ntfy and for reporting this. Well that's a bummer with the config options. I'm using the urfave/cli library and it does all the config loading for me. It's using the config options as CLI options and config file options, which is why _ are kind of ugly. Maybe I could just make it support both. Aliases are already supported by the library. Could be a super simple ticket. In the meantime, you could probably use environment variables in Ansible, no?
Author
Owner

@binwiederhier commented on GitHub (May 16, 2022):

Reference: https://github.com/binwiederhier/ntfy/blob/main/cmd/serve_linux.go#L22

<!-- gh-comment-id:1127100572 --> @binwiederhier commented on GitHub (May 16, 2022): Reference: https://github.com/binwiederhier/ntfy/blob/main/cmd/serve_linux.go#L22
Author
Owner

@binwiederhier commented on GitHub (May 16, 2022):

This is done in github.com/binwiederhier/ntfy@91594faf28 and will be in the next release. Thank you for reporting @ajdelgado.

<!-- gh-comment-id:1128010206 --> @binwiederhier commented on GitHub (May 16, 2022): This is done in https://github.com/binwiederhier/ntfy/commit/91594faf288d13bd128067436e11345dc7a9d583 and will be in the next release. Thank you for reporting @ajdelgado.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#201
No description provided.