Fix Ubuntu install script - make PyMuPDF optional, fix .env check, improve systemd service

This commit is contained in:
nmemmert committed 2025-11-05 14:53:12 -05:00
1 parent 54cd87c0f4
commit faa231f9dd
2 files changed
+14 -4

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
Flask==3.0.0 Flask==3.0.0
Flask-Session==0.6.0 Flask-Session==0.6.0
PyMuPDF==1.23.7
Werkzeug==3.0.1 Werkzeug==3.0.1
waitress==3.0.0 waitress==3.0.0
requests-oauthlib==2.0.0 requests-oauthlib==2.0.0
python-dotenv==1.2.1 python-dotenv==1.2.1
# PyMuPDF==1.23.7 # Optional - will be installed separately if possible
+12 -2
View File
@@ -96,6 +96,15 @@ log_info "Installing Python dependencies..."
pip install --upgrade pip pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
# Try to install PyMuPDF (optional for PDF processing)
log_info "Attempting to install PyMuPDF for PDF processing..."
if pip install PyMuPDF==1.23.7; then
log_success "PyMuPDF installed successfully"
else
log_warning "PyMuPDF installation failed - PDF processing will not be available"
log_warning "You can try installing it manually later with: pip install PyMuPDF"
fi
# Create .env file with Azure AD configuration # Create .env file with Azure AD configuration
log_info "Configuring Azure AD authentication..." log_info "Configuring Azure AD authentication..."
echo "" echo ""
@@ -321,6 +330,7 @@ Type=simple
User=$USER User=$USER
WorkingDirectory=$APP_DIR WorkingDirectory=$APP_DIR
Environment=PATH=$APP_DIR/venv/bin Environment=PATH=$APP_DIR/venv/bin
Environment=PYTHONPATH=$APP_DIR
ExecStart=$APP_DIR/venv/bin/python $APP_DIR/app.py ExecStart=$APP_DIR/venv/bin/python $APP_DIR/app.py
Restart=always Restart=always
RestartSec=5 RestartSec=5
@@ -446,6 +456,6 @@ echo " Update app: ./manage.sh update"
echo "==================================================================" echo "=================================================================="
# Check if .env needs configuration # Check if .env needs configuration
if grep -q "your-tenant-id-here" .env; then if [[ -z "$AZURE_TENANT_ID" || -z "$AZURE_CLIENT_ID" || -z "$AZURE_CLIENT_SECRET" ]]; then
log_warning "IMPORTANT: Configure your .env file before using the application!" log_warning "IMPORTANT: Azure AD configuration is incomplete. Please check your .env file!"
fi fi