fds
parent
085a94b8cd
commit
5f2b2d9a7b
|
@ -19,10 +19,6 @@ from sys import stdout
|
|||
import faulthandler
|
||||
import atexit
|
||||
|
||||
def get_CF() -> str:
|
||||
with app.app_context():
|
||||
return request.headers.get('CF-Connecting-IP')
|
||||
|
||||
app = Flask(__name__, template_folder='templates')
|
||||
app.url_map.strict_slashes = False
|
||||
app.jinja_env.cache = {}
|
||||
|
@ -67,9 +63,13 @@ app.config['DESCRIPTION'] = environ.get("DESCRIPTION", "rdrama.net caters to dra
|
|||
|
||||
r=redis.Redis(host=environ.get("REDIS_URL", "redis://localhost"), decode_responses=True, ssl_cert_reqs=None)
|
||||
|
||||
def get_CF() -> str:
|
||||
with app.app_context():
|
||||
return request.headers.get('CF-Connecting-IP')
|
||||
|
||||
limiter = Limiter(
|
||||
app,
|
||||
key_func=,
|
||||
key_func=get_CF,
|
||||
default_limits=["3/second;30/minute;200/hour;1000/day"],
|
||||
application_limits=["10/second;200/minute;5000/hour;10000/day"],
|
||||
storage_uri=environ.get("REDIS_URL", "redis://localhost")
|
||||
|
|
Loading…
Reference in New Issue