fds
This commit is contained in:
parent
d3892c8eb3
commit
32c672e77c
1 changed files with 5 additions and 5 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue