- Add HTTPSConfig model for managing HTTPS settings - Add admin routes for HTTPS configuration management - Add beautiful admin template for HTTPS configuration - Add database migration for https_config table - Add CLI utility for HTTPS management - Add setup script for automated configuration - Add Caddy configuration generator and manager - Add comprehensive documentation (3 guides) - Add HTTPS Configuration card to admin dashboard - Implement input validation and security features - Add admin-only access control with audit trail - Add real-time configuration preview - Integrate with existing Caddy reverse proxy Features: - Enable/disable HTTPS from web interface - Configure domain, hostname, IP address, port - Automatic SSL certificate management via Let's Encrypt - Real-time Caddyfile generation and reload - Full audit trail with admin username and timestamps - Support for HTTPS and HTTP fallback access points - Beautiful, mobile-responsive UI Modified files: - app/models/__init__.py (added HTTPSConfig import) - app/blueprints/admin.py (added HTTPS routes) - app/templates/admin/admin.html (added HTTPS card) - docker-compose.yml (added Caddyfile mount and admin port) New files: - app/models/https_config.py - app/blueprints/https_config.html - app/utils/caddy_manager.py - https_manager.py - setup_https.sh - migrations/add_https_config_table.py - migrations/add_email_to_https_config.py - HTTPS_STATUS.txt - Documentation files (3 markdown guides)
7.1 KiB
Executable File
Optional Dependencies Guide
DigiServer v2 uses an optimized dependency installation strategy to minimize Docker image size while maintaining full functionality.
Overview
The base Docker image (~400MB) includes only essential dependencies:
- Poppler Utils - PDF to image conversion
- FFmpeg - Video processing and validation
- Python 3.13 - Application runtime
Optional dependencies can be installed on-demand:
- LibreOffice (~500MB) - PowerPoint (PPTX/PPT) to image conversion
Why Optional Dependencies?
By excluding LibreOffice from the base image, we reduce:
- Initial image size: From ~900MB to ~400MB (56% reduction)
- Download time: Faster deployments
- Storage requirements: Lower disk usage on hosts
Users who don't need PowerPoint conversion benefit from a smaller, faster image.
Installation Methods
1. Web UI (Recommended)
The easiest way to install LibreOffice:
- Log in to DigiServer admin panel
- Navigate to Admin Panel → System Dependencies
- Click "Install LibreOffice" button
- Wait 2-5 minutes for installation
- Refresh the page to verify installation
The web interface provides:
- Real-time installation status
- Version verification
- Error reporting
- No terminal access needed
2. Docker Exec (Manual)
For Docker deployments, use docker exec:
# Enter the container
docker exec -it digiserver bash
# Run the installation script
sudo /app/install_libreoffice.sh
# Verify installation
libreoffice --version
3. Direct Installation (Non-Docker)
For bare-metal or VM deployments:
# Make script executable (if not already)
chmod +x /srv/digiserver-v2/install_libreoffice.sh
# Run the installation script
sudo /srv/digiserver-v2/install_libreoffice.sh
# Verify installation
libreoffice --version
Checking Dependency Status
Web Interface
Navigate to Admin Panel → System Dependencies to see:
- ✅ LibreOffice: Installed or ❌ Not installed
- ✅ Poppler Utils: Installed (always present)
- ✅ FFmpeg: Installed (always present)
Command Line
Check individual dependencies:
# LibreOffice
libreoffice --version
# Poppler
pdftoppm -v
# FFmpeg
ffmpeg -version
File Type Support Matrix
| File Type | Required Dependency | Status |
|---|---|---|
| Images (JPG, PNG, GIF) | None | Always supported |
| Poppler Utils | Always available | |
| Videos (MP4, AVI, MOV) | FFmpeg | Always available |
| PowerPoint (PPTX, PPT) | LibreOffice | Optional install |
Upload Behavior
Without LibreOffice
When you try to upload a PowerPoint file without LibreOffice:
- Upload will be rejected
- Error message: "LibreOffice is not installed. Please install it from the Admin Panel → System Dependencies to upload PowerPoint files."
- Other file types (PDF, images, videos) work normally
With LibreOffice
After installation:
- PowerPoint files are converted to high-quality PNG images
- Each slide becomes a separate media item
- Slides maintain aspect ratio and resolution
- Original PPTX file is deleted after conversion
Technical Details
Installation Script
The install_libreoffice.sh script:
- Checks for root/sudo privileges
- Verifies if LibreOffice is already installed
- Updates apt package cache
- Installs
libreofficeandlibreoffice-impress - Verifies successful installation
- Reports version and status
Docker Implementation
The Dockerfile includes:
- Sudo access for
appuserto run installation script - Script permissions set during build
- No LibreOffice in base layers (smaller image)
Security Considerations
- Installation requires sudo/root access
- In Docker,
appuserhas limited sudo rights (only for installation script) - Installation script validates LibreOffice binary after install
- No external downloads except from official apt repositories
Installation Time
Typical installation times:
- Fast network (100+ Mbps): 2-3 minutes
- Average network (10-100 Mbps): 3-5 minutes
- Slow network (<10 Mbps): 5-10 minutes
The installation downloads approximately 450-500MB of packages.
Troubleshooting
Installation Fails
Error: "Permission denied"
- Solution: Ensure script has execute permissions (
chmod +x) - Docker: Check sudoers configuration in Dockerfile
Error: "Unable to locate package"
- Solution: Run
sudo apt-get updatefirst - Docker: Rebuild image with fresh apt cache
Installation Hangs
- Check internet connectivity
- Verify apt repositories are accessible
- In Docker, check container has network access
- Increase timeout if on slow connection
Verification Fails
Symptom: Installation completes but LibreOffice not found
- Solution: Check LibreOffice was installed to expected path
- Run:
which libreofficeto locate binary - Verify with:
libreoffice --version
Upload Still Fails After Installation
- Verify installation: Admin Panel → System Dependencies
- Check server logs for conversion errors
- Restart application:
docker restart digiserver(Docker) or restart Flask - Try uploading a simple PPTX file to test
Uninstallation
To remove LibreOffice and reclaim space:
# In container or host
sudo apt-get remove --purge libreoffice libreoffice-impress
sudo apt-get autoremove
sudo apt-get clean
This frees approximately 500MB of disk space.
Production Recommendations
When to Install LibreOffice
Install LibreOffice if:
- Users need to upload PowerPoint presentations
- You have >1GB free disk space
- Network bandwidth supports 500MB download
When to Skip LibreOffice
Skip LibreOffice if:
- Only using PDF, images, and videos
- Disk space is constrained (<2GB)
- Want minimal installation footprint
- Can convert PPTX to PDF externally
Multi-Container Deployments
For multiple instances:
- Option A: Create custom image with LibreOffice pre-installed
- Option B: Install on each container individually
- Option C: Use shared volume for LibreOffice binaries
FAQ
Q: Will removing LibreOffice break existing media?
A: No, converted slides remain as PNG images after conversion.
Q: Can I pre-install LibreOffice in the Docker image?
A: Yes, uncomment the libreoffice line in Dockerfile and rebuild.
Q: How much space does LibreOffice use?
A: Approximately 450-500MB installed.
Q: Does LibreOffice run during conversion?
A: Yes, in headless mode. It converts slides to PNG without GUI.
Q: Can I use other presentation converters?
A: The code currently only supports LibreOffice. Custom converters require code changes.
Q: Is LibreOffice safe for production?
A: Yes, LibreOffice is widely used in production environments for document conversion.
Support
For issues with optional dependencies:
- Check the System Dependencies page in Admin Panel
- Review server logs:
docker logs digiserver - Verify system requirements (disk space, memory)
- Consult DOCKER.md for container-specific guidance
Version History
- v2.0: Introduced optional LibreOffice installation
- v1.0: LibreOffice included in base image (larger size)