updated comments, use secrets to generate SECRET_KEY
This commit is contained in:
9
main.py
9
main.py
@@ -5,6 +5,10 @@ from flask_marshmallow import Marshmallow
|
|||||||
from flask_bootstrap import Bootstrap
|
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
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import socket
|
||||||
|
import secrets
|
||||||
from status import st, Status
|
from status import st, Status
|
||||||
from shared import CreateSelect, CreateFoldersSelect, LocationIcon, DB_URL, PROD_HOST
|
from shared import CreateSelect, CreateFoldersSelect, LocationIcon, DB_URL, PROD_HOST
|
||||||
|
|
||||||
@@ -13,9 +17,6 @@ from flask_ldap3_login import LDAP3LoginManager
|
|||||||
from flask_login import LoginManager, login_user, login_required, UserMixin, current_user
|
from flask_login import LoginManager, login_user, login_required, UserMixin, current_user
|
||||||
from flask_ldap3_login.forms import LDAPLoginForm
|
from flask_ldap3_login.forms import LDAPLoginForm
|
||||||
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import socket
|
|
||||||
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ app = Flask(__name__)
|
|||||||
app.config['SQLALCHEMY_DATABASE_URI'] = DB_URL
|
app.config['SQLALCHEMY_DATABASE_URI'] = DB_URL
|
||||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||||
app.config['ENV'] = os.environ['FLASK_ENV']
|
app.config['ENV'] = os.environ['FLASK_ENV']
|
||||||
app.config.from_mapping( SECRET_KEY=b'\xe9\xaf\xe1b\xe9mg\xbe\\\x90\x1f(\xf8Kp\xce91\x17\x14lJ\x9e0')
|
app.config['SECRET_KEY'] = secrets.token_bytes(64)
|
||||||
|
|
||||||
# ldap config vars: (the last one is required, or python ldap freaks out)
|
# ldap config vars: (the last one is required, or python ldap freaks out)
|
||||||
app.config['LDAP_HOST'] = 'mara.ddp.net'
|
app.config['LDAP_HOST'] = 'mara.ddp.net'
|
||||||
|
|||||||
Reference in New Issue
Block a user