Skip to content
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

Update web.py #94

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ as flask sessions module needs some secret value to create secure session.
You can generate some random hash easily using python:
`python -c 'import os; import binascii; print(binascii.hexlify(os.urandom(32)))'`

### HTTPS

Multivison now supports HTTPS. To enable this feature, you will need to set 2 environment variables:
```
MULTIVISOR_HTTPS_SERVER_KEY=/path/to/your/serer/key/private.key
MULTIVISOR_HTTPS_CERT_FILE=//path/to/your/server/certificate/certificate.pem
```

### CLI

The multivisor CLI is an optional component which can be installed with:
Expand Down
10 changes: 9 additions & 1 deletion multivisor/server/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,15 @@ def main(args=None):
app.secret_key = secret_key

application = DebuggedApplication(app, evalex=True) if app.debug else app
http_server = WSGIServer(bind, application=application)

#look for a HTTPS server key and certificate and use them if available
httpsKeyFile = os.environ.get( "MULTIVISOR_HTTPS_SERVER_KEY", "" )
httpsCertFile = os.environ.get( "MULTIVISOR_HTTPS_CERT_FILE", "" )
if( httpsKeyFile != "" and httpsCertFile != "" ):
http_server = WSGIServer(bind, application=application, keyfile=httpsKeyFile, certfile=httpsCertFile)
else:
http_server = WSGIServer(bind, application=application)

logging.info("Start accepting requests")
try:
http_server.serve_forever()
Expand Down