Commit graph

366 commits

Author SHA1 Message Date
SergeantPanda
456f9ef6e6
Merge pull request #1145 from Dispatcharr/user-priority-fixes
User stream limits
2026-03-27 14:18:38 -05:00
SergeantPanda
9c9de12b19 chore: remove unnecessary python-is-python3, python3-pip and streamlink from Dockerfile dependencies 2026-03-27 11:49:28 -05:00
dekzter
90a600b48f merged in dev 2026-03-26 12:17:43 -04:00
SergeantPanda
cee94282f9
Merge pull request #1128 from CodeBormen/dev
Some checks failed
CI Pipeline / prepare (push) Has been cancelled
Build and Push Multi-Arch Docker Image / build-and-push (push) Has been cancelled
Frontend Tests / test (push) Has been cancelled
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Has been cancelled
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Has been cancelled
CI Pipeline / create-manifest (push) Has been cancelled
feat: add TLS connection support for Redis and PostgreSQL (#950)
2026-03-24 18:56:57 -05:00
SergeantPanda
58f40ff276 Bug Fix: Fixed stale references to old guideutils location. Also change dockerfile to get clear error messages during failure. 2026-03-24 13:19:48 -05:00
SergeantPanda
9da6f7794c fix: ensure PGID defaults to PUID when setting ownership for PostgreSQL SSL key (matching entrypoint.celery behavior. 2026-03-23 18:26:52 -05:00
None
b30a24e2fb feat: add TLS connection support for Redis and PostgreSQL (#950)
- Add 10 env vars for Redis/PostgreSQL TLS (REDIS_SSL, REDIS_SSL_VERIFY, REDIS_SSL_CA_CERT, REDIS_SSL_CERT, REDIS_SSL_KEY, POSTGRES_SSL, POSTGRES_SSL_MODE, POSTGRES_SSL_CA_CERT, POSTGRES_SSL_CERT, POSTGRES_SSL_KEY)
- Propagate SSL params to all Redis connection points: RedisClient, stream view, PubSub, client manager, Celery broker/result backend, Django Channels, and pre-Django startup scripts
- Add Celery SSL config via URL query string params (required by Kombu's internal URL parsing)
- Add PostgreSQL sslmode and certificate options to DATABASES config
- Add startup validation: cert file existence, URL scheme conflict detection, TLS status logging
- Add TLS error hints to Redis connection failure messages
- Add Connection Security panel in System Settings (modular mode only) showing encryption, verification, and mTLS status
- Add PG client key permission fix in web and celery entrypoints for Docker Desktop compatibility (0777 to 0600)
- Add TLS env var passthrough in entrypoint for su - login shells
- Document TLS env vars in modular docker-compose.yml
- Change env_mode from dev/prod to actual DISPATCHARR_ENV value for modular mode detection
2026-03-21 17:24:09 -05:00
None
7e22172070 fix: remove PUID auto-detect
The auto-detect read PUID/PGID from /data/db ownership (UID 102 in pre-PUID images), causing all upgrading users to run as UID 102 instead of the expected UID 1000. This broke host-side access (SSH, WinSCP), made existing DATA_DIR files unwritable, and failed comskip on recordings created before the change.
2026-03-17 19:32:07 -05:00
None
9e720f4fc7 fix: handle chown failures gracefully on external mounts
DATA_DIRS chown failures (NFS, SMB/CIFS, FUSE) crashed the container under set -e. The old image never chowned these directories, so users with external mounts had a working setup that broke on upgrade with zero config changes.

- Collect mkdir and chown failures per-directory instead of crashing
- Emit a single consolidated warning listing all affected directories with current ownership and remediation steps
- Container continues to start; Django reports at runtime if it cannot write to a specific directory
- Local volumes are unaffected: chown still runs and succeeds silently
2026-03-17 18:27:19 -05:00
None
19d3f4258f Add /data/backups to DATA_DIRS
Corrects issue with user ownership migration on previous installations with /data/backups in-use
2026-03-17 17:46:13 -05:00
SergeantPanda
cc5a0eb7f7
Merge pull request #929 from jcasimir/fix/uwsgi-gevent-segfault-clean
Fix uWSGI segfaults by disabling threads when using gevent
2026-03-15 17:45:24 -05:00
SergeantPanda
03e1061716 Bug Fix: Fix postgres lock file permissions before starting and upgrading Postgres. 2026-03-13 14:59:46 -05:00
dekzter
f69a462253 merged in dev 2026-03-13 08:22:44 -04:00
None
29525336ab replace migration port and correct variable quoting for guarding
- replaced $_pg_tmp_port with $POSTRGES_PORT in migration logic. Works because "pg_ctl stop -w" is run before entrypoint.sh restarts postgres. Verified that this does not cause a race condition.

- Correcting unquoted environment variables to prevent inappropriate variables from causing execution inconsistencies (still unquoted in comments and prints)
2026-03-12 20:25:54 -05:00
SergeantPanda
a1a2b3332f Declare CONNECT_ROLE and CONNECT_DB as local variables in promote_app_role function 2026-03-12 18:38:04 -05:00
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
None
bb2c3c228d Fix stale env vars in profile.d on container restart
- Rewrite /etc/profile.d/dispatcharr.sh on every startup instead of only on first run, so container restarts with changed env vars pick up new values
- Quote exported values to prevent breakage from special characters in POSTGRES_PASSWORD or other vars
- Update /etc/environment entries instead of skipping if already present
2026-03-06 15:27:19 -06:00
None
4f41c287ac Fix Redis flush and wait_for_redis in modular mode
- Move modular Redis wait from uWSGI exec-pre to entrypoint (exec-pre runs under 'su -' which strips Docker env vars, so DISPATCHARR_ENV and REDIS_HOST were never available)
- Selective flush in modular mode: clears stale app state (stream locks, proxy metadata) while preserving Celery broker/result keys
- AIO mode unchanged: full flushdb via uWSGI exec-pre
- Update unit tests for both flush paths
2026-03-06 15:17:32 -06:00
None
6ff81e6287 Fix modular mode deployment issues (#1045)
- Fix Postgres version check failing with restricted DB users (use $POSTGRES_DB instead of hardcoded 'postgres')
- Fix DVR recording broken in modular mode (respect DISPATCHARR_PORT instead of hardcoding 9191)
- Remove flushdb() from wait_for_redis.py to prevent Redis data loss on container restart
- Add DISPATCHARR_PORT to celery environment in docker-compose.yml
- Add depends_on health conditions for proper service startup ordering
- Add extra_hosts for host.docker.internal resolution on Linux
- Harden celery entrypoint with timeouts for JWT wait (120s) and migration wait (300s)
- Replace fragile showmigrations grep with migrate --check
- Add unit tests for DVR port resolution and flushdb removal regression
2026-03-03 17:18:16 -06:00
SergeantPanda
393bfd384c
Merge pull request #1028 from Dispatcharr/dev
Dispatcharr - v0.20.0
2026-02-26 14:05:41 -06:00
dekzter
d5349dcf4f create scripts directory 2026-02-26 14:07:34 -05:00
dekzter
6f4665e6eb merged in dev 2026-02-26 08:20:20 -05:00
SergeantPanda
9ada98936a
Merge pull request #996 from MotWakorb/patch-1
Some checks failed
Build and Push Multi-Arch Docker Image / build-and-push (push) Has been cancelled
Add restart policy to dispatcharr container
2026-02-19 14:39:54 -06:00
SergeantPanda
740ec733d1
Merge pull request #998 from MotWakorb/patch-3
Add restart policy to Docker services
2026-02-19 14:39:26 -06:00
MotWakorb
39f2f8f970
Add restart policy to Docker services
Adding a restart policy so that the default recommendation is to use unless-stopped.
2026-02-19 12:44:07 -06:00
MotWakorb
dd0f5e0b00
Add restart policy to Docker services
Adding a restart policy so that the default recommendation is to use unless-stopped.
2026-02-19 12:43:17 -06:00
MotWakorb
e7d4dbd637
Add restart policy to dispatcharr container
Adding a restart policy so that the default recommendation is to use unless-stopped.
2026-02-19 12:41:58 -06:00
SergeantPanda
daba81037d
Merge pull request #974 from patrickjmcd/main
fix: add support for legacy numpy in celery entrypoint
2026-02-17 10:44:15 -06:00
Patrick McDonagh
b1376386d5
docs: add legacy NumPy support instructions in docker-compose 2026-02-17 09:50:50 -06:00
Patrick McDonagh
a52b3dfbe5
fix: add support for legacy numpy in celery entrypoint 2026-02-12 13:08:25 -06:00
None
39646f0b01 Fix modular mode PostgreSQL/Redis connection checks
Replace raw Python AF_INET socket checks with pg_isready (PostgreSQL) and socket.create_connection (Redis) in modular deployment mode

The raw socket check may fail in some Docker environments depending on networking and DNS configurations, causing indefinite hangs. Replaced database check with native pg_isready
and memstore checck with AF_UNSPEC in the case IPv6 is enabled.

Fixes #952
2026-02-10 23:00:35 -06:00
SergeantPanda
8e7139f3af Re-add note to uncomment the following lines for nvidia. 2026-02-09 17:27:52 -06:00
None
e217960500 feat: Add Redis authentication support for modular deployment
Add support for authentication when connecting to external Redis instances in modular deployment mode. This enables secure Redis deployments using either password-only authentication (Redis <6) or
username + password authentication (Redis 6+ ACL).

Changes:
- Add REDIS_PASSWORD and REDIS_USER environment variables
- Implement URL encoding for special characters in passwords
- Update all Redis connection points to support auth
- Add comprehensive documentation and examples to docker-compose.yml
- Maintains full backward compatibility (empty defaults = no auth)

All authentication mechanisms have been fully tested including pasword-only authentication, Redis 6+ ACL authentication with username + password, volume-mounted configuration files, and special character handling.

Existing deployments are not effected, authentication support is entirely opt-in using docker-compose.

Also, acknowledging the fact that the docker-compose file for modular deployments has been getting out of hand with auth support, the docker-compose.yml file was re-formatted for better visibility in configuration. This seemed like a better way to go than mandating a .env file.
2026-02-03 21:42:06 -06:00
SergeantPanda
fb8c831f1b
Merge pull request #881 from CodeBormen/fix-modular-compose-deployment
feat: Add DISPATCHARR_ENV=modular support for multi-container deployment
2026-02-03 09:49:07 -06:00
Jeff Casimir
4796184a67 Fix uWSGI segfaults by disabling threads when using gevent
Mixing threading and gevent concurrency models causes uWSGI workers to
crash with segmentation faults, particularly on ARM64/Python 3.13.

The production uwsgi.ini was already correct (gevent without threads).
This fixes the dev and debug configs to match.

References:
- https://github.com/gevent/gevent/issues/1784
- https://github.com/unbit/uwsgi/issues/2457

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:02:39 -07:00
None
762949e983 Update verbiage for consistency 2026-01-31 20:48:54 -06:00
None
8eef088950 Add PostgreSQL version check for modular deployments
Implements automatic version validation for external databases in modular mode to ensure compatibility.

Changes:
- Added check_external_postgres_version() in 02-postgres.sh
- Integrated version check in entrypoint.sh after database connection
- Enforces minimum PostgreSQL version matching DispatcharrBase
- Allows newer versions with forward compatibility notice
- Rejects older versions with clear upgrade instructions

The version requirement automatically scales when DispatcharrBase is updated, requiring no manual maintenance. Only applies to modular deployments using external databases; AIO deployments are unaffected.

Tested and verified correct behavior with PostgreSQL v17, v18, and v16
2026-01-31 20:45:39 -06:00
SergeantPanda
bdcc865b9d Bug Fix: Fixed NumPy baseline detection in Docker entrypoint. Now properly detects when NumPy crashes on import due to CPU baseline incompatibility and installs legacy NumPy version. Previously, if NumPy failed to import, the script would skip legacy installation assuming it was already compatible.
Some checks failed
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Base Image Build / prepare (push) Has been cancelled
Base Image Build / docker (amd64, ubuntu-24.04) (push) Has been cancelled
Base Image Build / docker (arm64, ubuntu-24.04-arm) (push) Has been cancelled
Base Image Build / create-manifest (push) Has been cancelled
2026-01-30 16:35:56 -06:00
SergeantPanda
256d19a2cc Move legacy numpy install to after init-dev. UV replaces. 2026-01-30 12:45:11 -06:00
SergeantPanda
68879ea933 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/tobimichael96/885 2026-01-30 12:37:07 -06:00
SergeantPanda
a3ed1d9628 Refactor for uv transition. 2026-01-30 12:12:42 -06:00
SergeantPanda
3a959c2743 Fixed pip download (uv doesn't have an equivalent) 2026-01-29 16:15:04 -06:00
SergeantPanda
64f0b53ded Bump modular postgres to 17 from 14 to match AIO. 2026-01-29 10:42:34 -06:00
SergeantPanda
8de22fc44d Indent modular if statement for readability. 2026-01-29 10:22:07 -06:00
SergeantPanda
bd1e0e8f07 Bug fix: Admin URL Conflict with XC Streams: Updated nginx configuration to only redirect exact /admin and /admin/ paths to login in production, preventing interference with stream URLs that use "admin" as a username (e.g., /admin/password/stream_id now properly routes to stream handling instead of being redirected). 2026-01-27 14:36:57 -06:00
dekzter
dba70b3c58 outstanding commits, may revisit later 2026-01-27 15:23:07 -05:00
Matt Grutza
47b591bacb Add configurable POSTGRES_PORT and REDIS_PORT for external databases
Make database ports configurable for users with external PostgreSQL/Redis.

- Add POSTGRES_PORT and REDIS_PORT to docker-compose.yml (web and celery)
- Remove hardcoded CELERY_BROKER_URL (Django builds it from components)
- Add REDIS_PORT export to entrypoint.sh and profile variables
- Add Redis connection check for modular mode (matches PostgreSQL pattern)

Users can now specify custom ports for external databases:
  [defaults]
  POSTGRES_PORT=5432
  REDIS_PORT=6379
2026-01-23 21:28:53 -06:00
Matt Grutza
557e192d4c Add UTF8 encoding check for external databases
Extend ensure_utf8_encoding() to support both internal and external PostgreSQL.

- Modular mode: Uses TCP connection with PGPASSWORD authentication
- AIO mode: Uses Unix socket as postgres user
- Explicitly set database owner during recreation (fixes missing --owner flag)
- Conversion logic (dump/drop/recreate/restore) works for both AIO and modular modes
- Skip internal PostgreSQL setup entirely when DISPATCHARR_ENV=modular
2026-01-23 19:15:27 -06:00
Tobias Effner
c698916a60 feat: migrate to UV 2026-01-23 22:45:37 +01:00
SergeantPanda
9959e3d353
Merge pull request #878 from s0len/fix/nginx-group-name-mismatch
Fix: nginx startup failure due to group name mismatch
2026-01-22 14:18:57 -06:00