A fork of Davical with adjustments
README.md

Davical (fork) #

This is a CalDAV and CardDav server, this is a a soft-ish fork of DAViCal-go which itself is a Go port of PHP DAViCal. It works directly against the existing DAViCal PostgreSQL database schema with no schema changes required, and can run alongside the PHP/Go version.

Until I come up with a better name this project will simply go by davical-fork

Features #

  • CalDAV (RFC 4791) — calendars, events, tasks
  • CardDAV (RFC 6352) — address books and contacts
  • WebDAV (RFC 4918) — core protocol, locking, ACL
  • CalDAV Scheduling (RFC 6638) — iTIP delivery, inbox/outbox
  • WebDAV Collection Sync (RFC 6578) — efficient sync tokens
  • Calendar proxy (Apple CalendarServer extension)
  • Dead properties, expand-property REPORT
  • Command-line administration tool
  • Web administration tool
  • SMTP

Requirements #

  • Go 1.24 or later (or use our container image directly - see below)
  • PostgreSQL with an existing DAViCal database schema (or setup a fresh one using the davical-admin db init command)

Building #

make

Running #

DATABASE=postgres://user:pass@host:5432/davical ./davicald

See CONFIGURATION.md for all available environment variables.

For a loopback AT Protocol OAuth login test, run:

scripts/local-dev-atproto-oauth.sh --email you@example.com

It creates or updates .env, starts the Compose stack, applies schema updates, and prepares the atmosphere-admin account. Pass --did did:... when the DAViCal email intentionally differs from the AT Protocol account email.

If you are migrating from PHP DAViCal, cfg2env does a best-effort conversion of your existing config.php into a dotenv-style file of the equivalent davical-go environment variables. Only settings with a davical-go equivalent are translated (the database connection, timezone, server name, scheduling, lock timeout, …); anything without one is listed as a comment so you can see what was not carried over. Review the result before using it:

./cfg2env /etc/davical/config.php > davical.env

Container image #

CI builds a minimal multi-arch (linux/amd64, linux/arm64) image from scratch containing only three statically-linked binaries — davicald, davical-cron and davical-admin — and pushes it to the project's GitLab Container Registry as :latest. The IANA time zone database is embedded in the binaries, so no extra files are needed.

docker run -d --name davical -p 8080:8080 \
  -e DATABASE=postgres://user:pass@db:5432/davical \
  registry.gitlab.com/davical-project/davical-go:latest

The image carries no CA certificates. If outbound TLS verification is required (e.g. PostgreSQL with sslmode=verify-full, or davical-cron tz-update), mount the host bundle read-only:

  -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro

Only davicald runs on startup. The other two binaries are run on demand:

  • In-container — runs with the container's filesystem, network and env (so the DATABASE set at docker run time is inherited):

    docker exec -it davical /davical-cron refresh-alarms
    
  • From the host — execute the binary directly from the running container's overlay directory. This runs as a host process (host network, host config, container env not inherited), which is the recommended way to run davical-admin so the privileged owner/DBA DSN never lives in the container environment:

    MERGED="$(docker inspect davical | jq -r '.[0].GraphDriver.Data.MergedDir')"
    "${MERGED}/davical-admin" --dsn postgres://owner@db:5432/davical user list
    

    (Requires the overlay2 storage driver and root to read the overlay dir.)

Differences from DAViCal #

davical-fork has full smtp mail sending support so that attendees are informed of event changes. The Web UI dropped in the go port has been rebuilt with Svelte, embedded in the go service.

Testing #

Browser administration UI build #

The normal Go build deliberately does not require Node or generated UI files. Build the opt-in embedded administration surface with:

make davicald-adminui

This runs the locked SvelteKit build, copies its static distribution into the ignored embed staging directory, and builds davicald with the adminui tag. An ordinary go build remains available for CLI and source-only workflows.

The regression suite replays over 500 real CalDAV/CardDAV client interactions and compares responses to stored expected output. At this point all tests are passing, but the system needs real-world testing as well.

make test-setup   # initialise the regression database (required once)
make test         # run all tests

See testing/README.md for full details.

License #

This software is dual-licensed under the CC0 1.0 Universal public domain dedication or, at your option, the Apache License 2.0 (CC0-1.0 OR Apache-2.0). You may use, modify, and distribute it for any purpose without restriction; the Apache option is provided for those whose licensing policies do not accept CC0, and includes an express patent grant.

Exception: the regression tests in testing/regression-suite/ are adapted from the original DAViCal project, are the work of several authors, and remain licensed under the GPL-2.0-or-later. See testing/regression-suite/LICENSE.

  • PHP DAViCal — the original implementation
  • Go DAViCal - The upstream go implementation this project is based off of
  • AWL — shared PHP library used by PHP DAViCal