Update for 500MB file uploads and enhance Entra ID setup instructions

This commit is contained in:
nmemmert committed 2025-11-06 10:03:53 -05:00
1 parent d1a94d3378
commit b51b5e8d29
3 files changed
+21 -8

No files matched your search

+1 -1
View File
@@ -112,7 +112,7 @@ Users can choose their preferred login method on the login page.
- PDFs must contain fillable form fields named exactly "Last Name" and "First Name" - PDFs must contain fillable form fields named exactly "Last Name" and "First Name"
- Files without these fields or with extraction errors will be skipped - Files without these fields or with extraction errors will be skipped
- All processing happens server-side with temporary file storage - All processing happens server-side with temporary file storage
- Maximum upload size is limited to 100MB - Maximum upload size is limited to 500MB
## Production Deployment ## Production Deployment
+1 -1
View File
@@ -11,7 +11,7 @@ from authlib.integrations.flask_client import OAuth
app = Flask(__name__) app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = tempfile.mkdtemp() app.config['UPLOAD_FOLDER'] = tempfile.mkdtemp()
app.config['MAX_CONTENT_LENGTH'] = 100 * 1024 * 1024 # 100MB limit app.config['MAX_CONTENT_LENGTH'] = 500 * 1024 * 1024 # 500MB limit
app.secret_key = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production') app.secret_key = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')
# Entra ID Configuration # Entra ID Configuration
+19 -6
View File
@@ -46,9 +46,9 @@ User=ubuntu
WorkingDirectory=/home/ubuntu/pdf-rename-sort WorkingDirectory=/home/ubuntu/pdf-rename-sort
Environment="PATH=/home/ubuntu/pdf-rename-sort/venv/bin" Environment="PATH=/home/ubuntu/pdf-rename-sort/venv/bin"
Environment="SECRET_KEY=CHANGE_THIS_SECRET_KEY_IN_PRODUCTION" Environment="SECRET_KEY=CHANGE_THIS_SECRET_KEY_IN_PRODUCTION"
Environment="TENANT_ID=your-tenant-id" Environment="TENANT_ID=YOUR_MICROSOFT_ENTRA_TENANT_ID"
Environment="CLIENT_ID=your-client-id" Environment="CLIENT_ID=YOUR_MICROSOFT_ENTRA_CLIENT_ID"
Environment="CLIENT_SECRET=your-client-secret" Environment="CLIENT_SECRET=YOUR_MICROSOFT_ENTRA_CLIENT_SECRET"
Environment="ADMIN_USERNAME=trbcit" Environment="ADMIN_USERNAME=trbcit"
Environment="ADMIN_PASSWORD=CHANGE_THIS_PASSWORD" Environment="ADMIN_PASSWORD=CHANGE_THIS_PASSWORD"
ExecStart=/home/ubuntu/pdf-rename-sort/venv/bin/gunicorn --bind 127.0.0.1:3000 pdf_renamer:app ExecStart=/home/ubuntu/pdf-rename-sort/venv/bin/gunicorn --bind 127.0.0.1:3000 pdf_renamer:app
@@ -74,6 +74,9 @@ server {
listen 80; listen 80;
server_name your-domain.com www.your-domain.com; server_name your-domain.com www.your-domain.com;
# Handle large file uploads (500MB)
client_max_body_size 500M;
# Security headers # Security headers
add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always; add_header X-XSS-Protection "1; mode=block" always;
@@ -139,10 +142,20 @@ sudo ufw --force enable
echo "" echo ""
echo "Installation completed successfully!" echo "Installation completed successfully!"
echo "" echo ""
echo "IMPORTANT: Configure Microsoft Entra ID authentication:"
echo "1. Go to Azure Portal > Microsoft Entra ID > App registrations"
echo "2. Create a new registration or use existing one"
echo "3. Note the Application (client) ID and Directory (tenant) ID"
echo "4. Add a client secret under Certificates & secrets"
echo "5. Add redirect URI: https://your-domain.com/auth/microsoft/callback"
echo "6. Grant appropriate permissions if needed"
echo ""
echo "Next steps:" echo "Next steps:"
echo "1. Update the environment variables in /etc/systemd/system/pdf-renamer.service:" echo "1. Update the environment variables in /etc/systemd/system/pdf-renamer.service:"
echo " - SECRET_KEY: Set a secure random key" echo " - SECRET_KEY: Set a secure random key (use: openssl rand -hex 32)"
echo " - TENANT_ID, CLIENT_ID, CLIENT_SECRET: Configure for Microsoft Entra ID" echo " - TENANT_ID: Your Microsoft Entra tenant ID"
echo " - CLIENT_ID: Your Microsoft Entra application ID"
echo " - CLIENT_SECRET: Your Microsoft Entra client secret"
echo " - ADMIN_USERNAME and ADMIN_PASSWORD: Set secure admin credentials" echo " - ADMIN_USERNAME and ADMIN_PASSWORD: Set secure admin credentials"
echo "" echo ""
echo "2. Update the server_name in /etc/nginx/sites-available/pdf-renamer to your actual domain" echo "2. Update the server_name in /etc/nginx/sites-available/pdf-renamer to your actual domain"
@@ -159,4 +172,4 @@ echo "5. Check service status:"
echo " sudo systemctl status pdf-renamer" echo " sudo systemctl status pdf-renamer"
echo " sudo systemctl status nginx" echo " sudo systemctl status nginx"
echo "" echo ""
echo "The application should be accessible at your domain name on port 80." echo "The application supports ZIP files up to 500MB and will be accessible at your domain name."