AuroraDAO / aurad

Staking software for the AURA token
https://auroradao.com/
GNU Lesser General Public License v3.0
32 stars 20 forks source link

Email notifications when staking goes from online to offline #2

Closed Bobface closed 5 years ago

Bobface commented 5 years ago

Adds a choice to enter an Email-Account (Username & Password) using aura config. After the user entered an Email-Account, a testmail is sent to check that everything is working fine. The credentials are then stored in ipc/settings.json and loaded by index.js. When staking switches from online to offline, the node notifies the user by sending an Email to the saved address.

Added Dependencies: nodemailer v5 or above

For now the mail only contains a short, sample text. There is HTML support for better-looking mails.

Unfortunatly I could not really test much of the code. I tried to setup a working testing environment for hours, with no success. An easier way to setup a testing environment would be a great addition for the future!

Swader commented 5 years ago

I think it would be better to monitor the logs externally and respond to them, rather than add to an already dependency-heavy tool.

Attach a monitor to docker logs -f docker_aurad_1 and react to OFFLINE messages for best results.

Bobface commented 5 years ago

That's a good idea. Do you think of a standalone monitoring application for the aurad client? One drawback I can think of is that it would add more complexity to the installation and maintenance of the client. Reading the discord chat, there are many non-technical people who want to take part in staking. However for many of them it is difficult to get the aura client installed and running, A second application might make things more complicated. Entering an email address when configuring might be the simpler solution.

bradennapier commented 5 years ago

Thanks for the PR!

I was personally considering using the webhook model to make a simple configured web request when status changes.

There are many services that can then take advantage of this out of the box.

This would also make it easy enough to provide local host services which can respond to these however they wish and wouldn’t add dependencies which we plan to reduce greatly over time.

I haven’t had time to review the PR itself yet and haven’t been involved with this repo specifically much yet either - but great to see some contributions!

Swader commented 5 years ago

@Bobface not on the server per se - just expose the logs on the server and hook into them from the outside - an ideal candidate for a web app (think Aura dashboard), or a simple desktop app.

yennieb commented 5 years ago

Thank you for the PR - please note we're moving to a new repo as part of our IDEX rebranding: https://github.com/idexio/IDEXd