File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,16 @@ function update_script() {
8787 mv /tmp/start-daphne.sh.backup /opt/dispatcharr/start-daphne.sh
8888 fi
8989
90+ # Add DJANGO_SECRET_KEY if missing (required for v0.13.1+)
91+ if [[ -f /opt/dispatcharr/.env ]]; then
92+ if ! grep -q " DJANGO_SECRET_KEY" /opt/dispatcharr/.env; then
93+ msg_info " Adding DJANGO_SECRET_KEY to .env file"
94+ DJANGO_SECRET=$( openssl rand -base64 32 | tr -dc ' a-zA-Z0-9' | cut -c1-50)
95+ echo " DJANGO_SECRET_KEY=$DJANGO_SECRET " >> /opt/dispatcharr/.env
96+ msg_ok " Added DJANGO_SECRET_KEY"
97+ fi
98+ fi
99+
90100 cd /opt/dispatcharr
91101 rm -rf .venv
92102 $STD uv venv
Original file line number Diff line number Diff line change @@ -62,11 +62,13 @@ install -d -m 755 \
6262 /data/uploads/{m3us,epgs} \
6363 /data/{m3us,epgs}
6464chown -R root:root /data
65+ DJANGO_SECRET=$( openssl rand -base64 32 | tr -dc ' a-zA-Z0-9' | cut -c1-50)
6566export DATABASE_URL=" postgresql://${DB_USER} :${DB_PASS} @localhost:5432/${DB_NAME} "
6667export POSTGRES_DB=$DB_NAME
6768export POSTGRES_USER=$DB_USER
6869export POSTGRES_PASSWORD=$DB_PASS
6970export POSTGRES_HOST=localhost
71+ export DJANGO_SECRET_KEY=$DJANGO_SECRET
7072$STD uv run python manage.py migrate --noinput
7173$STD uv run python manage.py collectstatic --noinput
7274cat << EOF >/opt/dispatcharr/.env
@@ -76,6 +78,7 @@ POSTGRES_USER=$DB_USER
7678POSTGRES_PASSWORD=$DB_PASS
7779POSTGRES_HOST=localhost
7880CELERY_BROKER_URL=redis://localhost:6379/0
81+ DJANGO_SECRET_KEY=$DJANGO_SECRET
7982EOF
8083cd /opt/dispatcharr/frontend
8184$STD npm install --legacy-peer-deps
You can’t perform that action at this time.
0 commit comments