mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-06-28 01:06:58 +00:00
commit
d49a7dd7e5
11
README.md
11
README.md
@ -52,6 +52,17 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
# [Demo](https://wgd-demo.donaldzou.dev)
|
||||||
|
If you would like to try out WGDashboard, feel free to access the link above. You won't be able to actually connect it with WireGuard since I blocked all Post/Pre script.
|
||||||
|
|
||||||
|
Username: `admin`
|
||||||
|
|
||||||
|
Password: `admin`
|
||||||
|
|
||||||
|
> **Please don't abuse server 🥺, and do not put any personal information on it.** If you can't access it, [please let me know here](https://github.com/donaldzou/WGDashboard/issues/695).
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
# [Official Documentation](https://donaldzou.dev/WGDashboard-Documentations)
|
# [Official Documentation](https://donaldzou.dev/WGDashboard-Documentations)
|
||||||
|
@ -25,7 +25,7 @@ from modules.PeerJob import PeerJob
|
|||||||
from modules.SystemStatus import SystemStatus
|
from modules.SystemStatus import SystemStatus
|
||||||
SystemStatus = SystemStatus()
|
SystemStatus = SystemStatus()
|
||||||
|
|
||||||
DASHBOARD_VERSION = 'v4.2.1'
|
DASHBOARD_VERSION = 'v4.2.2'
|
||||||
|
|
||||||
CONFIGURATION_PATH = os.getenv('CONFIGURATION_PATH', '.')
|
CONFIGURATION_PATH = os.getenv('CONFIGURATION_PATH', '.')
|
||||||
DB_PATH = os.path.join(CONFIGURATION_PATH, 'db')
|
DB_PATH = os.path.join(CONFIGURATION_PATH, 'db')
|
||||||
|
@ -11,8 +11,8 @@ class EmailSender:
|
|||||||
def __init__(self, DashboardConfig):
|
def __init__(self, DashboardConfig):
|
||||||
self.smtp = None
|
self.smtp = None
|
||||||
self.DashboardConfig = DashboardConfig
|
self.DashboardConfig = DashboardConfig
|
||||||
if not os.path.exists('../attachments'):
|
if not os.path.exists('./attachments'):
|
||||||
os.mkdir('../attachments')
|
os.mkdir('./attachments')
|
||||||
|
|
||||||
def Server(self):
|
def Server(self):
|
||||||
return self.DashboardConfig.GetConfig("Email", "server")[1]
|
return self.DashboardConfig.GetConfig("Email", "server")[1]
|
||||||
@ -33,8 +33,7 @@ class EmailSender:
|
|||||||
return self.DashboardConfig.GetConfig("Email", "send_from")[1]
|
return self.DashboardConfig.GetConfig("Email", "send_from")[1]
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
print(self.Server())
|
return len(self.Server()) > 0 and len(self.Port()) > 0 and len(self.Encryption()) > 0 and len(self.Username()) > 0 and len(self.Password()) > 0 and len(self.SendFrom())
|
||||||
return len(self.Server()) > 0 and len(self.Port()) > 0 and len(self.Encryption()) > 0 and len(self.Username()) > 0 and len(self.Password()) > 0
|
|
||||||
|
|
||||||
def send(self, receiver, subject, body, includeAttachment = False, attachmentName = ""):
|
def send(self, receiver, subject, body, includeAttachment = False, attachmentName = ""):
|
||||||
if self.ready():
|
if self.ready():
|
||||||
@ -46,7 +45,7 @@ class EmailSender:
|
|||||||
self.smtp.login(self.Username(), self.Password())
|
self.smtp.login(self.Username(), self.Password())
|
||||||
message = MIMEMultipart()
|
message = MIMEMultipart()
|
||||||
message['Subject'] = subject
|
message['Subject'] = subject
|
||||||
message['From'] = formataddr((Header(self.SendFrom()).encode(), self.Username()))
|
message['From'] = self.SendFrom()
|
||||||
message["To"] = receiver
|
message["To"] = receiver
|
||||||
message.attach(MIMEText(body, "plain"))
|
message.attach(MIMEText(body, "plain"))
|
||||||
|
|
||||||
@ -62,7 +61,7 @@ class EmailSender:
|
|||||||
else:
|
else:
|
||||||
self.smtp.close()
|
self.smtp.close()
|
||||||
return False, "Attachment does not exist"
|
return False, "Attachment does not exist"
|
||||||
self.smtp.sendmail(self.Username(), receiver, message.as_string())
|
self.smtp.sendmail(self.SendFrom(), receiver, message.as_string())
|
||||||
self.smtp.close()
|
self.smtp.close()
|
||||||
return True, None
|
return True, None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "app",
|
"name": "app",
|
||||||
"version": "4.2.1",
|
"version": "4.2.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"buildcommitpush": "./build.sh",
|
"buildcommitpush": "./build.sh",
|
||||||
"build electron": "vite build && vite build --mode electron && cd ../../../../WGDashboard-Desktop && electron-builder --mac --win",
|
"build electron": "vite build && vite build --mode electron && cd ../../../../WGDashboard-Desktop && /opt/homebrew/bin/npm run \"electron dist\"",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user