While these issues require API compromise to exploit, added multiple layers of defense to prevent privilege escalation: CRITICAL FIXES: - Path traversal protection: Sanitize filenames to prevent ../../ attacks - DoS prevention: Limit cover image size to 10MB HIGH PRIORITY FIXES: - Flexible browser configuration: Support BULLETIN_CHROME_PATH env var - Windows support: Add default Brave path for Windows - HTTPS enforcement: Warn when using HTTP for remote APIs - Temp file security: Use process-specific directories with restricted permissions - Complete cleanup: Remove entire temp directory instead of just files All fixes maintain existing functionality with graceful error handling. |
||
|---|---|---|
| bulletin-generator | ||
| bulletin-input | ||
| data-upload-tools | ||
| .env.example | ||
| .gitignore | ||
| autoprintbulletin.sh | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
| SERMON_FORMAT.md | ||
Bulletin Tools - Rust Implementation
This is a Rust rewrite of the Python church bulletin generation system. The system consists of two main binaries that work with a REST API to create and generate church bulletins.
Project Structure
-
bulletin-input/- Binary for creating bulletin data entries- Fetches schedule data from REST API
- Prompts for sermon details
- Creates bulletin records via REST API
-
bulletin-generator/- Binary for generating PDF bulletins- Fetches bulletin data from REST API
- Renders HTML templates
- Generates PDF using headless Chrome
- Uploads PDF back via REST API
This project now uses the church-core library (https://git.rockvilletollandsda.church/RTSDA/church-core.git) which contains shared functionality including:
- Configuration management
- REST API client implementation
- Data models (Bulletin, Event, Personnel)
Data Files
The data/ directory contains:
Quarterly schedule2021 - 2025.csv- Personnel assignments2025 Offering and Sunset Times Chart.txt- Conference offering schedule and sunset timesKJV.json- King James Version Bible text for scripture lookups
Configuration
The shared configuration is in shared/config.toml:
church_name = "Your Church Name"
# Optional contact information for templates
# contact_phone = "555-123-4567"
# contact_website = "yourchurchwebsite.org"
# contact_youtube = "youtube.com/yourchurchchannel"
# contact_address = "123 Church St, Your City, ST 12345"
This system requires a REST API backend for bulletin management. Authentication is configured via username/password in the .env file:
BULLETIN_API_USERNAME- Your API usernameBULLETIN_API_PASSWORD- Your API password
The backend uses PASETO tokens for session management.
Usage
Building
cargo build --release
Bulletin Input
# Use upcoming Saturday (default)
cargo run --bin bulletin-input
# Specify a date
cargo run --bin bulletin-input -- --date 2025-06-21
# Use different location for sunset times
cargo run --bin bulletin-input -- --location "springfield"
Bulletin Generation
# Generate for upcoming Saturday
cargo run --bin bulletin-generator
# Specify a date
cargo run --bin bulletin-generator -- --date 2025-06-21
# Don't upload to PocketBase (local only)
cargo run --bin bulletin-generator -- --no-upload
# Custom output directory
cargo run --bin bulletin-generator -- --output-dir custom_output
Templates
The bulletin templates are located in bulletin-generator/templates/:
bulletin_template.html- Jinja2-style template for the bulletin layoutstyle.css- CSS styling for the PDF output
Dependencies
Key Rust dependencies:
- tokio - Async runtime
- reqwest - HTTP client for PocketBase API
- serde - Serialization/deserialization
- chrono - Date/time handling
- tera - Template engine
- headless_chrome - PDF generation
- csv - CSV parsing
- regex - Text parsing
Migration from Python
This Rust implementation maintains full compatibility with the original Python system:
- Uses the new REST API backend
- Processes the same data files
- Generates identical bulletin layouts
- Follows the same workflow
The main benefits of the Rust version:
- Faster execution
- Single binary deployment
- Better error handling
- Type safety
- Reduced runtime dependencies