Files
MClogger/web/limiter.py
simon 3b78f5dfb1 modified: web/app.py
modified:   web/blueprints/auth.py
	modified:   web/blueprints/group_admin.py
	modified:   web/blueprints/site_admin.py
	new file:   web/limiter.py
	modified:   web/panel_db.py
	modified:   web/requirements.txt
	new file:   web/templates/429.html
	new file:   web/templates/admin/audit_log.html
	modified:   web/templates/admin/base.html
2026-04-14 13:02:41 +02:00

15 lines
453 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
MCLogger Rate-Limiter Singleton
Shared across app.py and all blueprints to avoid circular imports.
"""
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
# In-memory storage is fine for single-process / single-worker deployments.
# For multi-worker gunicorn, set RATELIMIT_STORAGE_URI=redis://... in ENV.
limiter = Limiter(
key_func=get_remote_address,
storage_uri="memory://",
default_limits=[],
)