mirror of
https://github.com/zoffline/zwift-offline.git
synced 2025-12-12 15:49:40 -08:00
@@ -299,7 +299,9 @@ To enable support for multiple users perform the steps below:
|
||||
* TCP ports 80, 443, 3025 and UDP port 3024 will need to be open on the PC running zoffline if it's running remotely.
|
||||
* Start Zwift and create an account.
|
||||
* This account will only exist on your zoffline server and has no relation with your actual Zwift account.
|
||||
* To enable the password reset feature: create a ``gmail_credentials.txt`` file in the ``storage`` directory containing the login credentials of a Gmail account. You need to access https://security.google.com/settings/security/apppasswords and create an app password to allow the login from the server.
|
||||
* To enable the password reset feature: create a ``gmail_credentials.txt`` file in the ``storage`` directory containing the login credentials of a Gmail account.
|
||||
* You need to access https://security.google.com/settings/security/apppasswords and create an app password to allow the login from the server.
|
||||
* Optionally, the third line can contain the host for the recovery URL (server IP will be used by default).
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
@@ -680,13 +680,14 @@ def send_mail(username, token):
|
||||
with open('%s/gmail_credentials.txt' % STORAGE_DIR) as f:
|
||||
sender_email = f.readline().rstrip('\r\n')
|
||||
password = f.readline().rstrip('\r\n')
|
||||
host = f.readline().rstrip('\r\n')
|
||||
with smtplib.SMTP_SSL("smtp.gmail.com", 465, context=ssl.create_default_context()) as server:
|
||||
server.login(sender_email, password)
|
||||
message = MIMEMultipart()
|
||||
message['From'] = sender_email
|
||||
message['To'] = username
|
||||
message['Subject'] = "Password reset"
|
||||
content = "https://%s/login/?token=%s" % (server_ip, token)
|
||||
content = "https://%s/login/?token=%s" % (host if host else server_ip, token)
|
||||
message.attach(MIMEText(content, 'plain'))
|
||||
server.sendmail(sender_email, username, message.as_string())
|
||||
server.close()
|
||||
|
||||
Reference in New Issue
Block a user