No description
Find a file
nagelm 49189465d2 fix(db): pin session timezone to UTC via libpq startup packet
DB sessions were never actually pinned to UTC. Three stacked failures:

1. The connection_created receiver (_force_utc0 in core/apps.py) was a
   nested closure connected with Django's default weak reference. It was
   garbage-collected as soon as CoreConfig.ready() returned, so
   SET TIME ZONE 'UTC0' fired into a dead weakref and never executed -
   in any version since it landed (verified: the signal's receivers list
   on a live 0.27.2 shows a dead weakref).

2. Sessions were UTC on older stacks anyway because Django's own
   init_connection_state configured the timezone. Since native
   psycopg-pool support (Django 5.1+), that path is gated on
   `not self.pool` - and the geventpool mixin's `pool` property is
   always truthy, so Django silently skips timezone (and role)
   configuration for this backend on every connection. This is what
   actually regressed at the psycopg2->3 / Django upgrade: the masking
   layer disappeared, not the (already dead) signal.

3. psycopg3 logs "unknown PostgreSQL timezone: 'UTC0'" because the
   POSIX spec is unresolvable in Python zoneinfo (cosmetic, but it
   means 'UTC0' buys nothing on psycopg3).

Net effect: every session ran at the server-default timezone (verified
live: SHOW TimeZone through the pool returns 'Etc/UTC'). Deployments
whose Postgres default is non-UTC (e.g. /etc/localtime bind-mounts,
the original issue 651 report) get the EPG offset corruption back.

Fix: pin the GUC in the libpq startup packet in the pool backend's
get_connection_params():

- covers every connection the gevent pool creates; no signal, GC, or
  Django-flow dependency (same pattern as the client_encoding pin the
  pool already applies)
- startup-packet GUCs are the session default: they survive ROLLBACK,
  and RESET TimeZone returns to UTC rather than the server default
- 'UTC' resolves cleanly in psycopg3's zoneinfo lookup, and PostgreSQL
  resolves it against its own bundled tzdata, not host-mounted files

The dead signal is removed. Regression tests exercise the session
timezone through the real pool backend explicitly (the test runner's
default engine is the vanilla Django backend), and assert the
RESET-returns-to-UTC session-default property.

Tested: live 0.27.2 AIO (psycopg 3.3.4, PostgreSQL 17) - unpatched
backend+pool session shows 'Etc/UTC'; patched shows 'UTC' incl. after
RESET and ROLLBACK. Full A/B against the dev image with the server
default forced to Europe/Zurich: stock renders a 12:00Z source
programme as start="20260715140000 +0000" in /output/epg; patched
renders it correctly; the regression tests fail on stock and pass
when patched.
2026-07-15 10:20:38 +12:00
.github
.idea
apps tests: Fix backend timeshift test. 2026-07-13 23:31:31 +00:00
core fix(db): pin session timezone to UTC via libpq startup packet 2026-07-15 10:20:38 +12:00
dispatcharr fix(db): pin session timezone to UTC via libpq startup packet 2026-07-15 10:20:38 +12:00
docker
docs/images
frontend chore(changelog): update CHANGELOG.md to reflect recent enhancements in unit tests and Backup Manager functionality 2026-07-12 14:35:05 +00:00
scripts
tests
.dockerignore
.gitattributes
.gitignore
.python-version
CHANGELOG.md fix(timeshift): enhance session handling and playback logic 2026-07-12 21:09:40 +00:00
CONTRIBUTING.md
debian_install.sh
fixtures.json
LICENSE
manage.py
Plugin_repo.md
Plugins.md
pyproject.toml
README.md
version.py

🎬 Dispatcharr — Your Ultimate IPTV & Stream Management Companion

Dispatcharr Logo


📖 What is Dispatcharr?

Dispatcharr (pronounced like "dispatcher") is an open-source powerhouse for managing IPTV streams, EPG data, and VOD content with elegance and control.
Born from necessity and built with passion, it started as a personal project by OkinawaBoss and evolved with contributions from legends like dekzter, SergeantPanda and Bucatini.

Think of Dispatcharr as the *arr family's IPTV cousin — simple, smart, and designed for streamers who want reliability and flexibility.


🎯 What Can I Do With Dispatcharr?

Dispatcharr empowers you with complete IPTV control. Here are some real-world scenarios:

💡 Consolidate Multiple IPTV Sources
Combine streams from multiple providers into a single interface. Manage, filter, and organize thousands of channels with ease.

📺 Integrate with Media Centers
Use HDHomeRun emulation to add virtual tuners to Plex, Emby, or Jellyfin. They'll discover Dispatcharr as a live TV source and can record programs directly to their own DVR libraries.

📡 Create a Personal TV Ecosystem
Merge live TV channels with custom EPG guides. Generate XMLTV schedules or use auto-matching to align channels with existing program data. Export as M3U, Xtream Codes API, or HDHomeRun device.

🔧 Transcode & Optimize Streams
Configure output profiles with FFmpeg transcoding to optimize streams for different clients (reduce bandwidth, standardize formats, or add audio normalization).

🔐 Centralize VPN Access
Run Dispatcharr through a VPN container (like Gluetun) so all streams route through a single VPN connection. Your clients access geo-blocked content without needing individual VPNs, reducing bandwidth overhead and simplifying network management.

🚀 Monitor & Manage in Real-Time
Track active streams, client connections, and bandwidth usage with live statistics. Monitor buffering events and stream quality. Automatic failover keeps viewers connected when streams fail—seamlessly switching to backup sources without interruption.

👥 Share Access Safely
Create multiple user accounts with granular permissions. Share streams via M3U playlists or Xtream Codes API while controlling which users access which channels, profiles, or features. Network-based access restrictions available for additional security.

🔌 Extend with Plugins
Build custom integrations using Dispatcharr's robust plugin system. Automate tasks, connect to external services, or add entirely new workflows.


Why You'll Love Dispatcharr

Stream Proxy & Relay — Intercept and proxy IPTV streams with real-time client management
M3U & Xtream Codes — Import, filter, and organize playlists with multiple backend support
EPG Matching & Generation — Auto-match EPG to channels or generate custom TV guides
Video on Demand — Stream movies and TV series with rich metadata and IMDB/TMDB integration
Multi-Format Output — Export as M3U, XMLTV EPG, Xtream Codes API, or HDHomeRun device
Real-Time Monitoring — Live connection stats, bandwidth tracking, and automatic failover
Stream Profiles — Configure how Dispatcharr connects to backend streams (VLC, FFmpeg, Streamlink, or custom commands)
Output Profiles — Transcode what stream profiles deliver before it reaches the client (e.g. AC3 for media servers, AAC for browsers) with fMP4 or MPEG-TS container selection
Multi-User & Access Control — Granular permissions and network-based access restrictions
Plugin System — Extend functionality with custom plugins for automation and integrations
Fully Self-Hosted — Total control, no third-party dependencies


Screenshots

Channels TV Guide Stats & Monitoring M3U & EPG Manager VOD Library Settings

🛠️ Troubleshooting & Help


🚀 Get Started in Minutes

docker pull ghcr.io/dispatcharr/dispatcharr:latest
docker run -d \
  -p 9191:9191 \
  --name dispatcharr \
  -v dispatcharr_data:/data \
  ghcr.io/dispatcharr/dispatcharr:latest

Customize ports and volumes to fit your setup.


🐋 Docker Compose Options

Use Case File Description
All-in-One Deployment docker-compose.aio.yml Recommended! A simple, all-in-one solution — everything runs in a single container for quick setup.
Modular Deployment docker-compose.yml Separate containers for Dispatcharr, Celery, Redis, and Postgres — perfect if you want more granular control.
Development Environment docker-compose.dev.yml Developer-friendly setup with pre-configured ports and settings for contributing and testing.

🛠️ Building from Source

⚠️ Warning: Not officially supported — but if you're here, you know what you're doing!

If you are running a Debian-based OS, use the debian_install.sh script. For other OS, contribute a script and well add it!


🤝 Want to Contribute?

We welcome PRs, issues, ideas, and suggestions!

Whether it's writing docs, squashing bugs, or building new features, your contribution matters! 🙋


📚 Documentation & Roadmap

Upcoming Features (in no particular order):

  • 🎬 VOD Management Enhancements — Granular metadata control and cleanup of unwanted VOD content
  • 📁 Media Library — Import local files and serve them over XC API
  • 👥 Enhanced User Management — Customizable XC API output per user account
  • 🔌 Fallback Videos — Automatic fallback content when channels are unavailable

❤️ Shoutouts

A huge thank you to all the incredible open-source projects and libraries that power Dispatcharr. We stand on the shoulders of giants!


✉️ Connect With Us

Have a question? Want to suggest a feature? Just want to say hi?
➡️ Open an issue or reach out on Discord.


💖 Support Dispatcharr

Dispatcharr Open Collective

Open Collective provides a transparent way for anyone who finds value in Dispatcharr to support things like: • Infrastructure costs (Domains, Servers, etc.) • Apple Developer Program and Google Play Developer accounts • Helping contributors dedicate more time to improving the project

Support is completely optional, and Dispatcharr will always remain free and open-source.

Contribute here


Dispatcharr is licensed under GNU AGPL v3.0: For full license details, see LICENSE.

Dispatcharr is a trademark of the Dispatcharr project. Use of the Dispatcharr name or logo requires permission from the maintainers.


🚀 Happy Streaming! The Dispatcharr Team