mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-12-04 19:15:30 +00:00
allow-server-side-sessions (#855)
This commit is contained in:
parent
8f6a800836
commit
7f86730909
@ -47,7 +47,8 @@ legal_envvars = (
|
||||
'SAML_ASSERTION_ENCRYPTED',
|
||||
'OFFLINE_MODE',
|
||||
'REMOTE_USER_LOGOUT_URL',
|
||||
'REMOTE_USER_COOKIES'
|
||||
'REMOTE_USER_COOKIES',
|
||||
'FILESYSTEM_SESSIONS_ENABLED'
|
||||
)
|
||||
|
||||
legal_envvars_int = ('PORT', 'MAIL_PORT', 'SAML_METADATA_CACHE_LIFETIME')
|
||||
@ -65,7 +66,8 @@ legal_envvars_bool = (
|
||||
'SAML_LOGOUT',
|
||||
'SAML_ASSERTION_ENCRYPTED',
|
||||
'OFFLINE_MODE',
|
||||
'REMOTE_USER_ENABLED'
|
||||
'REMOTE_USER_ENABLED',
|
||||
'FILESYSTEM_SESSIONS_ENABLED'
|
||||
)
|
||||
|
||||
# import everything from environment variables
|
||||
|
@ -4,6 +4,7 @@ from flask import Flask
|
||||
from flask_seasurf import SeaSurf
|
||||
from flask_mail import Mail
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
from flask_session import Session
|
||||
|
||||
from .lib import utils
|
||||
|
||||
@ -78,6 +79,12 @@ def create_app(config=None):
|
||||
from flask_sslify import SSLify
|
||||
_sslify = SSLify(app) # lgtm [py/unused-local-variable]
|
||||
|
||||
# Load Flask-Session
|
||||
if app.config.get('FILESYSTEM_SESSIONS_ENABLED'):
|
||||
app.config['SESSION_TYPE'] = 'filesystem'
|
||||
sess = Session()
|
||||
sess.init_app(app)
|
||||
|
||||
# SMTP
|
||||
app.mail = Mail(app)
|
||||
|
||||
|
@ -8,6 +8,7 @@ BIND_ADDRESS = '0.0.0.0'
|
||||
PORT = 9191
|
||||
HSTS_ENABLED = False
|
||||
OFFLINE_MODE = False
|
||||
FILESYSTEM_SESSIONS_ENABLED = False
|
||||
|
||||
### DATABASE CONFIG
|
||||
SQLA_DB_USER = 'pda'
|
||||
|
@ -27,3 +27,4 @@ pytimeparse==1.1.8
|
||||
PyYAML==5.3.1
|
||||
Flask-SSLify==0.1.5
|
||||
Flask-Mail==0.9.1
|
||||
flask-session==0.3.2
|
Loading…
Reference in New Issue
Block a user