Automated conversion of geological XML applications into signed PDF documents for Rosnedra
A web service that processes geological information about land plots, deposits, and licenses, converting XML declarations into professionally formatted and digitally signed PDF documents.
# Deploy to test environment
make quick-test
# Deploy to production
make quick-prodThat's it! The system automatically handles versioning, Docker build, deployment, and verification.
# Test environment
.\deploy.ps1 test test patch
# Production environment
.\deploy.ps1 prod prod patch- XML Processing - Validates and parses geological XML applications
- PDF Generation - Creates professional documents using HTML/CSS templates
- Digital Signing - Adds cryptographic signatures using pyHanko
- Web Interface - Provides upload, file management, and monitoring pages
- Automatic Cleanup - Manages file retention and log rotation
| Environment | URL | Port | Purpose |
|---|---|---|---|
| Production | http://172.27.239.6:30001/ | 30001 | Live system |
| Development | http://172.27.239.23:30002/ | 30002 | Development testing |
| Test | http://172.27.239.23:30003/ | 30003 | Integration testing |
- ✅ XML to PDF Conversion - Geological data processing
- ✅ Digital Signatures - PFX certificate integration
- ✅ Web Interface - File upload and management
- ✅ Automated Deployment - One-command deployment system
- ✅ Automatic Cleanup - Configurable file retention
- ✅ Authentication - HTTP Basic Auth protection
- ✅ Kubernetes Ready - Production-grade deployment
- Main (
/) - XML file upload interface - Files (
/files/) - Download and manage generated PDFs - Logs (
/logs/) - View system logs and errors - Cleanup (
/cleanup/) - File management and cleanup controls
- Backend: FastAPI + Python 3.9+
- PDF Generation: WeasyPrint + HTML/CSS templates
- XML Processing: ElementTree + custom parsers
- Digital Signing: pyHanko + PFX certificates
- Deployment: Docker + Kubernetes
- Authentication: HTTP Basic Auth
# Make changes to code
# Deploy to test
make quick-test
# Check results
make check-test# Deploy to dev first
make quick-dev
# If all good, deploy to production
make quick-prod# Fix critical issue
.\deploy.ps1 test test patch
# If works, push to production
.\deploy.ps1 prod prod patch| Command | Description |
|---|---|
make quick-test |
Deploy to test environment |
make quick-dev |
Deploy to dev environment |
make quick-prod |
Deploy to production |
make check-test |
Verify test deployment |
make versions |
Show current Docker versions |
make help |
Show all available commands |
- Quick Start Guide - Detailed getting started instructions
- Automation System - Full deployment automation documentation
- Cleanup System - File retention and cleanup configuration
- Emergency Procedures - Troubleshooting and hotfix procedures
Key environment variables:
AUTO_CLEANUP_ENABLED=True # Enable automatic file cleanup
FILE_RETENTION_DAYS=7 # File retention period
LOG_RETENTION_DAYS=30 # Log retention period
CLEANUP_INTERVAL_HOURS=6 # Cleanup check intervalkubectl get pods # Check pod status
kubectl logs -f deployment/... # View logs
make versions # Check current versions- Service not responding - Check pod status and logs
- Authentication errors - Verify HTTP Basic Auth credentials
- File not found - Check cleanup settings and retention periods
- Deployment failed - Verify Docker Hub access and Kubernetes connection
kubectl rollout undo deployment/server-print-deployment-testefgi-xml2pdf/
├── app/ # Main application code
│ ├── main_app.py # FastAPI application and routes
│ ├── xml_processor.py # XML parsing and PDF generation
│ ├── cleanup_service.py # Automatic cleanup service
│ └── templates/ # HTML templates for PDF generation
├── deploy.ps1 # PowerShell deployment script
├── Makefile # Simple deployment commands
├── requirements.txt # Python dependencies
├── Dockerfile # Container configuration
└── server-print-*.yaml # Kubernetes deployment manifests
- Make changes to the code
- Test with
make quick-test - Deploy to dev with
make quick-dev - Create pull request
- Deploy to production with
make quick-prod
For issues or questions:
- Check the troubleshooting section
- Review system logs via web interface or kubectl
- Consult additional documentation in this repository
Current Version: v1.189.1+ (automatically managed by deployment system)