forked from rDrama/rDrama
try smth on devrama to fix chat refreshing
parent
28559e6d34
commit
6c46de47de
|
@ -185,7 +185,7 @@ def _create_and_delete_orgy():
|
||||||
del g.db
|
del g.db
|
||||||
stdout.flush()
|
stdout.flush()
|
||||||
|
|
||||||
requests.post(f'{SITE_FULL}/refresh_chat')
|
requests.post('http://localhost:5001/refresh_chat')
|
||||||
|
|
||||||
video_info = ffmpeg.probe(f'/orgies/{get_file()}')
|
video_info = ffmpeg.probe(f'/orgies/{get_file()}')
|
||||||
seconds = int(video_info['streams'][0]['duration'])
|
seconds = int(video_info['streams'][0]['duration'])
|
||||||
|
@ -195,7 +195,7 @@ def _create_and_delete_orgy():
|
||||||
if orgy:
|
if orgy:
|
||||||
g.db.delete(orgy)
|
g.db.delete(orgy)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
requests.post(f'{SITE_FULL}/refresh_chat')
|
requests.post('http://localhost:5001/refresh_chat')
|
||||||
|
|
||||||
def _delete_all_posts():
|
def _delete_all_posts():
|
||||||
posts = g.db.query(Post).filter_by(author_id=AUTOJANNY_ID, deleted_utc=0).all()
|
posts = g.db.query(Post).filter_by(author_id=AUTOJANNY_ID, deleted_utc=0).all()
|
||||||
|
|
|
@ -1979,7 +1979,8 @@ def start_orgy(v):
|
||||||
g.db.add(orgy)
|
g.db.add(orgy)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
requests.post(f'{SITE_FULL}/refresh_chat')
|
x = requests.post('http://localhost:5001/refresh_chat')
|
||||||
|
print(x.text, flush=True)
|
||||||
|
|
||||||
return redirect('/chat')
|
return redirect('/chat')
|
||||||
|
|
||||||
|
@ -1987,5 +1988,5 @@ def start_orgy(v):
|
||||||
@admin_level_required(PERMS['ORGIES'])
|
@admin_level_required(PERMS['ORGIES'])
|
||||||
def stop_orgy(v):
|
def stop_orgy(v):
|
||||||
g.db.query(Orgy).delete()
|
g.db.query(Orgy).delete()
|
||||||
requests.post(f'{SITE_FULL}/refresh_chat')
|
requests.post('http://localhost:5001/refresh_chat')
|
||||||
return {"message": "Orgy stopped successfully!"}
|
return {"message": "Orgy stopped successfully!"}
|
||||||
|
|
|
@ -11,7 +11,7 @@ from files.__main__ import app, limiter, get_CF, redis_instance
|
||||||
def before_request():
|
def before_request():
|
||||||
g.v = None
|
g.v = None
|
||||||
|
|
||||||
if request.host != SITE:
|
if request.host != SITE and request.path != '/refresh_chat':
|
||||||
abort(403, "Unauthorized host provided!")
|
abort(403, "Unauthorized host provided!")
|
||||||
|
|
||||||
if SITE == 'marsey.world' and request.path != '/kofi':
|
if SITE == 'marsey.world' and request.path != '/kofi':
|
||||||
|
@ -21,7 +21,7 @@ def before_request():
|
||||||
abort(403, "Cloudflare workers are not allowed to access this website!")
|
abort(403, "Cloudflare workers are not allowed to access this website!")
|
||||||
|
|
||||||
g.agent = request.headers.get("User-Agent", "")
|
g.agent = request.headers.get("User-Agent", "")
|
||||||
if not g.agent and request.path != '/kofi':
|
if not g.agent and request.path not in {'/kofi', '/refresh_chat'}:
|
||||||
abort(403, 'Please use a "User-Agent" header!')
|
abort(403, 'Please use a "User-Agent" header!')
|
||||||
|
|
||||||
if not get_setting('bots') and request.headers.get("Authorization"):
|
if not get_setting('bots') and request.headers.get("Authorization"):
|
||||||
|
|
|
@ -24,12 +24,6 @@ server {
|
||||||
proxy_pass http://localhost:5001/chat;
|
proxy_pass http://localhost:5001/chat;
|
||||||
include includes/headers;
|
include includes/headers;
|
||||||
}
|
}
|
||||||
location /refresh_chat {
|
|
||||||
allow 127.0.0.1;
|
|
||||||
deny all;
|
|
||||||
proxy_pass http://localhost:5001/refresh_chat;
|
|
||||||
include includes/headers;
|
|
||||||
}
|
|
||||||
location /reply {
|
location /reply {
|
||||||
proxy_pass http://localhost:5001/reply;
|
proxy_pass http://localhost:5001/reply;
|
||||||
include includes/headers;
|
include includes/headers;
|
||||||
|
|
Loading…
Reference in New Issue