Dispatcharr/docker/init
None 52ed0fc15a fix: run PostgreSQL as PUID/PGID user to resolve ownership conflicts (#1078)
PostgreSQL now runs as the PUID/PGID user ($POSTGRES_USER) instead of the internal postgres system user (UID 102). This fixes container startup failures when PUID/PGID is set, caused by chown permission errors on restricted filesystems (NFS root_squash, CIFS) and UID collisions with the postgres system user.

Changes:
- Run all PostgreSQL operations (initdb, pg_ctl, psql) as $POSTGRES_USER
- Auto-detect PUID/PGID from existing data owner when not explicitly set
- Validate PUID/PGID (reject zero, non-numeric values) before startup
- Migrate existing data ownership with sentinel-based skip optimization
- Use trust auth for local Unix sockets, md5 for network connections
- Add promote_app_role() and ensure_app_database() as idempotent startup guarantees that handle fresh installs, upgrades, and PUID changes
- Preserve postgres role as superuser for rollback compatibility
- Centralize /data/db ownership in 02-postgres.sh (sentinel-aware)
- Add integration test suite (20 scenarios) covering fresh installs, upgrades, restarts, PUID changes, UID collisions, bind mounts, modular mode, PG major upgrades, and end-to-end web UI verification
2026-03-11 23:36:32 -05:00
..
01-user-setup.sh fix: run PostgreSQL as PUID/PGID user to resolve ownership conflicts (#1078) 2026-03-11 23:36:32 -05:00
02-postgres.sh fix: run PostgreSQL as PUID/PGID user to resolve ownership conflicts (#1078) 2026-03-11 23:36:32 -05:00
03-init-dispatcharr.sh fix: run PostgreSQL as PUID/PGID user to resolve ownership conflicts (#1078) 2026-03-11 23:36:32 -05:00
04-check-hwaccel.sh Vastly improved logic for detecting recommended acceleration methods. 2025-05-13 12:32:49 -05:00
99-init-dev.sh Refactor for uv transition. 2026-01-30 12:12:42 -06:00