From 6591d1dac79fb8d132f68f98ac2048f747a0a69e Mon Sep 17 00:00:00 2001 From: Jonathan Caicedo Date: Sun, 29 Mar 2026 16:13:50 -0400 Subject: [PATCH 1/3] perf: use PostgreSQL Unix socket for AIO --- docker/entrypoint.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 33fe33dd..ec411fba 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -31,7 +31,12 @@ echo_with_timestamp() { export POSTGRES_DB=${POSTGRES_DB:-dispatcharr} export POSTGRES_USER=${POSTGRES_USER:-dispatch} export POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-secret} -export POSTGRES_HOST=${POSTGRES_HOST:-localhost} +export DISPATCHARR_ENV=${DISPATCHARR_ENV:-aio} +if [[ "$DISPATCHARR_ENV" == "aio" ]]; then + export POSTGRES_HOST=${POSTGRES_HOST:-/var/run/postgresql} +else + export POSTGRES_HOST=${POSTGRES_HOST:-localhost} +fi export POSTGRES_PORT=${POSTGRES_PORT:-5432} export PG_VERSION=$(ls /usr/lib/postgresql/ | sort -V | tail -n 1) export PG_BINDIR="/usr/lib/postgresql/${PG_VERSION}/bin" From d5e6ee0a0dac849e46a6280a323deabb1849e345 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 14 Apr 2026 15:51:40 -0500 Subject: [PATCH 2/3] Enhancement: Use Unix socket if AIO and POSTGRES_HOST is set to loopback. --- docker/entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ec411fba..4154578d 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -33,7 +33,10 @@ export POSTGRES_USER=${POSTGRES_USER:-dispatch} export POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-secret} export DISPATCHARR_ENV=${DISPATCHARR_ENV:-aio} if [[ "$DISPATCHARR_ENV" == "aio" ]]; then - export POSTGRES_HOST=${POSTGRES_HOST:-/var/run/postgresql} + # Use Unix socket for loopback values (unset, localhost, 127.0.0.1) + if [[ -z "$POSTGRES_HOST" || "$POSTGRES_HOST" == "localhost" || "$POSTGRES_HOST" == "127.0.0.1" ]]; then + export POSTGRES_HOST=/var/run/postgresql + fi else export POSTGRES_HOST=${POSTGRES_HOST:-localhost} fi From dbf40fe687877a4a3176bd2da10a8c324062cc4e Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 14 Apr 2026 16:04:24 -0500 Subject: [PATCH 3/3] changelog: changelog for PG socket PR --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d7f93d..f139cbe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- AIO containers now connect to the internal PostgreSQL instance via a Unix domain socket instead of TCP loopback. Users who have `POSTGRES_HOST` explicitly set to `localhost` or `127.0.0.1` in their compose file are automatically migrated to the socket path; any other explicit value (external host/IP) is left untouched. — Thanks [@JCBird1012](https://github.com/JCBird1012) - Improved the EPG response cache key. Previously it was based on the raw query string and username, meaning a user default of `epg_days=7` and an explicit `&days=7` URL parameter produced different cache entries for identical output. The key is now built from all resolved effective parameter values (`days`, `prev_days`, `cachedlogos`, `tvg_id_source`) so semantically equivalent requests always share the same cache entry. - Improved the HDHR, M3U, and EPG URL builder popovers in the Channels table: each popover now opens with a brief intro sentence describing its purpose. Toggle switches were refactored to use Mantine's native `label` and `description` props (replacing the previous manual `Group`/`Stack`/`Text` layout), giving each switch a properly styled description line beneath its label. Switch alignment was also corrected. Toggles now appear on the left with the label and description stacked to the right, consistent with standard Mantine form layout. - Redesigned the User settings modal with a tabbed layout: **Account** (username, email, name, password), **Permissions** (user level, stream limit, channel profiles, mature content filter - admin only), **EPG Defaults** (days forward/back), and **API & XC** (XC password, API key management). Fields are now logically grouped rather than split across two ad-hoc columns.