diff --git a/.gitignore b/.gitignore index faa3813..66edc86 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ venv/ ENV/ .env .venv +.html # IDE .idea/ diff --git a/app.py b/app.py index 49cce98..77b5971 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ from flask import Flask, jsonify from flask_cors import CORS import resend from flask import request - +from supabase import create_client, Client app = Flask(__name__) CORS(app, resources={ @@ -14,10 +14,9 @@ CORS(app, resources={ } }) -# from supabase import create_client, Client -# SUPABASE_URL = "https://supabase-core.dev3vds1.link/" -# SUPABASE_KEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTc0NTk0MzYwMCwiZXhwIjo0OTAxNjE3MjAwLCJyb2xlIjoiYW5vbiJ9.28hFArcAFQ3mYTYL2n7nno4nHu5ZszkOO0dkAURR6Yg" -# supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY) +SUPABASE_URL = "https://supabase-core.dev3vds1.link/" +SUPABASE_KEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTc0NTk0MzYwMCwiZXhwIjo0OTAxNjE3MjAwLCJyb2xlIjoiYW5vbiJ9.28hFArcAFQ3mYTYL2n7nno4nHu5ZszkOO0dkAURR6Yg" +supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY) resend.api_key = "re_XvLrRZMH_3mumWA531UugMk1X7A67fhH7" @@ -94,7 +93,7 @@ def send_email(): - @@ -106,31 +105,45 @@ def send_email(): -
Date Issued: {date} + Client ID: VX-CLIENT-686
+
- - - - - - - + + - - - - + +
Description - Duration + + Amount RateAmount
{product}30 Days${price_hour}/hour${price} + {product} +
+ 1 Month + ${price_hour}/hour +
+
${price}
Priority Support Package1 Month$00.00$00.00 + Priority Support Package +
+ 1 Month + Free +
+
$00.00
@@ -220,8 +233,168 @@ def send_email(): "html": html, } - email = resend.Emails.send(params) - print(email) + resend.Emails.send(params) + + # Fetch user details from the database + cred = supabase.table('vertexgpu-cred').select('username, password').eq('taken', False).order('id').execute() + if cred.data: + usernamedb = cred.data[0]['username'] + password = cred.data[0]['password'] + + # Update the credential as taken + supabase.table('vertexgpu-cred').update({'taken': True}).eq('username', usernamedb).execute() + else: + return jsonify({'status': 'error', 'message': 'No available credentials'}), 404 + + htmltwo = f""" + + + + + + VertexGPU Invoice + + +
+ +
+
VertexGPU
+
+ + +
+ + + + + + + +
User: {username} + Client ID: + VX-CLIENT-686 +
+
+ + +
+ + + + + + + + + + + + + +
Server URL: + https://gpu.vertexgpu.com +
Username:{usernamedb}
Password:{password}
+
+ + +
+

Quick start

+
    +
  1. Connect to your GPU instance using the provided credentials.
  2. +
  3. Go to Settings -> Connections (pop-up menu at the top right).
  4. +
  5. Change your password.
  6. +
  7. Go back to Home and run your GPU instance!
  8. +
+

Your GPU instance is ready to use. You can access it via your browser.

+

Sincerely,

+

The VertexGPU Team

+

+ For any assistance, our support team is available 24/7. Thank you for choosing our service. +

+
+ + + +
+ +""" + + params: resend.Emails.SendParams = { + "from": "Vertex Console (no-reply) ", + "to": [email], + "subject": "Your new GPU instance is ready!!", + "html": htmltwo, + } + + resend.Emails.send(params) + return jsonify({'status': 'success', 'message': 'email sent'}) except: return jsonify({'status': 'error', 'message': 'Failed to send email'}), 500 diff --git a/details.html b/details.html new file mode 100644 index 0000000..01c2142 --- /dev/null +++ b/details.html @@ -0,0 +1,138 @@ + + + + + + VertexGPU Invoice + + +
+ +
+
VertexGPU
+
+ + +
+ + + + + + + +
User: {username} + Client ID: + VX-CLIENT-686 +
+
+ + +
+ + + + + + + + + + + + + +
Server URL: + https://gpu.vertexgpu.com +
Username:{usernamedb}
Password:{password}
+
+ + +
+

Quick start

+
    +
  1. Connect to your GPU instance using the provided credentials.
  2. +
  3. Go to Settings -> Connections (pop-up menu at the top right).
  4. +
  5. Change your password.
  6. +
  7. Go back to Home and run your GPU instance!
  8. +
+

Your GPU instance is ready to use. You can access it via your browser.

+

Sincerely,

+

The VertexGPU Team

+

+ For any assistance, our support team is available 24/7. Thank you for choosing our service. +

+
+ + +
+

+ Thank you for choosing VertexGPU for your high-performance computing needs! +

+

+ Visit us at + vertexgpu.com +

+

+ Questions? Contact us at + support@vertexgpu.com +

+
+
+ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..c1e5e94 --- /dev/null +++ b/index.html @@ -0,0 +1,185 @@ + + + + + + VertexGPU Invoice + + +
+ +
+
VertexGPU
+
+ + +
+ + + + + + + + +
Date Issued: {date} + Client ID: + VX-CLIENT-686 +
User: {username}
+
+ + + + + + + + + + + + + + + + + + + +
+ Description + + Amount +
+ {product} +
+ 1 Month + ${price_hour}/hour +
+
${price}
+ Priority Support Package +
+ 1 Month + Free +
+
$00.00
+ + +
+ + + + + + + + + + + + + +
Subtotal:${price}
Network Fee:$0.00
Total Due: + ${price} +
+
+ + +
+

GPU Status Update

+

+ Your GPU instance is being initialized and will be ready for access within the next 2 hours. Once + configuration is complete, we'll send your authentication credentials to your registered email + address. +

+

+ For any assistance, our support team is available 24/7. Thank you for choosing our service. +

+
+ + + +
+ + diff --git a/requirements.txt b/requirements.txt index 9b2c975..ebf4ef6 100644 Binary files a/requirements.txt and b/requirements.txt differ