CalendarSync icon indicating copy to clipboard operation
CalendarSync copied to clipboard

Add Apple iCloud adapter

Open pavsap opened this issue 4 months ago • 3 comments

Overview

This PR adds support for Apple iCloud calendars via the CalDAV protocol, enabling users to sync their iCloud calendars with CalendarSync.

Features

  • Apple CalDAV adapter with basic authentication (Apple ID + app-specific password)
  • Dynamic calendar discovery - users can specify friendly names like "primary" instead of UUIDs
  • Full event synchronization - create, read, update, delete calendar events
  • iCalendar parsing using github.com/emersion/go-ical
  • Seamless integration with existing adapter architecture

Configuration Example

source:
  adapter:
    type: apple
    calendar: "primary"  # or any calendar name like "Work", "Family"
    oAuth:
      clientId: "[email protected]"
      clientKey: "app-specific-password"

Implementation Details

  • Uses CalDAV protocol (RFC 4791) with Apple's iCloud CalDAV endpoints
  • Reuses existing OAuth config fields for simplicity (clientId=Apple ID, clientKey=app-specific-password)
  • Implements dynamic principal and calendar UUID resolution
  • Supports both friendly names and direct UUID specification
  • Full iCalendar format support for event properties

Setup Requirements

  • Apple ID account
  • App-specific password generated from Apple ID settings (not regular iCloud password)
  • Calendar access permissions

Testing

☑️ Authentication with Apple ID + app-specific password ☑️ Calendar discovery and name resolution ☑️ Event reading from iCloud calendars ☑️ Integration with existing CalendarSync architecture

Recent Updates

☑️ Fixed CalDAV event creation (resolved 400 Bad Request errors) ☑️ Added thread-safe calendar resolution caching for performance ☑️ Fixed Google->Apple sync functionality

pavsap avatar Sep 05 '25 11:09 pavsap

I would love to make use of this. I tried the Zep adapter as mentioned in #227 but no luck there.

mmisiewicz avatar Oct 07 '25 15:10 mmisiewicz

@mmisiewicz, just copy my branch and compile it from source with make build

Use the compiled ./bin/calendarsync as you normally would.

Cron runs the daily bidirectional sync between my Primary (Apple) calendar and Work (Google Workspace) calendar.

pavsap avatar Oct 07 '25 20:10 pavsap

Can confirm it's working great for me and I'd love to see this merged!

mmisiewicz avatar Oct 11 '25 14:10 mmisiewicz