Use 'permanent' session with a timeout
This commit is contained in:
@@ -51,9 +51,12 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
User=divault
|
User=divault
|
||||||
WorkingDirectory=/srv/staticshield
|
WorkingDirectory=/srv/staticshield
|
||||||
Environment=FLASK_SERVE_DIR="/srv/a_static_website/html"
|
#StandardOutput=file:/srv/logs/staticshield.log
|
||||||
|
Environment=FLASK_SERVE_DIR="/srv/some_static_website/html"
|
||||||
Environment=FLASK_MOTHERSHIP="https://api.example.com/api/staticshield"
|
Environment=FLASK_MOTHERSHIP="https://api.example.com/api/staticshield"
|
||||||
Environment=FLASK_SESSION_COOKIE_NAME="staticshield"
|
Environment=FLASK_SESSION_COOKIE_NAME="staticshield"
|
||||||
|
# Max session length of 2h
|
||||||
|
Environment=FLASK_PERMANENT_SESSION_LIFETIME=7200
|
||||||
ExecStart=/application/venvs/staticshield/bin/gunicorn -b localhost:8000 -w 4 staticshield:app
|
ExecStart=/application/venvs/staticshield/bin/gunicorn -b localhost:8000 -w 4 staticshield:app
|
||||||
#ExecStart=/application/venvs/staticshield/bin/gunicorn -b unix:staticshield.sock -m 007 -w 4 staticshield:app
|
#ExecStart=/application/venvs/staticshield/bin/gunicorn -b unix:staticshield.sock -m 007 -w 4 staticshield:app
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ dictConfig({
|
|||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config.from_prefixed_env()
|
app.config.from_prefixed_env()
|
||||||
app.config['SESSION_PERMANENT'] = False
|
app.config['SESSION_PERMANENT'] = True
|
||||||
app.config['SESSION_TYPE'] = 'filesystem'
|
app.config['SESSION_TYPE'] = 'filesystem'
|
||||||
Session(app)
|
Session(app)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user