Commit graph

20 commits

Author SHA1 Message Date
Krystian Chachuła
7969df1a38 Add handling of SIGINT and SIGTERM
Handle exit signals so that deferred calls are executed. It's mainly
to unlink the socket before exiting.
2024-07-08 12:07:08 +02:00
Krystian Chachuła
42b36e3421 Add Unix socket support 2024-07-08 12:04:52 +02:00
Conrad Hoffmann
a74c76857d Initial multi-calendar/address book support
Thanks to the latest version of go-webdav, this is now a thing. A lot of
operations (like creating a calendar) are not yet supported. But the
basics work fine. Note that multi-calendar means that different users
can each have their own calenders. Resource sharing is not yet
implemented either.

Includes the adding of a lot of debug logs, as issues are otherwise
pretty hard to figure out. The logging still needs to be made more
consistent, and probably cleaned up a bit in some places.
2024-02-02 22:39:10 +01:00
Krystian Chachuła
0a5e6946fb Add TLS support 2022-12-17 20:48:39 +01:00
Conrad Hoffmann
b266d53b15 Pass capabilites to principal path handler
The capabilities are added automatically by the default principal path
handlers in the `caldav` and `carddav` packages. However, using the
custom handler, they have to be passed in manually.

These being missing before was a violation of the RFC and the cause for
issues when using e.g. DavX5 client. This is now fixed.
2022-12-14 15:19:02 +01:00
Conrad Hoffmann
40bae8dc31 Switch to a proper logging library
Structured logs can be enabled with `-log.json`.
2022-12-01 13:46:25 +01:00
Conrad Hoffmann
c033c1dfcb Allow PROPPATCH method
This only tells chi to pass those requests to the regular handler. It is
not really handled well in go-webdav so far (work in progress).
2022-05-18 10:21:31 +02:00
Conrad Hoffmann
53b2c88311 Adapt to latest changes in go-webdav
There is now only one last PR missing before we can start using the
vanilla upstream go-webdav again. Thanks a lot to Simon for his patience
reviewing my PRs!
2022-05-13 15:38:02 +02:00
Conrad Hoffmann
4765adc1a3 Use NewHTTPError to return better errors
That function is merged upstream, but the current version still depends
on some stuff not yet merged into upstream go-webdav.
2022-05-06 09:16:17 +02:00
Conrad Hoffmann
001917295d Add CalDAV support, refactor
The filesystem storage backend now implements the required functions to
act as a basic CalDAV server. Some refactoring was done based on the
go-webdav development: introduce a UserPrincipalBackend, a new function
to serve the user principal URL, and more. See this PR for lots of
details: https://github.com/emersion/go-webdav/pull/62

Also adds a simple facility for debug output.
2022-05-03 16:06:47 +02:00
Conrad Hoffmann
0f2356f42d Register COPY & MOVE methods with chi 2022-02-24 13:39:03 +01:00
Conrad Hoffmann
edd01ff7a3 Make storage backend configurable via -storage.url
Same mechanism as for configuring the auth backend.
2022-02-23 21:09:20 +01:00
Conrad Hoffmann
d917938a29 Start simple filesystem storage backend 2022-02-23 21:09:20 +01:00
Conrad Hoffmann
6051fec4c4 Register WebDAV-specific HTTP methods with chi
Otherwise the router will return 405 before the request makes it to our
middleware.
2022-02-22 18:28:37 +01:00
Conrad Hoffmann
071ee7c729 Implement configurable auth providers
New providers need to "register" their URL scheme of choice in
auth.NewFromURL().

Implements: https://todo.sr.ht/~sircmpwn/tokidoki/1
2022-02-22 11:44:37 +01:00
Simon Ser
5f8e94c4a1 Fix chi routing to CardDAV handler
We could probably just stick to net/http here...
2022-02-21 11:47:58 +01:00
Simon Ser
97f86226d6 Rig up CardDAV backend to HTTP server
References: https://todo.sr.ht/~sircmpwn/tokidoki/3
2022-02-21 11:39:57 +01:00
Simon Ser
13008e0d96 go fmt 2022-02-21 11:11:27 +01:00
Drew DeVault
5a641ceca1 Implement IMAP auth provider 2022-02-21 10:55:02 +01:00
Drew DeVault
96ef5f9b2a Initial server skeleton 2022-02-21 10:10:25 +01:00