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
This commit is contained in:
14
web/limiter.py
Normal file
14
web/limiter.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
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=[],
|
||||
)
|
||||
Reference in New Issue
Block a user