Harden immutable release deployment
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-18 02:31:28 +02:00
parent 611ad0cd57
commit 5699006a5e
20 changed files with 477 additions and 151 deletions
+21
View File
@@ -13,6 +13,27 @@ export YOLO_MODELS_DIR="${YOLO_MODELS_DIR:-/app/models}"
export YOLO_CONFIG_DIR="${YOLO_CONFIG_DIR:-$STORAGE_ROOT/ultralytics}"
export GEOINTEL_RECONCILE_INTERRUPTED_RUNS_ON_STARTUP="${GEOINTEL_RECONCILE_INTERRUPTED_RUNS_ON_STARTUP:-true}"
case "$MAX_UPLOAD_MB" in
''|*[!0-9]*)
echo "GEOINTEL_MAX_UPLOAD_MB must be a whole number between 1 and 2048." >&2
exit 2
;;
esac
if [ "$MAX_UPLOAD_MB" -lt 1 ] || [ "$MAX_UPLOAD_MB" -gt 2048 ]; then
echo "GEOINTEL_MAX_UPLOAD_MB must be between 1 and 2048." >&2
exit 2
fi
case "${GEOINTEL_ENV:-production}:${POSTGRES_PASSWORD}" in
production:|production:geointel|production:postgres|production:password|production:changeme|production:change-me-before-shared-use)
echo "Refusing to start production with an empty or known-default PostGIS password." >&2
exit 2
;;
esac
sed -i "s/__GEOINTEL_MAX_UPLOAD_MB__/${MAX_UPLOAD_MB}/g" /etc/nginx/conf.d/default.conf
nginx -t
mkdir -p "$PGDATA" "$STORAGE_ROOT" "$YOLO_CONFIG_DIR" /run/nginx /var/log/nginx
chown -R postgres:postgres "$PGDATA"