Initial commit: Complete CalDAV calendar synchronizer

- Rust-based CLI tool for Zoho to Nextcloud calendar sync
- Selective calendar import from Zoho to single Nextcloud calendar
- Timezone-aware event handling for next-week synchronization
- Comprehensive configuration system with TOML support
- CLI interface with debug, list, and sync operations
- Complete documentation and example configurations
This commit is contained in:
Alvaro Soliverez 2025-10-04 11:57:44 -03:00
commit 8362ebe44b
16 changed files with 6192 additions and 0 deletions

54
config/default.toml Normal file
View file

@ -0,0 +1,54 @@
# Default CalDAV Sync Configuration
# This file provides default values for the Zoho to Nextcloud calendar sync
# Zoho Configuration (Source)
[zoho]
server_url = "https://caldav.zoho.com/caldav"
username = ""
password = ""
selected_calendars = []
# Nextcloud Configuration (Target)
[nextcloud]
server_url = ""
username = ""
password = ""
target_calendar = "Imported-Zoho-Events"
create_if_missing = true
[server]
# Request timeout in seconds
timeout = 30
[calendar]
# Calendar color in hex format
color = "#3174ad"
# Default timezone for processing
timezone = "UTC"
[sync]
# Synchronization interval in seconds (300 = 5 minutes)
interval = 300
# Whether to perform synchronization on startup
sync_on_startup = true
# Number of weeks ahead to sync
weeks_ahead = 1
# Whether to run in dry-run mode (preview changes only)
dry_run = false
# Performance settings
max_retries = 3
retry_delay = 5
# Optional filtering configuration
# [filters]
# # Event types to include (leave empty for all)
# event_types = ["meeting", "appointment"]
# # Keywords to filter events by
# keywords = ["work", "meeting", "project"]
# # Keywords to exclude
# exclude_keywords = ["personal", "holiday", "cancelled"]
# # Minimum event duration in minutes
# min_duration_minutes = 5
# # Maximum event duration in hours
# max_duration_hours = 24

117
config/example.toml Normal file
View file

@ -0,0 +1,117 @@
# CalDAV Configuration Example
# This file demonstrates how to configure Zoho and Nextcloud CalDAV connections
# Copy and modify this example for your specific setup
# Global settings
global:
log_level: "info"
sync_interval: 300 # seconds (5 minutes)
conflict_resolution: "latest" # or "manual" or "local" or "remote"
timezone: "UTC"
# Zoho CalDAV Configuration (Source)
zoho:
enabled: true
# Server settings
server:
url: "https://caldav.zoho.com/caldav"
timeout: 30 # seconds
# Authentication
auth:
username: "your-zoho-email@domain.com"
password: "your-zoho-app-password" # Use app-specific password, not main password
# Calendar selection - which calendars to import from
calendars:
- name: "Work Calendar"
enabled: true
color: "#4285F4"
sync_direction: "pull" # Only pull from Zoho
- name: "Personal Calendar"
enabled: true
color: "#34A853"
sync_direction: "pull"
- name: "Team Meetings"
enabled: false # Disabled by default
color: "#EA4335"
sync_direction: "pull"
# Sync options
sync:
sync_past_events: false # Don't sync past events
sync_future_events: true
sync_future_days: 7 # Only sync next week
include_attendees: false # Keep it simple
include_attachments: false
# Nextcloud CalDAV Configuration (Target)
nextcloud:
enabled: true
# Server settings
server:
url: "https://your-nextcloud-domain.com"
timeout: 30 # seconds
# Authentication
auth:
username: "your-nextcloud-username"
password: "your-nextcloud-app-password" # Use app-specific password
# Calendar discovery
discovery:
principal_url: "/remote.php/dav/principals/users/{username}/"
calendar_home_set: "/remote.php/dav/calendars/{username}/"
# Target calendar - all Zoho events go here
calendars:
- name: "Imported-Zoho-Events"
enabled: true
color: "#FF6B6B"
sync_direction: "push" # Only push to Nextcloud
create_if_missing: true # Auto-create if it doesn't exist
# Sync options
sync:
sync_past_events: false
sync_future_events: true
sync_future_days: 7
# Event filtering
filters:
events:
exclude_patterns:
- "Cancelled:"
- "BLOCKED"
# Time-based filters
min_duration_minutes: 5
max_duration_hours: 24
# Status filters
include_status: ["confirmed", "tentative"]
exclude_status: ["cancelled"]
# Logging
logging:
level: "info"
format: "text"
file: "caldav-sync.log"
max_size: "10MB"
max_files: 3
# Performance settings
performance:
max_concurrent_syncs: 3
batch_size: 25
retry_attempts: 3
retry_delay: 5 # seconds
# Security settings
security:
ssl_verify: true
encryption: "tls12"