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
15 lines
453 B
Python
15 lines
453 B
Python
"""
|
||
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=[],
|
||
)
|