Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,7 +92,92 @@ def apply_template_changes(template: str) -> str:
|
|
| 92 |
return template
|
| 93 |
|
| 94 |
# Load template once on startup
|
| 95 |
-
HTML_TEMPLATE = apply_template_changes(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
# ================= IP BLOCK SYSTEM =================
|
| 98 |
def is_ip_blocked(ip):
|
|
|
|
| 92 |
return template
|
| 93 |
|
| 94 |
# Load template once on startup
|
| 95 |
+
HTML_TEMPLATE = apply_template_changes(
|
| 96 |
+
"""
|
| 97 |
+
<!DOCTYPE html>
|
| 98 |
+
<html lang="en">
|
| 99 |
+
<head>
|
| 100 |
+
<meta charset="UTF-8">
|
| 101 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 102 |
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
| 103 |
+
<title>Your OTP Code</title>
|
| 104 |
+
<style>
|
| 105 |
+
/* Global Reset */
|
| 106 |
+
body, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
|
| 107 |
+
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
|
| 108 |
+
img { -ms-interpolation-mode: bicubic; border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }
|
| 109 |
+
table { border-collapse: collapse !important; }
|
| 110 |
+
body { height: 100% !important; margin: 0 !important; padding: 0 !important; width: 100% !important; background-color: #f4f7f9; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
|
| 111 |
+
|
| 112 |
+
/* Mobile Responsive */
|
| 113 |
+
@media screen and (max-width: 600px) {
|
| 114 |
+
.email-container { width: 100% !important; margin: auto !important; }
|
| 115 |
+
.content-padding { padding: 20px !important; }
|
| 116 |
+
.otp-code { font-size: 32px !important; letter-spacing: 8px !important; }
|
| 117 |
+
}
|
| 118 |
+
</style>
|
| 119 |
+
</head>
|
| 120 |
+
<body style="margin: 0; padding: 0; background-color: #f4f7f9;">
|
| 121 |
+
<center>
|
| 122 |
+
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.05);">
|
| 123 |
+
|
| 124 |
+
<tr>
|
| 125 |
+
<td style="padding: 40px 40px 20px 40px; text-align: center;">
|
| 126 |
+
<h1 style="margin: 0; font-size: 24px; color: #1a1a1a; font-weight: 700; letter-spacing: -0.5px;">{{APP_NAME}}</h1>
|
| 127 |
+
</td>
|
| 128 |
+
</tr>
|
| 129 |
+
|
| 130 |
+
<tr>
|
| 131 |
+
<td class="content-padding" style="padding: 0 50px 40px 50px; text-align: center;">
|
| 132 |
+
<p style="margin: 0 0 24px 0; font-size: 16px; line-height: 24px; color: #4b5563;">
|
| 133 |
+
To complete your sign-in, please use the following one-time password (OTP).
|
| 134 |
+
</p>
|
| 135 |
+
|
| 136 |
+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
| 137 |
+
<tr>
|
| 138 |
+
<td style="background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 24px 40px;">
|
| 139 |
+
<span class="otp-code" style="font-family: 'Courier New', Courier, monospace; font-size: 42px; font-weight: 800; color: #2563eb; letter-spacing: 12px; display: block; margin-left: 12px;">{{OTP_CODE}}</span>
|
| 140 |
+
</td>
|
| 141 |
+
</tr>
|
| 142 |
+
</table>
|
| 143 |
+
|
| 144 |
+
<p style="margin: 24px 0 0 0; font-size: 14px; font-weight: 500; color: #64748b;">
|
| 145 |
+
This code is valid for <span style="color: #1e293b; font-weight: 600;">5 minutes</span>.
|
| 146 |
+
</p>
|
| 147 |
+
</td>
|
| 148 |
+
</tr>
|
| 149 |
+
|
| 150 |
+
<tr>
|
| 151 |
+
<td style="padding: 0 50px 40px 50px;">
|
| 152 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #fffbeb; border-radius: 8px; border-left: 4px solid #f59e0b;">
|
| 153 |
+
<tr>
|
| 154 |
+
<td style="padding: 16px; font-size: 13px; line-height: 20px; color: #92400e;">
|
| 155 |
+
<strong>Security Alert:</strong> For your protection, never share this code with anyone. Our team will never ask for your OTP over the phone or email.
|
| 156 |
+
</td>
|
| 157 |
+
</tr>
|
| 158 |
+
</table>
|
| 159 |
+
</td>
|
| 160 |
+
</tr>
|
| 161 |
+
|
| 162 |
+
<tr>
|
| 163 |
+
<td style="padding: 0 50px 40px 50px; text-align: center; border-top: 1px solid #f1f5f9;">
|
| 164 |
+
<p style="margin: 20px 0 8px 0; font-size: 12px; color: #94a3b8; line-height: 18px;">
|
| 165 |
+
If you did not request this code, you can safely ignore this email. Someone may have entered your email address by mistake.
|
| 166 |
+
</p>
|
| 167 |
+
<p style="margin: 0; font-size: 12px; color: #cbd5e1;">
|
| 168 |
+
© {{YEAR}} {{APP_NAME}}. All rights reserved.
|
| 169 |
+
</p>
|
| 170 |
+
<p style="margin: 20px 0 0 0; font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px;">
|
| 171 |
+
MailOTP Guard — made with ❤️ by TechBitForge
|
| 172 |
+
</p>
|
| 173 |
+
</td>
|
| 174 |
+
</tr>
|
| 175 |
+
</table>
|
| 176 |
+
</center>
|
| 177 |
+
</body>
|
| 178 |
+
</html>
|
| 179 |
+
"""
|
| 180 |
+
)
|
| 181 |
|
| 182 |
# ================= IP BLOCK SYSTEM =================
|
| 183 |
def is_ip_blocked(ip):
|