Debug-Logging für IP-Adressen hinzugefügt

This commit is contained in:
2025-03-18 12:26:46 +01:00
parent 7b5e90e3bd
commit 40196fa28f

3
app.py
View File

@@ -89,6 +89,9 @@ def index():
if not session.get('logged_in'): if not session.get('logged_in'):
return redirect(url_for('login')) return redirect(url_for('login'))
allowed_ip_ranges = os.getenv('ALLOWED_IP_RANGES', '') allowed_ip_ranges = os.getenv('ALLOWED_IP_RANGES', '')
client_ip = request.headers.get('X-Forwarded-For', request.remote_addr)
logger.info(f"Client-IP: {client_ip}")
logger.info(f"Erlaubte IP-Bereiche: {allowed_ip_ranges}")
return render_template('index.html', allowed_ip_ranges=allowed_ip_ranges) return render_template('index.html', allowed_ip_ranges=allowed_ip_ranges)
@app.route('/search') @app.route('/search')