ads
This commit is contained in:
@@ -4,14 +4,12 @@ Flask-based dashboard to monitor services, attacks, and alerts
|
||||
"""
|
||||
import os
|
||||
import asyncio
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime
|
||||
from flask import Flask, render_template, jsonify, request, redirect, url_for, session
|
||||
import asyncpg
|
||||
import aiohttp
|
||||
from functools import wraps
|
||||
|
||||
# Configuration
|
||||
DATABASE_URL = os.getenv("DATABASE_URL", "postgresql://adctrl:adctrl@postgres:5432/adctrl")
|
||||
SECRET_TOKEN = os.getenv("SECRET_TOKEN", "change-me-in-production")
|
||||
WEB_PASSWORD = os.getenv("WEB_PASSWORD", "admin123")
|
||||
CONTROLLER_API = os.getenv("CONTROLLER_API", "http://controller:8001")
|
||||
@@ -21,10 +19,6 @@ TELEGRAM_API = os.getenv("TELEGRAM_API", "http://tg-bot:8003")
|
||||
app = Flask(__name__)
|
||||
app.secret_key = os.getenv("FLASK_SECRET_KEY", "change-me-in-production-flask-secret")
|
||||
|
||||
# Database connection
|
||||
async def get_db_conn():
|
||||
return await asyncpg.connect(DATABASE_URL)
|
||||
|
||||
# Auth decorator
|
||||
def login_required(f):
|
||||
@wraps(f)
|
||||
|
||||
Reference in New Issue
Block a user