Skip to content

Commit 1e628d5

Browse files
committed
fix: collectstatic race + bump submodule for language switcher hardening
CMS entrypoint - Wipe STATIC_ROOT manually before collectstatic instead of relying on --clear. Django 4.2 ManifestStaticFilesStorage races between --clear and the post-process pass: a deleted hashed file gets re-targeted by the group-id chown step and the entrypoint dies with FileNotFoundError on files like admin/js/vendor/select2/i18n/<lang>.<hash>.js. Doing the wipe out-of-band makes the two phases sequential, not concurrent. This was leaving the Wagtail admin assets partially deployed every time, which is why /admin/ login was broken. - Add 'set -e' so future entrypoint failures actually fail the container instead of silently leaving services in a half-deployed state. Submodule bump - eafw_geomanager_web -> 3df051e (language switcher hardening: wipe localStorage/sessionStorage + hard reload).
1 parent c2e650c commit 1e628d5

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

docker/cms/docker-entrypoint.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
#!/bin/bash
2+
set -e
23

34
# migrate db
45
python manage.py migrate --noinput
56

6-
# collect static files
7-
python manage.py collectstatic --clear --no-input
7+
# Clear the static dir BEFORE collectstatic instead of letting --clear
8+
# do it. Django 4.2 ManifestStaticFilesStorage races between --clear and
9+
# the post-process pass: a deleted hashed file gets re-targeted by the
10+
# group-id chown step and the entrypoint dies with FileNotFoundError on
11+
# files like admin/js/vendor/select2/i18n/<lang>.<hash>.js. Doing the
12+
# wipe out-of-band makes the two phases sequential, not concurrent.
13+
STATIC_ROOT_DIR="${STATIC_ROOT:-/home/app/static}"
14+
if [ -d "$STATIC_ROOT_DIR" ]; then
15+
find "$STATIC_ROOT_DIR" -mindepth 1 -delete 2>/dev/null || true
16+
fi
17+
mkdir -p "$STATIC_ROOT_DIR"
18+
python manage.py collectstatic --no-input
819

920
# ensure environment-variables are available for cronjob
1021
printenv | grep -v "no_proxy" >>/etc/environment

eafw_geomanager_web

0 commit comments

Comments
 (0)