junhaoliao / iCtrl

A Simple VNC + SSH Shell + SFTP Client
https://ictrl.ca
Other
168 stars 14 forks source link

Add email activation #8

Closed leojiaxingli closed 2 years ago

junhaoliao commented 2 years ago

@leojiaxingli Thanks for your contribution! The TTL cache approach is impressive, and I personally learned a few great lessons from your approaches.

Could you check whether the following changes will break your code:

  1. a few variable names: 'resend_cache' -> 'resend_cooldown'; 'RESEND_TTL_SECOND' -> 'RESEND_COOLDOWN_TTL_SECOND'
  2. the method signature of "send_activation_email" and also the parameters in api('/resend') because the login fields only contains usernames. (Email login support is currently removed. @Kruz-X )
  3. use env variables to read sender email credentials
  4. replace the sender to use support@ictrl.ca hosted by Tencent Work Email. I do observe some delays in receiving the emails.

If there is no objection, I will probably replace our email host provider with Zoho:

  1. It is the current host of junhao@junhao.ca; I can tell it is fairly reliable.
  2. It does provide free SMTP.
  3. It doesn't provide free IMAP/POP3: does it matter to us? @leojiaxingli

@Kruz-X There are some significant changes in the Login frontend. Would you mind familiarizing yourself with the changes and add some real-time password check in the frontend? #9 Password requirements are available in https://github.com/junhaoliao/iCtrl/blob/2f388ae223fcd7bee236e693c3c504ea2bf1c2d2/application/utils.py#L39

@KevinHaoranZhang Could you verify if the changes break our existing code on both the frontend and backend?

leojiaxingli commented 2 years ago

@junhaoliao Thanks for the review. Your proposed changes looks good. We used smtplib.SMTP_SSL to send the email so SMTP support is enough.