Commit graph

347 commits

Author SHA1 Message Date
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
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
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
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
Matt Grutza
8c2ffbe76a CELERY_NICE_LEVEL warning
Changed the celery entrypoint to include a warning if CELERY_NICE_LEVEL is negative AND SYS_NICE is not configured (SYS_NICE is required for negative levels)
2026-01-21 17:59:23 -06:00
Matt Grutza
7a46577d2e Remove health check conditions
Not supported on compose v3+
2026-01-21 17:46:07 -06:00
Matt Grutza
236b2307e1 Add health check and fix dangerous checks
- docker-compose: added service health checks

- dockerfile: added if logic for sed command so missing files do not cause build fail

- entrypoint.celery: change migration detection to not continue until ALL migrations are applied

- entrypoint: trim django key and change external postgres check to python in case postgres binaries are missing
2026-01-21 17:40:36 -06:00
Matt Grutza
3706e63bed feat: Add DISPATCHARR_ENV=modular support for multi-container deployments
- docker/entrypoint.sh: Conditional PostgreSQL init/startup for modular mode
- docker/entrypoint.celery.sh: New dedicated entrypoint for celery container - prevents race condition in modular deployment
- docker/uwsgi.modular.ini: New uWSGI config without Redis/Celery daemons
- docker/Dockerfile: Add line ending fixes and chmod for entrypoints - adds cross-platform support for image builds
- docker/docker-compose.yml: Configure modular mode with DISPATCHARR_ENV - uses new celery entrypoint and adds depends_on to prevent race condition
2026-01-21 11:14:28 -06:00
Mattias Svensson
cbb8a52163 Fix: nginx startup failure due to group name mismatch
The script was creating a group named 'dispatch' (hardcoded) while
nginx.conf expected a group matching POSTGRES_USER (e.g., 'dispatcharr').

Changes:
- Use $POSTGRES_USER for group name instead of hardcoded 'dispatch'
- Make sed command more robust to match any existing user directive

This ensures the group name matches the user name, fixing the error:
"getgrnam("dispatcharr") failed in /etc/nginx/nginx.conf:1"

Fixes #877

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 08:04:49 +01:00
Jeffrey C
91d73a1fe8
fix: stabilize build-dev paths and push behavior 2026-01-17 15:00:09 -06:00
SergeantPanda
38fa0fe99d Bug Fix: Fixed NumPy baseline detection in Docker entrypoint. Now calls numpy.show_config() directly with case-insensitive grep instead of incorrectly wrapping the output.
Some checks are pending
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
2026-01-14 17:10:06 -06:00
SergeantPanda
6d5d16d667 Enhancement: Add check for existing NumPy baseline support before reinstalling legacy NumPy to avoid unnecessary installations. 2026-01-12 12:29:54 -06:00
SergeantPanda
ad334347a9 More cleanup of base image.
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-08 14:52:58 -06:00
SergeantPanda
d6c1a2369b Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/patchy8736/823 2026-01-08 13:27:42 -06:00
SergeantPanda
1a2d39de91 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into dev 2026-01-08 10:28:15 -06:00
SergeantPanda
f389420251 Add optional legacy NumPy support for older CPUs in Docker configurations 2026-01-08 10:27:58 -06:00
patchy8736
0441dd7b7e Bug Fix: Add socket-timeout to uWSGI production config to prevent VOD stream timeouts during client buffering
The production uWSGI configuration (docker/uwsgi.ini) was missing the socket-timeout directive, causing it to default to 4 seconds. When clients (e.g., VLC) buffer VOD streams and temporarily stop reading from the HTTP socket, uWSGI's write operations timeout after 4 seconds, triggering premature stream cleanup and causing VOD streams to disappear from the stats page.

The fix adds socket-timeout = 600 to match the existing http-timeout = 600 value, giving uWSGI sufficient time to wait for clients to resume reading from buffered sockets. This prevents:
- uwsgi_response_write_body_do() TIMEOUT !!! errors in logs
- GeneratorExit exceptions and premature stream cleanup
- VOD streams vanishing from the stats page when clients buffer

The debug config already had socket-timeout = 3600, which is why the issue wasn't observed in debug mode. This fix aligns production behavior with the debug config while maintaining the production-appropriate 10-minute timeout duration.
2026-01-07 14:10:17 +01:00
SergeantPanda
518c93c398 Enhance Docker setup for legacy NumPy support and streamline installation process 2026-01-06 14:07:37 -06:00
sethwv-alt
b157159b87
Fix root-owned __pycache__ by running Django commands as non-root user 2025-12-31 12:16:19 -05:00
SergeantPanda
523a127c81 Enhancement: Add VLC dependencies to DispatcharrBase image.
Some checks failed
Base Image Build / prepare (push) Has been cancelled
Build and Push Multi-Arch Docker Image / build-and-push (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
2025-12-24 15:48:56 -06:00
SergeantPanda
18645fc08f Bug Fix: Re-apply failed merge to fix clients that don't have ipv6 support. 2025-12-22 16:39:09 -06:00
SergeantPanda
20182c7ebf
Merge branch 'main' into dev 2025-12-19 17:53:06 -06:00
SergeantPanda
f0a9a3fc15 Bug Fix: Docker init script now validates DISPATCHARR_PORT is an integer before using it, preventing sed errors when Kubernetes sets it to a service URL like tcp://10.98.37.10:80. Falls back to default port 9191 when invalid (Fixes #737) 2025-12-19 17:00:30 -06:00