From 1b75fbc90a36cdec3708a8d7738088b9f504935b Mon Sep 17 00:00:00 2001 From: dekzter Date: Wed, 2 Apr 2025 16:28:58 -0400 Subject: [PATCH] postgres dir var, nginx variable replacement, more permission modification --- docker/init/02-postgres.sh | 12 ++++++------ docker/init/03-init-dispatcharr.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docker/init/02-postgres.sh b/docker/init/02-postgres.sh index 77684501..69a81dd4 100644 --- a/docker/init/02-postgres.sh +++ b/docker/init/02-postgres.sh @@ -1,9 +1,9 @@ #!/bin/bash -# Temporary migration from postgres in /data to /data/db. Can likely remove +# Temporary migration from postgres in /data to $POSTGRES_DIR. Can likely remove # some time in the future. if [ -e "/data/postgresql.conf" ]; then - echo "Migrating PostgreSQL data from /data to /data/db..." + echo "Migrating PostgreSQL data from /data to $POSTGRES_DIR..." # Create a temporary directory outside of /data mkdir -p /tmp/postgres_migration @@ -12,17 +12,17 @@ if [ -e "/data/postgresql.conf" ]; then mv /data/* /tmp/postgres_migration/ # Create the target directory - mkdir -p /data/db + mkdir -p $POSTGRES_DIR # Move the files from temporary directory to the final location - mv /tmp/postgres_migration/* /data/db/ + mv /tmp/postgres_migration/* $POSTGRES_DIR/ # Clean up the temporary directory rmdir /tmp/postgres_migration # Set proper ownership and permissions for PostgreSQL data directory - chown -R postgres:postgres /data/db - chmod 700 /data/db + chown -R postgres:postgres $POSTGRES_DIR + chmod 700 $POSTGRES_DIR echo "Migration completed successfully." fi diff --git a/docker/init/03-init-dispatcharr.sh b/docker/init/03-init-dispatcharr.sh index 5e9e497b..6b6269bf 100644 --- a/docker/init/03-init-dispatcharr.sh +++ b/docker/init/03-init-dispatcharr.sh @@ -13,3 +13,12 @@ if [ "$(id -u)" = "0" ]; then chown -R $PUID:$PGID /app echo "Created and set permissions for cached_m3u directory" fi + +mkdir -p /data/logos +chown -R $PUID:$PGID /data/logos + +# Permissions +chown -R postgres:postgres /data/db + +# Set nginx port from ENV +sed -i "s/NGINX_PORT/${DISPATCHARR_PORT}/g" /etc/nginx/sites-enabled/default