This commit is contained in:
parent
4dee2ea36e
commit
0c6f893a6f
@ -15,7 +15,7 @@ ADMIN_USERNAME = environ.get('ADMIN_USERNAME', 'admin')
|
|||||||
ADMIN_PASSWORD = environ.get('ADMIN_PASSWORD', 'secret')
|
ADMIN_PASSWORD = environ.get('ADMIN_PASSWORD', 'secret')
|
||||||
APP_PORT = int(environ.get('FLASK_PORT', 5000))
|
APP_PORT = int(environ.get('FLASK_PORT', 5000))
|
||||||
CACHE_TIMEOUT = int(environ.get('CACHE_TIMEOUT', 60 * 60))
|
CACHE_TIMEOUT = int(environ.get('CACHE_TIMEOUT', 60 * 60))
|
||||||
REQUESTS_TIMEOUT = int(environ.get('REQUESTS_TIMEOUT', 10))
|
REQUESTS_TIMEOUT = int(environ.get('REQUESTS_TIMEOUT', 5))
|
||||||
BLACKLIST_WORDS = environ.get('BLACKLIST_WORDS', '').split(',') if environ.get('BLACKLIST_WORDS', '') else []
|
BLACKLIST_WORDS = environ.get('BLACKLIST_WORDS', '').split(',') if environ.get('BLACKLIST_WORDS', '') else []
|
||||||
CLOUDPROXY_ENDPOINT = environ.get('CLOUDPROXY_ENDPOINT')
|
CLOUDPROXY_ENDPOINT = environ.get('CLOUDPROXY_ENDPOINT')
|
||||||
DB_ENABLED = False
|
DB_ENABLED = False
|
||||||
|
@ -4,9 +4,9 @@ from .config import CLOUDPROXY_ENDPOINT, REQUESTS_TIMEOUT
|
|||||||
|
|
||||||
|
|
||||||
class FlareRequests(Session):
|
class FlareRequests(Session):
|
||||||
def request(self, method, url, params=None, timeout=REQUESTS_TIMEOUT, **kwargs):
|
def request(self, method, url, params=None, **kwargs):
|
||||||
if not CLOUDPROXY_ENDPOINT:
|
if not CLOUDPROXY_ENDPOINT:
|
||||||
return super().request(method, url, params, timeout=timeout, **kwargs)
|
return super().request(method, url, params, **kwargs)
|
||||||
|
|
||||||
sessions = post(CLOUDPROXY_ENDPOINT, json={"cmd": "sessions.list"}).json()
|
sessions = post(CLOUDPROXY_ENDPOINT, json={"cmd": "sessions.list"}).json()
|
||||||
|
|
||||||
@ -24,8 +24,7 @@ class FlareRequests(Session):
|
|||||||
post_data = {
|
post_data = {
|
||||||
"cmd": f"request.{method.lower()}",
|
"cmd": f"request.{method.lower()}",
|
||||||
"session": FLARESESSION,
|
"session": FLARESESSION,
|
||||||
"url": url,
|
"url": url
|
||||||
"maxTimeout": timeout * 1000,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if params:
|
if params:
|
||||||
|
Reference in New Issue
Block a user