diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index b2d582986..859254091 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -9,10 +9,10 @@ runs: sudo apt-get update \ && sudo apt-get install -y --no-install-recommends \ libcurl4-openssl-dev - - name: Set up Python 3.12 + - name: Set up Python 3.12.2 uses: actions/setup-python@v4 with: - python-version: "3.12" + python-version: "3.12.2" - name: Install poetry shell: bash run: pip install poetry diff --git a/Makefile b/Makefile index ab8e3178a..90e8e76de 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ bootstrap: generate-version-file ## Set up everything to run the app poetry install --sync --no-root poetry run playwright install --with-deps poetry run pre-commit install - source $(NVMSH) --no-use && nvm install && npm ci --no-audit - source $(NVMSH) && npm install + source $(NVMSH) --no-use && nvm install && npm install + source $(NVMSH) && npm ci --no-audit source $(NVMSH) && npm run build .PHONY: watch-frontend diff --git a/app/__init__.py b/app/__init__.py index e99a5ae51..76f3664cd 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -233,6 +233,24 @@ def create_app(application): ) logging.init_app(application) + # Hopefully will help identify if there is a race condition causing the CSRF errors + # that we have occasionally seen in our environments. + for key in ("SECRET_KEY", "DANGEROUS_SALT"): + try: + value = application.config[key] + except KeyError: + application.logger.error(f"Env Var {key} doesn't exist.") + else: + try: + data_len = len(value.strip()) + except (TypeError, AttributeError): + application.logger.error(f"Env Var {key} invalid type: {type(value)}") + else: + if data_len: + application.logger.info(f"Env Var {key} is a non-zero length.") + else: + application.logger.error(f"Env Var {key} is empty.") + login_manager.login_view = "main.sign_in" login_manager.login_message_category = "default" login_manager.session_protection = None diff --git a/poetry.lock b/poetry.lock index e443c634e..9b993cc2c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3111,5 +3111,5 @@ files = [ [metadata] lock-version = "2.0" -python-versions = "^3.12.2" -content-hash = "b45f2c38493f81bd7fc9d4bfd294b001d71e4082380eb0851d4f3ea8dcdb949c" +python-versions = "==3.12.2" +content-hash = "13525f32422aad8324a3bcb3629d326cc847029800d5518e1efd047b887afa8b" diff --git a/pyproject.toml b/pyproject.toml index 4dd46365a..fbeb26903 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" package-mode = false [tool.poetry.dependencies] -python = "^3.12.2" +python = "==3.12.2" ago = "~=0.0.95" beautifulsoup4 = "^4.12.3" blinker = "~=1.8" diff --git a/runtime.txt b/runtime.txt index 64f28603a..6e797d468 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.12.x +python-3.12.2