batman
This commit is contained in:
parent
2e919145ec
commit
9eb8f24845
7 changed files with 114 additions and 0 deletions
26
app.py
Normal file
26
app.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
from flask import Flask, render_template, request, jsonify
|
||||
import threading
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
# Speicher für Proxy-Subdomains (dict mit Liste für jeden Server)
|
||||
proxy_data = {}
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('index.html', proxies=proxy_data)
|
||||
|
||||
@app.route('/update', methods=['POST'])
|
||||
def update():
|
||||
"""Empfängt Subdomain-Daten von Caddy-Proxies"""
|
||||
data = request.json
|
||||
if not data or "server" not in data or "entries" not in data:
|
||||
return jsonify({"error": "Invalid data"}), 400
|
||||
|
||||
server_name = data["server"]
|
||||
proxy_data[server_name] = data["entries"]
|
||||
|
||||
return jsonify({"message": "Updated successfully"}), 200
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=5000)
|
Loading…
Add table
Add a link
Reference in a new issue