PROD_HOST comes from shared not also defined in main, also was still referencing book cert - not really a combo that was likely as we used gunicorn not flask in prod, and gunicorn has correct cert set on cmdline
This commit is contained in:
6
main.py
6
main.py
@@ -6,7 +6,7 @@ from flask_bootstrap import Bootstrap
|
|||||||
from wtforms import SubmitField, StringField, HiddenField, SelectField, IntegerField, TextAreaField, validators
|
from wtforms import SubmitField, StringField, HiddenField, SelectField, IntegerField, TextAreaField, validators
|
||||||
from flask_wtf import FlaskForm
|
from flask_wtf import FlaskForm
|
||||||
from status import st, Status
|
from status import st, Status
|
||||||
from shared import CreateSelect, CreateFoldersSelect, LocationIcon, DB_URL
|
from shared import CreateSelect, CreateFoldersSelect, LocationIcon, DB_URL, PROD_HOST
|
||||||
|
|
||||||
# for ldap auth
|
# for ldap auth
|
||||||
from flask_ldap3_login import LDAP3LoginManager
|
from flask_ldap3_login import LDAP3LoginManager
|
||||||
@@ -20,8 +20,6 @@ import socket
|
|||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
|
|
||||||
####################################### Flask App globals #######################################
|
####################################### Flask App globals #######################################
|
||||||
PROD_HOST="pa_web"
|
|
||||||
|
|
||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
print( "Running on: {}".format( hostname) )
|
print( "Running on: {}".format( hostname) )
|
||||||
|
|
||||||
@@ -134,6 +132,6 @@ def login():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if hostname == PROD_HOST:
|
if hostname == PROD_HOST:
|
||||||
app.run(ssl_context=('/etc/letsencrypt/live/book.depaoli.id.au/cert.pem', '/etc/letsencrypt/live/book.depaoli.id.au/privkey.pem'), host="0.0.0.0", debug=False)
|
app.run(ssl_context=('/etc/letsencrypt/live/pa.depaoli.id.au/cert.pem', '/etc/letsencrypt/live/pa.depaoli.id.au/privkey.pem'), host="0.0.0.0", debug=False)
|
||||||
else:
|
else:
|
||||||
app.run(host="0.0.0.0", debug=True)
|
app.run(host="0.0.0.0", debug=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user