@@ -47,7 +47,8 @@ echo ""
4747# Get installation directory
4848INSTALL_DIR=" ${HOME} /.desterlib"
4949echo -e " ${CYAN} Installation directory: ${INSTALL_DIR}${NC} "
50- read -p " Press Enter to use default, or type a different path: " custom_dir
50+ echo -n " Press Enter to use default, or type a different path: "
51+ read custom_dir
5152if [ -n " $custom_dir " ]; then
5253 INSTALL_DIR=" $custom_dir "
5354fi
@@ -62,32 +63,41 @@ echo -e "${CYAN}📋 Configuration${NC}"
6263echo " "
6364
6465# Media library path
65- read -p " Media library path (where your movies/TV shows are): " MEDIA_PATH
66+ echo -e " ${CYAN} Media library root path:${NC} "
67+ echo -e " ${YELLOW} This should be the root directory containing your media libraries${NC} "
68+ echo -e " ${YELLOW} Example: /Volumes/Media (which contains Movies/, TV Shows/, etc.)${NC} "
69+ echo -n " Media library root path: "
70+ read MEDIA_PATH
6671if [ -z " $MEDIA_PATH " ]; then
6772 echo -e " ${RED} ❌ Media library path is required${NC} "
6873 exit 1
6974fi
7075if [ ! -d " $MEDIA_PATH " ]; then
7176 echo -e " ${YELLOW} ⚠️ Warning: Media path does not exist: $MEDIA_PATH ${NC} "
72- read -p " Continue anyway? (y/N): " continue_anyway
77+ echo -n " Continue anyway? (y/N): "
78+ read continue_anyway
7379 if [ " $continue_anyway " != " y" ] && [ " $continue_anyway " != " Y" ]; then
7480 exit 1
7581 fi
7682fi
7783
7884# Port
79- read -p " API port [3001]: " PORT
85+ echo -n " API port [3001]: "
86+ read PORT
8087PORT=${PORT:- 3001}
8188
8289# Database credentials
83- read -p " Database user [postgres]: " DB_USER
90+ echo -n " Database user [postgres]: "
91+ read DB_USER
8492DB_USER=${DB_USER:- postgres}
8593
86- read -sp " Database password [postgres]: " DB_PASSWORD
94+ echo -n " Database password [postgres]: "
95+ read -s DB_PASSWORD
8796DB_PASSWORD=${DB_PASSWORD:- postgres}
8897echo " "
8998
90- read -p " Database name [desterlib_prod]: " DB_NAME
99+ echo -n " Database name [desterlib_prod]: "
100+ read DB_NAME
91101DB_NAME=${DB_NAME:- desterlib_prod}
92102
93103echo " "
@@ -112,6 +122,9 @@ DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}?sch
112122NODE_ENV=production
113123PORT=${PORT}
114124FRONTEND_URL=http://localhost:${PORT}
125+ # Media library path configuration (for path mapping between host and container)
126+ HOST_MEDIA_PATH=${MEDIA_PATH}
127+ CONTAINER_MEDIA_PATH=/media
115128EOF
116129
117130# Update docker-compose.yml with user's configuration
@@ -133,6 +146,8 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
133146 sed -i ' ' " s|POSTGRES_USER:-postgres|POSTGRES_USER:-${DB_USER} |" docker-compose.yml
134147 sed -i ' ' " s|postgres:postgres@postgres|${DB_USER} :${ESCAPED_DB_PASSWORD} @postgres|" docker-compose.yml
135148 sed -i ' ' " s|desterlib_prod|${DB_NAME} |g" docker-compose.yml
149+ # Update HOST_MEDIA_PATH environment variable
150+ sed -i ' ' " s|HOST_MEDIA_PATH: /Volumes/External/Library/Media|HOST_MEDIA_PATH: ${ESCAPED_MEDIA_PATH} |" docker-compose.yml
136151else
137152 # Linux sed
138153 sed -i " s|- /Volumes/External/Library/Media:/media:ro|- ${ESCAPED_MEDIA_PATH} :/media:ro|" docker-compose.yml
144159 sed -i " s|POSTGRES_USER:-postgres|POSTGRES_USER:-${DB_USER} |" docker-compose.yml
145160 sed -i " s|postgres:postgres@postgres|${DB_USER} :${ESCAPED_DB_PASSWORD} @postgres|" docker-compose.yml
146161 sed -i " s|desterlib_prod|${DB_NAME} |g" docker-compose.yml
162+ # Update HOST_MEDIA_PATH environment variable
163+ sed -i " s|HOST_MEDIA_PATH: /Volumes/External/Library/Media|HOST_MEDIA_PATH: ${ESCAPED_MEDIA_PATH} |" docker-compose.yml
147164fi
148165
149166echo -e " ${GREEN} ✅ Configuration files created${NC} "
0 commit comments