diff --git a/config/default.toml b/config/default.toml index f700218..2354f61 100644 --- a/config/default.toml +++ b/config/default.toml @@ -1,54 +1,88 @@ # 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 +# This file provides default values for CalDAV synchronization +# Source Server Configuration (Primary CalDAV server) [server] +# CalDAV server URL (example: Zoho, Google Calendar, etc.) +url = "https://caldav.example.com/" +# Username for authentication +username = "" +# Password for authentication (use app-specific password) +password = "" +# Whether to use HTTPS (recommended) +use_https = true # Request timeout in seconds timeout = 30 +# Source Calendar Configuration [calendar] -# Calendar color in hex format +# Calendar name/path on the server +name = "calendar" +# Calendar display name (optional - will be discovered from server if not specified) +display_name = "" +# Calendar color in hex format (optional - will be discovered from server if not specified) color = "#3174ad" -# Default timezone for processing -timezone = "UTC" +# Calendar timezone (optional - will be discovered from server if not specified) +timezone = "" +# Whether this calendar is enabled for synchronization +enabled = true +# Synchronization Configuration [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 +# Maximum number of retry attempts for failed operations max_retries = 3 +# Delay between retry attempts in seconds retry_delay = 5 +# Whether to delete local events that are missing on server +delete_missing = false +# Date range configuration +[sync.date_range] +# Number of days ahead to sync +days_ahead = 7 +# Number of days in the past to sync +days_back = 0 +# Whether to sync all events regardless of date +sync_all_events = false # Optional filtering configuration # [filters] -# # Event types to include (leave empty for all) +# # Start date filter (ISO 8601 format) +# start_date = "2024-01-01T00:00:00Z" +# # End date filter (ISO 8601 format) +# end_date = "2024-12-31T23:59:59Z" +# # Event types to include # event_types = ["meeting", "appointment"] -# # Keywords to filter events by +# # Keywords to filter events by (events containing any of these will be included) # keywords = ["work", "meeting", "project"] -# # Keywords to exclude +# # Keywords to exclude (events containing any of these will be excluded) # exclude_keywords = ["personal", "holiday", "cancelled"] -# # Minimum event duration in minutes -# min_duration_minutes = 5 -# # Maximum event duration in hours -# max_duration_hours = 24 + +# Optional Import Configuration (for unidirectional sync to target server) +# Uncomment and configure this section to enable import functionality +# [import] +# # Target server configuration +# [import.target_server] +# url = "https://nextcloud.example.com/remote.php/dav/" +# username = "" +# password = "" +# use_https = true +# timeout = 30 +# +# # Target calendar configuration +# [import.target_calendar] +# name = "Imported-Events" +# display_name = "Imported from Source" +# color = "#FF6B6B" +# timezone = "UTC" +# enabled = true +# +# # Import behavior settings +# overwrite_existing = true # Source always wins +# delete_missing = false # Don't delete events missing from source +# dry_run = false # Set to true for preview mode +# batch_size = 50 # Number of events to process in each batch +# create_target_calendar = true # Create target calendar if it doesn't exist diff --git a/config/example.toml b/config/example.toml index 76613ea..5002737 100644 --- a/config/example.toml +++ b/config/example.toml @@ -1,117 +1,96 @@ # CalDAV Configuration Example -# This file demonstrates how to configure Zoho and Nextcloud CalDAV connections +# This file demonstrates how to configure CalDAV synchronization # 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" +# Source Server Configuration (e.g., Zoho Calendar) +[server] +# CalDAV server URL +url = "https://calendar.zoho.com/caldav/d82063f6ef084c8887a8694e661689fc/events/" +# Username for authentication +username = "your-email@domain.com" +# Password for authentication (use app-specific password) +password = "your-app-password" +# Whether to use HTTPS (recommended) +use_https = true +# Request timeout in seconds +timeout = 30 -# 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 +# Source Calendar Configuration +[calendar] +# Calendar name/path on the server +name = "caldav/d82063f6ef084c8887a8694e661689fc/events/" +# Calendar display name +display_name = "Work Calendar" +# Calendar color in hex format +color = "#4285F4" +# Default timezone for the calendar +timezone = "UTC" +# Whether this calendar is enabled for synchronization +enabled = true -# 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 +# Synchronization Configuration +[sync] +# Synchronization interval in seconds (300 = 5 minutes) +interval = 300 +# Whether to perform synchronization on startup +sync_on_startup = true +# Maximum number of retry attempts for failed operations +max_retries = 3 +# Delay between retry attempts in seconds +retry_delay = 5 +# Whether to delete local events that are missing on server +delete_missing = false +# Date range configuration +[sync.date_range] +# Number of days ahead to sync +days_ahead = 30 +# Number of days in the past to sync +days_back = 30 +# Whether to sync all events regardless of date +sync_all_events = false -# 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"] +# Optional filtering configuration +[filters] +# Keywords to filter events by (events containing any of these will be included) +keywords = ["work", "meeting", "project"] +# Keywords to exclude (events containing any of these will be excluded) +exclude_keywords = ["personal", "holiday", "cancelled"] +# Minimum event duration in minutes +min_duration_minutes = 5 +# Maximum event duration in hours +max_duration_hours = 24 -# Logging -logging: - level: "info" - format: "text" - file: "caldav-sync.log" - max_size: "10MB" - max_files: 3 +# Import Configuration (for unidirectional sync to target server) +[import] +# Target server configuration (e.g., Nextcloud) +[import.target_server] +# Nextcloud CalDAV URL +url = "https://your-nextcloud-domain.com/remote.php/dav/calendars/username/" +# Username for Nextcloud authentication +username = "your-nextcloud-username" +# Password for Nextcloud authentication (use app-specific password) +password = "your-nextcloud-app-password" +# Whether to use HTTPS (recommended) +use_https = true +# Request timeout in seconds +timeout = 30 -# Performance settings -performance: - max_concurrent_syncs: 3 - batch_size: 25 - retry_attempts: 3 - retry_delay: 5 # seconds +# Target calendar configuration +[import.target_calendar] +# Target calendar name +name = "Imported-Zoho-Events" +# Target calendar display name (optional - will be discovered from server if not specified) +display_name = "" +# Target calendar color (optional - will be discovered from server if not specified) +color = "" +# Target calendar timezone (optional - will be discovered from server if not specified) +timezone = "" +# Whether this calendar is enabled for import +enabled = true -# Security settings -security: - ssl_verify: true - encryption: "tls12" +# Import behavior settings +overwrite_existing = true # Source always wins - overwrite target events +delete_missing = false # Don't delete events missing from source +dry_run = false # Set to true for preview mode +batch_size = 50 # Number of events to process in each batch +create_target_calendar = true # Create target calendar if it doesn't exist