diff --git a/app_new/config.py b/app_new/config.py index 4a0f81e..6c6dd07 100644 --- a/app_new/config.py +++ b/app_new/config.py @@ -70,7 +70,10 @@ class DevelopmentConfig(Config): class ProductionConfig(Config): """Configuration production.""" DEBUG = False - SESSION_COOKIE_SECURE = True + # HTTPS reste obligatoire par défaut. Le profil de développement Docker + # peut explicitement passer SESSION_COOKIE_SECURE=0 lorsqu'il est exposé + # directement en HTTP, sans modifier le comportement production standard. + SESSION_COOKIE_SECURE = os.environ.get('SESSION_COOKIE_SECURE', '1') == '1' class TestingConfig(Config): """Configuration tests.""" diff --git a/docker-compose.override.yml b/docker-compose.override.yml index b83d90b..dae346f 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -4,6 +4,9 @@ services: GMAO_VERSION: ${GMAO_VERSION:-0.1.0-dev.1} GMAO_GUNICORN_FLAGS: --reload --reload-engine poll FLASK_ENV: development + # Ce profil est servi en HTTP sur le réseau de test ; un cookie Secure + # ne serait jamais renvoyé par le navigateur lors de la connexion. + SESSION_COOKIE_SECURE: "0" volumes: - ./app_new:/app/app_new - ./migrations:/app/migrations