2.3 KiB
2.3 KiB
Baïkal Calendar Sync
An incremental CalDAV sync service that keeps your Baïkal calendar in sync with an Outlook ICS feed — with zero downtime and near-instant sync times.
Features
- Incremental Delta Sync: Only adds, updates, or deletes events that actually changed
- Zero Downtime: Adds/updates events before deleting removed ones — calendar never goes empty
- Smart Change Detection: ETag check first, SHA-256 fallback. Skips sync when nothing changed
- Stable Event Hashing: Ignores volatile fields (DTSTAMP, LAST-MODIFIED) to avoid false updates
- Automatic Backoff: Exponential retry on failures (1m, 2m, 4m... max 30m)
- Health Endpoint: Built-in
/healthand/metrics(Prometheus-compatible) on port 8081 - Graceful Shutdown: SIGTERM/SIGINT handlers finish current sync before exiting
- Docker Ready: Includes
Dockerfile,docker-compose.yml, and HEALTHCHECK
Prerequisites
- Docker & Docker Compose installed
- An existing Baïkal instance
- An Outlook ICS link
Configuration (Environment Variables)
| Variable | Description | Default |
|---|---|---|
ICS_URL |
The public ICS URL of your Outlook calendar. | Required |
BAIKAL_URL |
The URL to your Baïkal calendar. | Required |
BAIKAL_USER |
Your Baïkal username. | Required |
BAIKAL_PASS |
Your Baïkal password. | Required |
SYNC_FREQUENCY |
How often to sync in minutes. | 5 |
CALENDAR_ID |
Optional calendar ID to match against. | — |
Quick Start
-
Clone or download this repository.
-
Create a
.envfile (optional but recommended):ICS_URL="https://outlook.office365.com/owa/calendar/your-calendar.ics" BAIKAL_URL="https://your-baikal.com/dav.php/calendars/user/calendar-id/" BAIKAL_USER="your-username" BAIKAL_PASS="your-password" SYNC_FREQUENCY=5 -
Run with Docker Compose:
docker compose up -d -
Check Logs:
docker compose logs -f baikal-sync -
Check Health:
curl http://localhost:8081/health curl http://localhost:8081/metrics
Building & Publishing
-
Build:
docker build -t lagortinez/baikal-sync:latest . -
Push:
docker push lagortinez/baikal-sync:latest