Add token auth for ntfy hook #811

Closed
opened 2024-01-08 08:31:11 +00:00 by melsophos · 4 comments

What I'd like to do and why

On a private server, ntfy recommends using authentication with tokens instead of user and password, so I was wondering if it would be possible to add this option?
Moreover, it would be useful if the script could get the default server and token (or username/pwd) from the client.yml files:

~/.config/ntfy/client.yml
/etc/ntfy/client.yml

Other notes / implementation ideas

No response

### What I'd like to do and why On a private server, ntfy recommends using authentication with tokens instead of user and password, so I was wondering if it would be possible to add this option? Moreover, it would be useful if the script could get the default server and token (or username/pwd) from the `client.yml` files: ``` ~/.config/ntfy/client.yml /etc/ntfy/client.yml ``` ### Other notes / implementation ideas _No response_
Owner

Using authentication tokens with ntfy makes sense to me. I'm not sure about client.yml though because borgmatic doesn't use the ntfy client, so it'd be a little weird to use its configuration file. Additionally, that configuration file wouldn't be covered by borgmatic's bootstrapping. Is the idea that you just don't want to maintain the ntfy authentication token in two different places?

Using authentication tokens with ntfy makes sense to me. I'm not sure about `client.yml` though because borgmatic doesn't use the ntfy client, so it'd be a little weird to use its configuration file. Additionally, that configuration file wouldn't be covered by [borgmatic's bootstrapping](https://torsion.org/borgmatic/docs/how-to/extract-a-backup/#extract-the-configuration-files-used-to-create-an-archive). Is the idea that you just don't want to maintain the ntfy authentication token in two different places?
Author

My motivation for using client.yml to avoid writing the token if for limiting the risk of exposing its value. But I just understood that one can create different tokens for a single user, so in this case one can create a token for borgmatic only, and revoke it if compromised. Also you have an excellent point with the bootstrapping.

My motivation for using `client.yml` to avoid writing the token if for limiting the risk of exposing its value. But I just understood that one can create different tokens for a single user, so in this case one can create a token for borgmatic only, and revoke it if compromised. Also you have an excellent point with the bootstrapping.
Owner

This has been implemented in main (as a new access_token option) and will be part of the next release! Thanks for the suggestion.

This has been implemented in main (as a new `access_token` option) and will be part of the next release! Thanks for the suggestion.
Owner

Released in borgmatic 1.8.9!

Released in borgmatic 1.8.9!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
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: borgmatic-collective/borgmatic#811
No description provided.