Skip to content

Commit c1e175f

Browse files
committed
make the temp password randomly generated
1 parent 61b68db commit c1e175f

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

tux/cogs/admin/mail.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import random
2+
13
import discord
24
import httpx
35
from discord import app_commands
@@ -20,8 +22,8 @@ def __init__(self, bot: commands.Bot):
2022
self.default_options = {
2123
"active": "1",
2224
"domain": "atl.tools",
23-
"password": "changeme1234!",
24-
"password2": "changeme1234!",
25+
"password": "ErrorPleaseReportThis",
26+
"password2": "ErrorPleaseReportThis",
2527
"quota": "3072",
2628
"force_pw_update": "1",
2729
"tls_enforce_in": "0",
@@ -40,6 +42,20 @@ async def register(
4042
mailbox_data = self.default_options.copy()
4143
mailbox_data["local_part"] = username
4244
mailbox_data["name"] = username
45+
46+
# Generate 6 random numbers
47+
password = "changeme"
48+
for _ in range(6):
49+
password += str(random.randint(0, 9))
50+
51+
# Generate 4 random special characters
52+
special_chars = "!@#$%^&*"
53+
for _ in range(4):
54+
password += random.choice(special_chars)
55+
56+
mailbox_data["password"] = password
57+
mailbox_data["password2"] = password
58+
4359
# Ensure tags are copied correctly and member ID is added
4460
tags = (
4561
self.default_options["tags"]
@@ -87,7 +103,7 @@ async def register(
87103
88104
**Email Address**: `{mailbox_info}`
89105
**Access Mailbox**: [mail.atl.tools](https://mail.atl.tools)
90-
**Default Password**: `changeme1234!`
106+
**Default Password**: ||`{password}`||
91107
92108
**Please change your password after logging in for the first time.**
93109

0 commit comments

Comments
 (0)