From 6fccb76e1ade3926e9c823bcbbf48c68e5587afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Tue, 6 Jan 2026 22:44:27 +0100 Subject: [PATCH] Refactor: Dispatcharr (#10599) * Refactor * Oops * add new deps * fix: add new deps --------- Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- ct/dispatcharr.sh | 10 ++++++++ install/dispatcharr-install.sh | 43 +++++++++++----------------------- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/ct/dispatcharr.sh b/ct/dispatcharr.sh index 00e5c3d58..9372555a7 100644 --- a/ct/dispatcharr.sh +++ b/ct/dispatcharr.sh @@ -32,6 +32,16 @@ function update_script() { setup_uv NODE_VERSION="24" setup_nodejs + # Fix for nginx not allowing large files + if ! grep -q "client_max_body_size 100M;" /etc/nginx/sites-available/dispatcharr.conf; then + sed -i '/server_name _;/a \ client_max_body_size 100M;' /etc/nginx/sites-available/dispatcharr.conf + systemctl reload nginx + fi + + if ! dpkg -s vlc-bin vlc-plugin-base &>/dev/null; then + $STD apt update && $STD apt install -y vlc-bin vlc-plugin-base + fi + if check_for_gh_release "Dispatcharr" "Dispatcharr/Dispatcharr"; then msg_info "Stopping Services" systemctl stop dispatcharr-celery diff --git a/install/dispatcharr-install.sh b/install/dispatcharr-install.sh index a4be3d21a..f4a89502c 100644 --- a/install/dispatcharr-install.sh +++ b/install/dispatcharr-install.sh @@ -23,32 +23,16 @@ $STD apt install -y \ redis-server \ ffmpeg \ procps \ + vlc-bin \ + vlc-plugin-base \ streamlink msg_ok "Installed Dependencies" setup_uv NODE_VERSION="24" setup_nodejs PG_VERSION="16" setup_postgresql - -msg_info "Creating PostgreSQL Database" -DB_NAME=dispatcharr_db -DB_USER=dispatcharr_usr -DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)" -$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" -$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" -{ - echo "Dispatcharr Credentials" - echo "Database Name: $DB_NAME" - echo "Database User: $DB_USER" - echo "Database Password: $DB_PASS" - echo "" -} >>~/dispatcharr.creds -msg_ok "Created PostgreSQL Database" - -fetch_and_deploy_gh_release "dispatcharr" "Dispatcharr/Dispatcharr" +PG_DB_NAME="dispatcharr_db" PG_DB_USER="dispatcharr_usr" setup_postgresql_db +fetch_and_deploy_gh_release "dispatcharr" "Dispatcharr/Dispatcharr" "tarball" msg_info "Installing Python Dependencies with uv" cd /opt/dispatcharr @@ -64,19 +48,19 @@ install -d -m 755 \ /data/{m3us,epgs} chown -R root:root /data DJANGO_SECRET=$(openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | cut -c1-50) -export DATABASE_URL="postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}" -export POSTGRES_DB=$DB_NAME -export POSTGRES_USER=$DB_USER -export POSTGRES_PASSWORD=$DB_PASS +export DATABASE_URL="postgresql://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}" +export POSTGRES_DB=$PG_DB_NAME +export POSTGRES_USER=$PG_DB_USER +export POSTGRES_PASSWORD=$PG_DB_PASS export POSTGRES_HOST=localhost export DJANGO_SECRET_KEY=$DJANGO_SECRET $STD uv run python manage.py migrate --noinput $STD uv run python manage.py collectstatic --noinput cat </opt/dispatcharr/.env -DATABASE_URL=postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME} -POSTGRES_DB=$DB_NAME -POSTGRES_USER=$DB_USER -POSTGRES_PASSWORD=$DB_PASS +DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME} +POSTGRES_DB=$PG_DB_NAME +POSTGRES_USER=$PG_DB_USER +POSTGRES_PASSWORD=$PG_DB_PASS POSTGRES_HOST=localhost CELERY_BROKER_URL=redis://localhost:6379/0 DJANGO_SECRET_KEY=$DJANGO_SECRET @@ -89,8 +73,9 @@ msg_ok "Configured Dispatcharr" msg_info "Configuring Nginx" cat </etc/nginx/sites-available/dispatcharr.conf server { - listen 80; + listen 9191; server_name _; + client_max_body_size 100M; # Serve static assets with correct MIME types location /assets/ {