commit 18968071655a66f4112cff407caff2e50fbfa276 Author: bmartin Date: Wed Jun 3 21:23:35 2026 +0000 Initial commit: AdGuard Tetris blocking page diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/__pycache__/app.cpython-312.pyc b/__pycache__/app.cpython-312.pyc new file mode 100644 index 0000000..e8b0880 Binary files /dev/null and b/__pycache__/app.cpython-312.pyc differ diff --git a/app.py b/app.py new file mode 100644 index 0000000..e9cf1a0 --- /dev/null +++ b/app.py @@ -0,0 +1,65 @@ +import sqlite3 +import os +from flask import Flask, render_template, request, jsonify + +app = Flask(__name__) + +DB_PATH = '/opt/flaskapp/scores.db' + +def get_db(): + conn = sqlite3.connect(DB_PATH) + conn.row_factory = sqlite3.Row + return conn + +def init_db(): + with get_db() as conn: + conn.execute(''' + CREATE TABLE IF NOT EXISTS scores ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + score INTEGER NOT NULL, + level INTEGER NOT NULL, + lines INTEGER NOT NULL, + domain TEXT, + ts DATETIME DEFAULT CURRENT_TIMESTAMP + ) + ''') + conn.commit() + +init_db() + +@app.route("/", defaults={"path": ""}) +@app.route("/") +def blocked(path): + if path == "leaderboard": + return leaderboard() + domain = request.host or request.args.get("domain", "that site") + domain = domain.split(":")[0] + return render_template("blocked.html", domain=domain, reason="blocked by network policy") + +@app.route("/score", methods=["POST"]) +def submit_score(): + data = request.get_json() + name = (data.get("name") or "ANONYMOUS")[:16].upper().strip() + score = int(data.get("score", 0)) + level = int(data.get("level", 1)) + lines = int(data.get("lines", 0)) + domain = (data.get("domain") or "unknown")[:64] + with get_db() as conn: + conn.execute( + "INSERT INTO scores (name, score, level, lines, domain) VALUES (?,?,?,?,?)", + (name, score, level, lines, domain) + ) + conn.commit() + return jsonify({"ok": True}) + +@app.route("/leaderboard") +def leaderboard(): + with get_db() as conn: + rows = conn.execute( + "SELECT name, score, level, lines, domain, ts FROM scores ORDER BY score DESC LIMIT 20" + ).fetchall() + return render_template("leaderboard.html", scores=rows) + +if __name__ == "__main__": + app.run(host="0.0.0.0", port=80, debug=True) diff --git a/app.wsgi b/app.wsgi new file mode 100644 index 0000000..3ed4158 --- /dev/null +++ b/app.wsgi @@ -0,0 +1,4 @@ +import sys +sys.path.insert(0,'/opt/flaskapp') + +from app import app as application diff --git a/scores.db b/scores.db new file mode 100644 index 0000000..1281e73 Binary files /dev/null and b/scores.db differ diff --git a/templates/blocked.html b/templates/blocked.html new file mode 100644 index 0000000..db93124 --- /dev/null +++ b/templates/blocked.html @@ -0,0 +1,729 @@ + + + + + + ACCESS DENIED :: {{ domain }} + + + + + +
+
+ NETGUARD-OS v4.1.2 :: SECURITY TERMINAL + +
+
+
+ root@netguard:~$ resolve --host "{{ domain }}" +
+
[ ACCESS DENIED ]
+
+ TARGET HOST: {{ domain }}  |  STATUS: BLOCKED  |  POLICY: {{ reason }} +
+
+ [SYSTEM] Request intercepted by network policy enforcement layer.
+ [SYSTEM] Your browsing attempt has been logged. Timestamp recorded.
+ [INFO] While you wait, the system has deployed a cognitive recalibration protocol.
+ [INFO] Estimated recalibration duration: however long it takes. _ +
+
+
+ +
+ +
+
// RECALIBRATION MODULE :: TETRIS ENGINE //
+
+ +
+
TETRIS.EXE
+
press [ENTER] to initialize
+
+
+
+ + + +
+ + + + diff --git a/templates/leaderboard.html b/templates/leaderboard.html new file mode 100644 index 0000000..db93124 --- /dev/null +++ b/templates/leaderboard.html @@ -0,0 +1,729 @@ + + + + + + ACCESS DENIED :: {{ domain }} + + + + + +
+
+ NETGUARD-OS v4.1.2 :: SECURITY TERMINAL + +
+
+
+ root@netguard:~$ resolve --host "{{ domain }}" +
+
[ ACCESS DENIED ]
+
+ TARGET HOST: {{ domain }}  |  STATUS: BLOCKED  |  POLICY: {{ reason }} +
+
+ [SYSTEM] Request intercepted by network policy enforcement layer.
+ [SYSTEM] Your browsing attempt has been logged. Timestamp recorded.
+ [INFO] While you wait, the system has deployed a cognitive recalibration protocol.
+ [INFO] Estimated recalibration duration: however long it takes. _ +
+
+
+ +
+ +
+
// RECALIBRATION MODULE :: TETRIS ENGINE //
+
+ +
+
TETRIS.EXE
+
press [ENTER] to initialize
+
+
+
+ + + +
+ + + +