Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ http {
proxy_pass http://127.0.0.1:8000/;
}
location /socket.io {
proxy_pass http://127.0.0.1:8001;
proxy_pass http://127.0.0.1:8001/socket.io;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Connection "Upgrade";
}
location /shell/ {
valid_referers server_names;
Expand Down
114 changes: 86 additions & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ djangorestframework = "==3.13.1" # Last version to support Django 2.2 (up to 4.
django-pipeline = "*"
django-braces = "==1.13.0" # look to 1.14.0 (30 Dec 2019) as Django 1.11.0+ now
oauthlib = "==3.1.0" # Last Python 2.7 compat + 3.7 compat.
python-engineio = "==2.3.2" # Revisit version post 3.0.0
python-socketio = "==1.6.0"
python-engineio = "==4.8.0"
python-socketio = "==5.9.0"
dbus-python = "==1.2.18"
# N.B. officially Django >= 2.2.1 is required for psycopg2 >= 2.8
psycopg2 = "==2.8.6" # last Python 2.7 version, PostgreSQL 13 errorcodes map?
psycogreen = "==1.0"
gevent = "*" # can be an extra dependency to gunicorn.
gevent-websocket = "*"
# Python WSGI HTTP Server - 20.0 (2019/10/30) dropped Python 2.7.
gunicorn = "==19.10.0" # buildout previously used 19.7.1

Expand Down
10 changes: 6 additions & 4 deletions src/rockstor/smart_manager/data_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""

# TODO: Let's deprecate gevent in favor of django channels and we won't need
# monkey patching and flake8 exceptions.
# monkey patching and flake8 exceptions.
import shutil
from tempfile import mkstemp

Expand All @@ -33,7 +33,6 @@
import gevent # noqa E402
import socketio # noqa E402
from gevent import pywsgi # noqa E402
from geventwebsocket.handler import WebSocketHandler # noqa E402

from gevent.subprocess import Popen, PIPE # noqa E402
from os import path # noqa E402
Expand Down Expand Up @@ -1146,9 +1145,12 @@ def main():
LogManagerNamespace("/logmanager"),
PincardManagerNamespace("/pincardmanager"),
]
sio_server = socketio.Server(async_mode="gevent")
# async_mode "threading" invokes simple-websocket.
# https://python-socketio.readthedocs.io/en/latest/server.html#standard-threads
# This did not allow us to removes gevent's monkey patching.
sio_server = socketio.Server(async_mode="threading", cors_allowed_origins='*', logger=False, engineio_logger=False)
for namespace in sio_namespaces:
sio_server.register_namespace(namespace)
app = socketio.Middleware(sio_server)
logger.debug("Python-socketio listening on port http://127.0.0.1:8001")
pywsgi.WSGIServer(("", 8001), app, handler_class=WebSocketHandler).serve_forever()
pywsgi.WSGIServer(('', 8001), app).serve_forever()