changes to run.sh

This commit is contained in:
Tobias Kurze
2019-08-07 10:51:04 +02:00
parent 755110fe2d
commit 4bc790a9cd
3 changed files with 3 additions and 22 deletions

Submodule backend updated: 3c6b6ba099...123eb65f8e

20
run.py
View File

@@ -1,20 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ssl
import logging
from backend import app
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
print(app.config.get("SERVER_NAME", None))
server_name = app.config.get("SERVER_NAME", None)
if server_name is not None and "ubkaps154.ubka.uni-karlsruhe.de" in server_name:
try:
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain('cert.pem', 'key.pem')
app.run(debug=True, ssl_context=context, threaded=True)
except FileNotFoundError:
app.run(debug=True, threaded=True)
app.run(debug=True)

3
run.sh
View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
cd "${0%/*}"
$(PIPENV_PIPFILE=./backend/Pipfile pipenv --venv)/bin/python run.py
$(PIPENV_PIPFILE=./backend/Pipfile pipenv --venv)/bin/python -m backend