Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification of IP changes and errors #532

Closed
obstrux opened this issue Jun 19, 2023 · 23 comments
Closed

Notification of IP changes and errors #532

obstrux opened this issue Jun 19, 2023 · 23 comments
Labels
enhancement New feature or request
Milestone

Comments

@obstrux
Copy link

obstrux commented Jun 19, 2023

Ex. Email

@favonia
Copy link
Owner

favonia commented Jun 19, 2023

@alipay404 Thanks for the feedback. You can set up Healthchecks and put the ping URL into HEALTHCHECKS. This way, you can receive emails (or SMS messages, etc.) when there's an error. If you are looking for something else, please let me know. 🙂

@obstrux
Copy link
Author

obstrux commented Jun 21, 2023

@alipay404 Thanks for the feedback. You can set up Healthchecks and put the ping URL into HEALTHCHECKS. This way, you can receive emails (or SMS messages, etc.) when there's an error. If you are looking for something else, please let me know. 🙂

Thanks

@favonia favonia closed this as completed Jun 21, 2023
@obstrux
Copy link
Author

obstrux commented Jun 21, 2023

@alipay404 Thanks for the feedback. You can set up Healthchecks and put the ping URL into HEALTHCHECKS. This way, you can receive emails (or SMS messages, etc.) when there's an error. If you are looking for something else, please let me know. 🙂

How do I get an IP change

@favonia
Copy link
Owner

favonia commented Jun 21, 2023

@alipay404 The current design does not notify you of IP changes because that's not an "error." (It's working as expected.) Let me re-open this issue because you seem to be requesting a new feature.

@favonia favonia reopened this Jun 21, 2023
@favonia
Copy link
Owner

favonia commented Jun 21, 2023

@alipay404 Hi, because you are asking for a new feature, I wonder if you could possibly provide more details. In particular, when do you want to receive notifications and what should be the messages? If you have seen this feature in another product, I can take a look. tl;dr: I need more details.

@favonia
Copy link
Owner

favonia commented Jun 29, 2023

@alipay404 I checked GoDNS and they only mentioned "IP changes". Do you also want to get notifications when something's wrong (e.g., when the updater fails to get the public IP)? Also, do you have a preference between webhooks (you specify the URL and the content) and something like shoutrrr (which might increase the image size but offers direct support of many services)? It is not difficult to implement any of these but I want to implement something that addresses your need (if I choose to implement it after checking the technical detail). 😀

@bartclone if you are willing, any input will be helpful to move this issue forward. Thanks!

@favonia favonia added enhancement New feature or request design? The next step is to reflect upon the information and come up with a good design labels Jun 29, 2023
@bartclone
Copy link

@bartclone if you are willing, any input will be helpful to move this issue forward. Thanks!

Sure. A IP change could have effects, that an user wants to be notified of.
So, yes, an interface to a [notification API service] like shoutrr, or Apprise / its API would be nice.

@favonia
Copy link
Owner

favonia commented Jun 30, 2023

A IP change could have effects, that an user wants to be notified of.

@bartclone Thanks for the feedback. Do you want to get notifications when something went wrong (e.g., not being able to get the IP)?

PS: I would like to check how large the images would be after linking shoutrrr.

@bartclone
Copy link

A IP change could have effects, that an user wants to be notified of.

@bartclone Thanks for the feedback. Do you want to get notifications when something went wrong (e.g., not being able to get the IP)?

PS: I would like to check how large the images would be after linking shoutrrr.

Maybe introduce a debug level 1-6, to control which messages are sent out?
Like

  • not getting an IP : level Fatal
  • which IP is used: Info

@favonia
Copy link
Owner

favonia commented Jul 3, 2023

@bartclone Thanks for the suggestion. The internal logging system already has levels. However, the logs are only optimized for the terminal view and are imperfect for notifications. (E.g., some messages are intentionally split into multiple lines, but they should be sent as one message to, say, Discord, and the Healthchecks pinning uses a different format.) To have the best UI/UX, I believe one would have to manually adjust messages for different targets. I also want a clean configuration interface where every option should ideally have a reasonable meaning independent of other options. I'm worried that it is not immediately clear whether the log level should also affect the messages sent to Healthchecks and the terminal (and maybe replace the option QUIET). I'm hoping to avoid non-trivial interactions between options.

Anyways, to confirm, I believe you don't expect to receive notifications other than (1) IP changes and (2) all kinds of "errors". Is that correct? It might take me a while to go through all the errors the updater is reporting right now, but technically I don't think supporting this is difficult other than the size bloat due to the shoutrrr library. (I also welcome PRs but usually I implemented something before someone did it.)

@favonia favonia removed the design? The next step is to reflect upon the information and come up with a good design label Jul 3, 2023
@favonia
Copy link
Owner

favonia commented Jul 23, 2023

@bartclone Sorry for the slow progress. Do you think you will ever need to notify multiple targets?

@favonia
Copy link
Owner

favonia commented Aug 30, 2023

@alipay404 @bartclone I played with shoutrrr a bit and the resulting image (4.x MiB) is a bit larger than I hoped for, but I could be convinced otherwise. I wonder if you are already using a popular notification system, for example, gotify, ntfy, or online services that support notification redirection, such as novu, courier, magicbell, or something like that? It's much easier to support a single service.

@favonia favonia changed the title Add Notification Notification of IP changes and other errors Aug 30, 2023
@bartclone
Copy link

Sorry for the late reply, holidays kicked in ;).
I myself use PushOver, but then again: so many choices, therefor I proposed the broader solution (lots of services to choose).
These days harddiskspace is cheap - although 4Mb is ofcourse large when for example used in IoT/edge.

@favonia
Copy link
Owner

favonia commented Aug 30, 2023

@bartclone I admit that it's more like an intellectual exercise for me to create the smallest but maintainable DDNS updater with all the features I like. This project was my way of learning Go. I'd like to think through the alternatives---last time I managed to save some bits and improve usability by handcrafting my own parser.

In any case, I suppose you don't need the updater to notify multiple places. Is that correct?

@favonia favonia changed the title Notification of IP changes and other errors Notification of IP changes and errors Aug 30, 2023
@favonia
Copy link
Owner

favonia commented Aug 31, 2023

@bartclone I think I'm about to give up finding alternative designs. There are two things to decide and one major difficulty to worry about. The two things are:

  1. The environment variable should be SHOUTRRR, right?
  2. The exact messages to send out---in particular, should the tool send out IP changed to X from Y instead of just IP changed to X? Is the additional information useful? The tricky part of implementing this is that the original DNS records could be a mess and I'd like to know whether it's worthwhile to come up with a good description for each case.

The major difficulty is that this feature would take me a while (if I want to add all the test cases and whatnot).

@favonia favonia added the design? The next step is to reflect upon the information and come up with a good design label Aug 31, 2023
@bartclone
Copy link

Or maybe just use the ability to a use the API of Apprise.
I took a quick look but Shoutrrr does not seem to provide that?
Apprise also provides a built-in Configuration Manager ...

Using an external service like Apprise (or maybe Shoutrrr?) would limit your codebase.
Ofcourse still needed to define how to call the service, for example running in a another container. That would require URL, API (key for the service), etc etc

On loglevels, see https://sematext.com/blog/logging-levels/
It's always a question what severity/level (and to what extend) a specific event has :). Let's find out.

  • An IP-change itself could be regarded as: info
  • An IP-update fails: error
  • Services cannot be reached: fatal

@favonia
Copy link
Owner

favonia commented Aug 31, 2023

@bartclone Thank you!

  1. I feel running another server instead of including a library might be a bit too much for the end user. 😅 I'll think about it, though.
  2. No, I'm not talking about logging levels. I am talking about the actual messages to be sent. There's already a logging system for outputting messages. However, it is not optimal to recycle logging (recording what the updater is doing) for notifications (telling users about something they may have to act on soon). There are important things that should not be notifications (e.g., whether QUIET mode is used). Logging and notification serve different purposes and messages should be tailored. The question here is whether the old IP should be mentioned.

@favonia favonia added this to the near future milestone Sep 10, 2023
@favonia favonia added the help wanted Extra attention is needed label Oct 4, 2023
@favonia
Copy link
Owner

favonia commented Oct 4, 2023

Unfortunately it is difficult for me to spend enough time on this issue in this semester. PRs are welcome. It is not inherently hard to integrate shoutrrr, just lots of testing and checking. I will leave this issue open at least for now. Sorry about this.

@favonia
Copy link
Owner

favonia commented Nov 27, 2023

Update: for people who want to track my (slow) progress, you can subscribe to #632. Otherwise, I will just close this issue when I feel the feature is ready for broader audience. 😁

@favonia favonia removed the design? The next step is to reflect upon the information and come up with a good design label Mar 9, 2024
@favonia
Copy link
Owner

favonia commented Jun 25, 2024

@obstrux @bartclone Progress report: I have implemented experimental support of shoutrrr but right now it has bugs: strangely, messages cannot be sent to pushover. If you feel adventurous, you could use SHOUTRRR=<shoutrrr url> with the Docker tag edge. It is still NOT working and I am debugging it.

@favonia
Copy link
Owner

favonia commented Jun 26, 2024

Update: the bug was fixed! However, only the failure to detect IP addresses or update DNS records is currently notified. I'm working on other errors:

@favonia
Copy link
Owner

favonia commented Jun 27, 2024

This is done now, pending updates on documentation.

@favonia favonia closed this as completed Jun 27, 2024
@favonia favonia removed the help wanted Extra attention is needed label Jun 28, 2024
@favonia
Copy link
Owner

favonia commented Jun 28, 2024

🎉 The new feature was released with 1.12.0. Please try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants