mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-04-19 10:17:31 +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',
|
'SAML_ASSERTION_ENCRYPTED',
|
||||||
'OFFLINE_MODE',
|
'OFFLINE_MODE',
|
||||||
'REMOTE_USER_LOGOUT_URL',
|
'REMOTE_USER_LOGOUT_URL',
|
||||||
'REMOTE_USER_COOKIES'
|
'REMOTE_USER_COOKIES',
|
||||||
|
'FILESYSTEM_SESSIONS_ENABLED'
|
||||||
)
|
)
|
||||||
|
|
||||||
legal_envvars_int = ('PORT', 'MAIL_PORT', 'SAML_METADATA_CACHE_LIFETIME')
|
legal_envvars_int = ('PORT', 'MAIL_PORT', 'SAML_METADATA_CACHE_LIFETIME')
|
||||||
@ -65,7 +66,8 @@ legal_envvars_bool = (
|
|||||||
'SAML_LOGOUT',
|
'SAML_LOGOUT',
|
||||||
'SAML_ASSERTION_ENCRYPTED',
|
'SAML_ASSERTION_ENCRYPTED',
|
||||||
'OFFLINE_MODE',
|
'OFFLINE_MODE',
|
||||||
'REMOTE_USER_ENABLED'
|
'REMOTE_USER_ENABLED',
|
||||||
|
'FILESYSTEM_SESSIONS_ENABLED'
|
||||||
)
|
)
|
||||||
|
|
||||||
# import everything from environment variables
|
# import everything from environment variables
|
||||||
|
@ -4,6 +4,7 @@ from flask import Flask
|
|||||||
from flask_seasurf import SeaSurf
|
from flask_seasurf import SeaSurf
|
||||||
from flask_mail import Mail
|
from flask_mail import Mail
|
||||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
from flask_session import Session
|
||||||
|
|
||||||
from .lib import utils
|
from .lib import utils
|
||||||
|
|
||||||
@ -78,6 +79,12 @@ def create_app(config=None):
|
|||||||
from flask_sslify import SSLify
|
from flask_sslify import SSLify
|
||||||
_sslify = SSLify(app) # lgtm [py/unused-local-variable]
|
_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
|
# SMTP
|
||||||
app.mail = Mail(app)
|
app.mail = Mail(app)
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ BIND_ADDRESS = '0.0.0.0'
|
|||||||
PORT = 9191
|
PORT = 9191
|
||||||
HSTS_ENABLED = False
|
HSTS_ENABLED = False
|
||||||
OFFLINE_MODE = False
|
OFFLINE_MODE = False
|
||||||
|
FILESYSTEM_SESSIONS_ENABLED = False
|
||||||
|
|
||||||
### DATABASE CONFIG
|
### DATABASE CONFIG
|
||||||
SQLA_DB_USER = 'pda'
|
SQLA_DB_USER = 'pda'
|
||||||
|
@ -27,3 +27,4 @@ pytimeparse==1.1.8
|
|||||||
PyYAML==5.3.1
|
PyYAML==5.3.1
|
||||||
Flask-SSLify==0.1.5
|
Flask-SSLify==0.1.5
|
||||||
Flask-Mail==0.9.1
|
Flask-Mail==0.9.1
|
||||||
|
flask-session==0.3.2
|
Loading…
x
Reference in New Issue
Block a user