Fix Ubuntu install script - make PyMuPDF optional, fix .env check, improve systemd service
This commit is contained in:
1 parent
54cd87c0f4
commit
faa231f9dd
2 files changed
+13
-3
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
Flask==3.0.0
|
||||
Flask-Session==0.6.0
|
||||
PyMuPDF==1.23.7
|
||||
Werkzeug==3.0.1
|
||||
waitress==3.0.0
|
||||
requests-oauthlib==2.0.0
|
||||
python-dotenv==1.2.1
|
||||
# PyMuPDF==1.23.7 # Optional - will be installed separately if possible
|
||||
+12
-2
@@ -96,6 +96,15 @@ log_info "Installing Python dependencies..."
|
||||
pip install --upgrade pip
|
||||
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
|
||||
log_info "Configuring Azure AD authentication..."
|
||||
echo ""
|
||||
@@ -321,6 +330,7 @@ Type=simple
|
||||
User=$USER
|
||||
WorkingDirectory=$APP_DIR
|
||||
Environment=PATH=$APP_DIR/venv/bin
|
||||
Environment=PYTHONPATH=$APP_DIR
|
||||
ExecStart=$APP_DIR/venv/bin/python $APP_DIR/app.py
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
@@ -446,6 +456,6 @@ echo " Update app: ./manage.sh update"
|
||||
echo "=================================================================="
|
||||
|
||||
# Check if .env needs configuration
|
||||
if grep -q "your-tenant-id-here" .env; then
|
||||
log_warning "IMPORTANT: Configure your .env file before using the application!"
|
||||
if [[ -z "$AZURE_TENANT_ID" || -z "$AZURE_CLIENT_ID" || -z "$AZURE_CLIENT_SECRET" ]]; then
|
||||
log_warning "IMPORTANT: Azure AD configuration is incomplete. Please check your .env file!"
|
||||
fi
|
||||
Reference in new issue
Block a user