From 4b6391706421ff7908e66f2efb1cf88fa7460058 Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Thu, 6 Nov 2025 14:48:48 -0500 Subject: [PATCH] another fix --- nextgenpdf-install.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/nextgenpdf-install.sh b/nextgenpdf-install.sh index ff4541d..5afe326 100644 --- a/nextgenpdf-install.sh +++ b/nextgenpdf-install.sh @@ -64,6 +64,7 @@ pip install gunicorn # Create application directory structure echo "Setting up application directory..." mkdir -p static +mkdir -p processed # Ensure processed directory exists # Copy logo if it exists in repo, otherwise you'll need to add it # cp path/to/trbc-logo-full.png static/ # Uncomment and adjust if needed @@ -102,9 +103,19 @@ Restart=always WantedBy=multi-user.target EOF -# Set proper permissions +# Set proper permissions for web application +echo "Setting proper permissions for web application..." sudo chown -R $CURRENT_USER:$CURRENT_USER /home/$CURRENT_USER/pdf-rename-sort +# Make static files accessible to nginx (and other users if needed) +sudo chmod -R 755 /home/$CURRENT_USER/pdf-rename-sort/static +sudo chmod -R 755 /home/$CURRENT_USER/pdf-rename-sort/processed + +# Ensure the processed directory exists and is accessible +sudo mkdir -p /home/$CURRENT_USER/pdf-rename-sort/processed +sudo chown -R $CURRENT_USER:$CURRENT_USER /home/$CURRENT_USER/pdf-rename-sort/processed +sudo chmod -R 755 /home/$CURRENT_USER/pdf-rename-sort/processed + # Enable and start the service echo "Starting the application service..." sudo systemctl daemon-reload @@ -158,7 +169,7 @@ server { gzip on; gzip_vary on; gzip_min_length 1024; - gzip_proxied expired no-cache no-store private must-revalidate auth; + gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss; } EOF @@ -220,4 +231,5 @@ echo " sudo systemctl status nginx" echo "" echo "NOTE: This setup runs alongside your existing app on port 5000." echo "The PDF Renamer will be accessible at https://nextgenpdf.trbc.org." +echo "File permissions have been set for web access (755 for directories)." echo "Installed for user: $CURRENT_USER" \ No newline at end of file