New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use nginx as the web service, instead of flask's app.run #1389
Comments
|
We should run a single nginx process on launch, and update the nginx config and reload while using the app, each time a service is started or stopped. We can reload the nginx config using an OS signal: https://nginx.org/en/docs/control.html For monitoring progress of downloads and uploads from nginx, we might need a custom nginx module. Like, maybe this, except with download support too: https://github.com/masterzen/nginx-upload-progress-module |
|
This is going to be trickier than I first realized. I'm working in the nginx branch (https://github.com/onionshare/onionshare/tree/nginx) and I've successfully made the CLI version run an nginx process in the background, with the ability to add and remove vhosts. Next I'm trying to refactor But it turns out, this means running To run gunicorn you need a subprocess like this: gunicorn --bind=127.0.0.1 --workers=2 wsgi:applicationThe A typical from app import app as applicationRight now OnionShare defines a web object, which includes the flask app, and then calls a bunch of functions to modify the flask app (define routes depending on the mode, etc.), and then runs Like, maybe instead of creating a But if these are all running in different processes now, how can we communicate between the flask apps and the onionshare GUI? Now we have to deal with inter-process communication... |
Right now when OnionShare starts a web service, it uses
app.runto start it directly in flask. I think instead we should launch annginxsubprocess and use that along with gunicorn to host the flask app./tmp(Allow ability to serve website files directly rather than gzipped copies #1328), and I suspect we could simplify a lot of the web server code in other ways tooBefore implementing this, I'm not sure how a few things will work:
The text was updated successfully, but these errors were encountered: