Update dispatcharr-install.sh

This commit is contained in:
CanbiZ 2025-09-03 10:12:56 +02:00
parent 0323cca3b4
commit 7d679aaef7

View File

@ -31,9 +31,10 @@ $STD apt-get install -y \
streamlink streamlink
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
setup_uv PYTHON_VERSION="3.13" setup_uv
NODE_VERSION="22" setup_nodejs NODE_VERSION="22" setup_nodejs
PG_VERSION="16" setup_postgresql PG_VERSION="16" setup_postgresql
fetch_and_deploy_gh_release "dispatcharr" "Dispatcharr/Dispatcharr"
msg_info "Set up PostgreSQL Database" msg_info "Set up PostgreSQL Database"
DB_NAME=dispatcharr_db DB_NAME=dispatcharr_db
@ -53,21 +54,16 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
} >>~/dispatcharr.creds } >>~/dispatcharr.creds
msg_ok "Set up PostgreSQL Database" msg_ok "Set up PostgreSQL Database"
fetch_and_deploy_gh_release "dispatcharr" "Dispatcharr/Dispatcharr" msg_info "Setup Python Requirements"
#chown -R "$APP_USER:$APP_GROUP" {/etc/dispatcharr,/opt/dispatcharr,/data}
msg_info "Install Python Requirements"
mkdir -p /data/{db,epgs,logos,m3us,recordings,uploads} mkdir -p /data/{db,epgs,logos,m3us,recordings,uploads}
mkdir -p /etc/dispatcharr mkdir -p /etc/dispatcharr
sed -i 's/program\[\x27channel_id\x27\]/program["channel_id"]/g' "/opt/dispatcharr/apps/output/views.py" sed -i 's/program\[\x27channel_id\x27\]/program["channel_id"]/g' "/opt/dispatcharr/apps/output/views.py"
cd /opt/dispatcharr cd /opt/dispatcharr
python3 -m venv env UV_PY="${PYTHON_VERSION:-3.13}"
source env/bin/activate $STD uv python install "$UV_PY"
$STD uv venv --python "$UV_PY" .venv
$STD pip install --upgrade pip $STD uv pip install --python ./.venv/bin/python -r requirements.txt
$STD pip install -r requirements.txt $STD uv pip install --python ./.venv/bin/python gunicorn gevent celery daphne
$STD pip install gunicorn
ln -sf /usr/bin/ffmpeg /opt/dispatcharr/env/bin/ffmpeg ln -sf /usr/bin/ffmpeg /opt/dispatcharr/env/bin/ffmpeg
msg_ok "Python Requirements Installed" msg_ok "Python Requirements Installed"
@ -79,13 +75,12 @@ msg_ok "Built Frontend"
msg_info "Running Django Migrations" msg_info "Running Django Migrations"
cd /opt/dispatcharr cd /opt/dispatcharr
source env/bin/activate
set -o allexport set -o allexport
source /etc/dispatcharr/dispatcharr.env source /etc/dispatcharr/dispatcharr.env
set +o allexport set +o allexport
$STD python manage.py migrate --noinput $STD ./.venv/bin/python manage.py migrate --noinput
$STD python manage.py collectstatic --noinput $STD ./.venv/bin/python manage.py collectstatic --noinput
msg_ok "Migrations Complete" msg_ok "Migrations Complete"
msg_info "Configuring Nginx" msg_info "Configuring Nginx"