diff --git a/.gitignore b/.gitignore index aa188a399..560f817d7 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,12 @@ flask_session/ site_settings.json /files/test.py tags + +# Chat environment chat/node_modules chat/build -chat/.env \ No newline at end of file +chat/.env + +# Chat artefacts +files/assets/css/chat_done.css +files/assets/js/chat_done.js diff --git a/files/routes/chat.py b/files/routes/chat.py index 0df99dc40..b1bab2a4c 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -39,18 +39,6 @@ def chat(v): return render_template("chat.html", v=v, messages=messages) -@app.get('/chat.js') -def chatjs(): - resp = make_response(send_from_directory('assets', 'js/chat.js')) - return resp - - -@app.get('/chat_done.js') -def chatbuiltjs(): - resp = make_response(send_from_directory('assets', 'js/chat_done.js')) - return resp - - @socketio.on('speak') @limiter.limit("3/second;10/minute") @limiter.limit("3/second;10/minute", key_func=lambda:f'{SITE}-{session.get("lo_user")}') @@ -161,4 +149,4 @@ def close_running_threads(): cache.set(f'{SITE}_chat', messages) cache.set(f'{SITE}_total', total) cache.set(f'{SITE}_muted', muted) -atexit.register(close_running_threads) \ No newline at end of file +atexit.register(close_running_threads) diff --git a/files/templates/chat.html b/files/templates/chat.html index e796e5276..0b7bd9522 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -36,7 +36,7 @@ data-themecolor="{{v.themecolor}}"> - - + + diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 8d53f2392..5df31ecf6 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -2,6 +2,7 @@ set CACHE_VER = { 'css/main.css': 4036, 'css/catalog.css': 4007, + 'css/4chan.css': 4007, 'css/classic.css': 4031, 'css/classic_dark.css': 4031, @@ -25,6 +26,7 @@ set CACHE_VER = { 'js/submission_listing.js': 4000, 'js/emoji_modal.js': 4004, 'js/formatting.js': 4000, + 'js/lite-youtube.js': 4000, 'js/lottery.js': 4000, 'js/marked.js': 4006, 'js/search.js': 4000, @@ -33,6 +35,9 @@ set CACHE_VER = { 'js/userpage_v.js': 4002, 'js/lozad.js': 4000, 'js/sort_table.js': 4001, + + 'css/chat_done.css': 1001, + 'js/chat_done.js': 1001, } -%} diff --git a/startup_chat.sh b/startup_chat.sh index 0fd7ac901..6d7b05dce 100644 --- a/startup_chat.sh +++ b/startup_chat.sh @@ -1,5 +1,14 @@ +#!/bin/bash + cd /rDrama git pull -cd ./chat && yarn chat && cd ../ + . /env -gunicorn files.__main__:app load_chat -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 -b 0.0.0.0:5001 --max-requests 30000 --max-requests-jitter 30000 \ No newline at end of file +PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}" + +cd ./chat +yarn install +yarn chat +cd .. + +gunicorn files.__main__:app load_chat -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 -b 0.0.0.0:5001 --max-requests 30000 --max-requests-jitter 30000