Fixed issue with "de-pickling" of flask session
Having a gitignore-everything ("*") file within a flask session folder seems to cause a weird bug where the state of the app becomes unusable from continuously trying to prune files listed in the gitignore (and it can't prune '*').
This commit is contained in:
parent
d375e6d5de
commit
60a1cf24b9
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -6,6 +6,7 @@ __pycache__/
|
||||||
config.json
|
config.json
|
||||||
test/static
|
test/static
|
||||||
flask_session/
|
flask_session/
|
||||||
|
app/static/config
|
||||||
|
|
||||||
# pip stuff
|
# pip stuff
|
||||||
build/
|
build/
|
||||||
|
|
|
@ -6,7 +6,7 @@ import os
|
||||||
|
|
||||||
app = Flask(__name__, static_folder=os.path.dirname(os.path.abspath(__file__)) + '/static')
|
app = Flask(__name__, static_folder=os.path.dirname(os.path.abspath(__file__)) + '/static')
|
||||||
app.user_elements = {}
|
app.user_elements = {}
|
||||||
app.config['SECRET_KEY'] = os.urandom(128)
|
app.config['SECRET_KEY'] = os.urandom(16)
|
||||||
app.config['SESSION_TYPE'] = 'filesystem'
|
app.config['SESSION_TYPE'] = 'filesystem'
|
||||||
app.config['VERSION_NUMBER'] = '0.1.4'
|
app.config['VERSION_NUMBER'] = '0.1.4'
|
||||||
app.config['APP_ROOT'] = os.getenv('APP_ROOT', os.path.dirname(os.path.abspath(__file__)))
|
app.config['APP_ROOT'] = os.getenv('APP_ROOT', os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
@ -15,6 +15,9 @@ app.config['CONFIG_PATH'] = os.getenv('CONFIG_VOLUME', app.config['STATIC_FOLDER
|
||||||
app.config['SESSION_FILE_DIR'] = app.config['CONFIG_PATH']
|
app.config['SESSION_FILE_DIR'] = app.config['CONFIG_PATH']
|
||||||
app.config['SESSION_COOKIE_SECURE'] = True
|
app.config['SESSION_COOKIE_SECURE'] = True
|
||||||
|
|
||||||
|
if not os.path.exists(app.config['CONFIG_PATH']):
|
||||||
|
os.makedirs(app.config['CONFIG_PATH'])
|
||||||
|
|
||||||
sess = Session()
|
sess = Session()
|
||||||
sess.init_app(app)
|
sess.init_app(app)
|
||||||
|
|
||||||
|
|
1
app/static/config/.gitignore
vendored
1
app/static/config/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
*
|
|
Loading…
Reference in New Issue
Block a user