forked from rDrama/rDrama
1
0
Fork 0

try smth on devrama to fix chat refreshing

master
Aevann 2023-09-26 23:45:16 +03:00
parent 28559e6d34
commit 6c46de47de
4 changed files with 7 additions and 12 deletions

View File

@ -185,7 +185,7 @@ def _create_and_delete_orgy():
del g.db
stdout.flush()
requests.post(f'{SITE_FULL}/refresh_chat')
requests.post('http://localhost:5001/refresh_chat')
video_info = ffmpeg.probe(f'/orgies/{get_file()}')
seconds = int(video_info['streams'][0]['duration'])
@ -195,7 +195,7 @@ def _create_and_delete_orgy():
if orgy:
g.db.delete(orgy)
g.db.commit()
requests.post(f'{SITE_FULL}/refresh_chat')
requests.post('http://localhost:5001/refresh_chat')
def _delete_all_posts():
posts = g.db.query(Post).filter_by(author_id=AUTOJANNY_ID, deleted_utc=0).all()

View File

@ -1979,7 +1979,8 @@ def start_orgy(v):
g.db.add(orgy)
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')
@ -1987,5 +1988,5 @@ def start_orgy(v):
@admin_level_required(PERMS['ORGIES'])
def stop_orgy(v):
g.db.query(Orgy).delete()
requests.post(f'{SITE_FULL}/refresh_chat')
requests.post('http://localhost:5001/refresh_chat')
return {"message": "Orgy stopped successfully!"}

View File

@ -11,7 +11,7 @@ from files.__main__ import app, limiter, get_CF, redis_instance
def before_request():
g.v = None
if request.host != SITE:
if request.host != SITE and request.path != '/refresh_chat':
abort(403, "Unauthorized host provided!")
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!")
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!')
if not get_setting('bots') and request.headers.get("Authorization"):

View File

@ -24,12 +24,6 @@ server {
proxy_pass http://localhost:5001/chat;
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 {
proxy_pass http://localhost:5001/reply;
include includes/headers;