forwardemail / caldav-adapter Goto Github PK
View Code? Open in Web Editor NEWCalDAV server for Node.js and Koa. Modernized and maintained for @forwardemail
Home Page: https://forwardemail.net
License: MIT License
CalDAV server for Node.js and Koa. Modernized and maintained for @forwardemail
Home Page: https://forwardemail.net
License: MIT License
Dear @sedenardi
Congratulations for the amazing work.
Im not very experienced with koa, so couldnt make neither example or server.js to work.
how to run (easy step by step)
thanks
if you set your phone (iPhone) to only sync the calendar in the last 3 months, then the calendarapp does not show any appointments anymore.
the response xml of getEventsByDate is different to getEventsForCalendar.
the response of getEventsByDate:
<D:response>\n <D:href>/caldav/cal/mh%404myhealth/3/3c650653-aaf3-11ea-92ee-134a1fc8b503.ics</D:href>\n <D:propstat>\n <D:status>HTTP/1.1 200 OK</D:status>\n </D:propstat>\n </D:response>
response of getEventsForCalendar:
<D:response>\n <D:href>/caldav/cal/mh%404myhealth/3/3c650653-aaf3-11ea-92ee-134a1fc8b503.ics</D:href>\n <D:propstat>\n <D:status>HTTP/1.1 200 OK</D:status>\n <D:prop>\n <D:getcontenttype>text/calendar; charset=utf-8; component=VEVENT</D:getcontenttype>\n <D:getetag/>\n </D:prop>\n </D:propstat>\n </D:response>
after the client received the response of getEventsForCalendar, the client is loading every single event.
thats not the case for getEventsByDate.
maybe because of the missing "D:getcontenttype" tag.
i hope this helps to fixing the issue.
Hey π would happily sponsor efforts to add CardDAV support too π₯
If responses.length === 0
, then res
is constructed from the previous nsMap
, so the <multistatus>
element from previous response is returned again. Correct would be to return an empty <multistatus>
element in that case.
Consider adapting this line folding method as in sebbo2002/ical-generator#223.
Regarding the Future bullet you have in the README:
- Add support for Express and other frameworks
I'm looking to integrate CalDAV into a Meteor server, which uses the webapp framework. I believe webapp was the basis for Express and they're mostly compatible, but I'm not familiar with Koa.
Do you have a sense of how difficult it would be to port? I assume it's mostly src/koa.js
that needs to change. I've only taken a quick look, but it looks fairly straightforward. For example:
ctx.status = 401;
ctx.response.set('WWW-Authenticate', `Basic realm="${opts.authRealm}"`);
would probably change to
res.writeHead(401, {
'WWW-Authenticate': `Basic realm="${opts.authRealm}"`
});
Very excited to someone work on a project like this! I have often thought of building something on top of Caldav, but never had the time to read up on the protocol.
How far have you gotten in the implementation? Does it work with eg. Apple's Calendar app or with eg. Google's? Or is the support yet more basic than that?
Anything you would need help with?
Hello.
I run sample code.
I'm getting rid of something ... I can't configure the CalDav account (macOS Catalina - 10.15.5):
On Sign In the request is send to server:
<?xml version="1.0" encoding="UTF-8"?>
<A:propfind xmlns:A="DAV:">
<A:prop>
<A:principal-URL/>
</A:prop>
</A:propfind>
Server (node -> v14.0.0) always respond: Unauthorized
- I catch comunication with mitmroxy.
If is change Server path
to something else eq: /calendar
the response is outside caldav server
an idea where I was wrong ...
Thank you
Dear @sedenardi ! It me again.
I was trying to use your tool with android devices. Found out that they do not have native support for caldav protocol as iOS does.
So I did a research for the most acceptable open and free solution, for it, and discovered that there are only few stable, and one of most promising is the OpenSync. (https://play.google.com/store/apps/details?id=com.deependhulla.opensync)
However I had trouble in order to get it working, as it says something with ETag missing.
Can you provide any tip so that I can adjust it?
Thanks again!
--- BEGIN DEBUG INFO ---
SYNCHRONIZATION INFO
Synchronization phase: 8
Account name: user@ex
Authority: com.android.calendar
CURRENT REMOTE RESOURCE:
https://192.168.100.11:3001/caldav/cal/[email protected]/exampleCal2/EE6BCBAF-C85B-49F5-A5C4-6EFB9F5090FF.ics
EXCEPTION:
at.bitfire.dav4android.exception.DavException: Server didn't provide ETag
at com.deependhulla.opensync.syncadapter.SyncManager.compareLocalRemote(SyncManager.java:439)
at com.deependhulla.opensync.syncadapter.SyncManager.performSync(SyncManager.java:175)
at com.deependhulla.opensync.syncadapter.CalendarsSyncAdapterService$SyncAdapter.onPerformSync(CalendarsSyncAdapterService.java:70)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:334)
SOFTWARE INFORMATION
OpenSync version: 1.5.0.3-ose (145) Tue Apr 18 04:03:24 GMT-03:00 2017
Installed from: com.android.vending
JB Workaround installed: no
CONFIGURATION
Power saving disabled: no
android.permission.READ_CONTACTS permission: denied
android.permission.WRITE_CONTACTS permission: denied
android.permission.READ_CALENDAR permission: granted
android.permission.WRITE_CALENDAR permission: granted
org.dmfs.permission.READ_TASKS permission: denied
org.dmfs.permission.WRITE_TASKS permission: denied
System-wide synchronization: automatically
Account: user@ex
Address book sync. interval: β
Calendar sync. interval: 240 min
OpenTasks sync. interval: β
WiFi only: false
[CardDAV] Contact group method: GROUP_VCARDS
[CalDAV] Time range (past days): 90
Manage calendar colors: true
SYSTEM INFORMATION
Android version: 10 (QP1A.190711.020.A705MNXXU5BTC2)
Device: Samsung SM-A705MN (a70q)
--- END DEBUG INFO ---
Hi,
We have implemented your adapter, but are currently having issues with allDay events. They will not get displayed as events that are for the whole day (or multiple days) but they will show as events that block the whole day.
I tried to pass a moment object for Start and end date, as well as a date object, but the result is the same.
I am pretty sure the problem is that our allDay events are from gmt+2 time zone, but canβt find a solution.
In what format should i put the start and end date for allDay events to work?
As per https://en.wikipedia.org/wiki/Comparison_of_CalDAV_and_CardDAV_implementations#Server_implementations we should probably outline the compatibility with all the different specs. We should also edit that Wikipedia and include this project too afterwards.
The current DAV header is here https://github.com/sedenardi/node-caldav-adapter/blob/bdfbe17931bf14a1803da77dbb70509db9332695/src/common/response.ts#L8-L25
The main ones it is missing appear to be:
extended-mkcol
(WebDAV; extended-mkcol β not essential)calendar-proxy
(Calendar Delegation; gives users other access to your calendar, https://sabre.io/dav/caldav-proxy/, iCal and BusyCal support it)calendarserver-sharing
(sharing and calendar publishing, see https://github.com/apple/ccs-calendarserver/blob/master/doc/Extensions/caldav-sharing.txt)calendarserver-subscribed
addressbook
(CardDAV)access-control
(related to sharing calendarserver-sharing
and extendedmkcol
)calendarserver-principal-property-search
(calendar discovery, https://datatracker.ietf.org/doc/html/rfc3744#section-9.4)The calendar-auto-schedule
is arbitrary and a related discussion is at Kozea/Radicale#34 and Kozea/Radicale#1337. Almost none of the implementations support it, so we should try to be 1:1
with the most supported and well-known.
For testing, we could leverage https://github.com/natelindev/tsdav, albeit more specific tests would need to be added. One could copy/paste one of these folders and rewrite to use a test with this Koa server, e.g. https://github.com/natelindev/tsdav/tree/master/src/__tests__/integration.
I think that we will be submitting a PR to this project to try to add support for CardDAV, since none of the other open-source projects have MIT or MPL like licensing, as this one does.
The Fennel project has some inspiration at https://github.com/LordEidi/fennel.js/blob/abfc371701fcb2581d8f1382426f0ef9e9846554/libs/communication.js#L143, https://github.com/LordEidi/fennel.js/blob/abfc371701fcb2581d8f1382426f0ef9e9846554/handler/addressbook.js#L31 (CardDAV), and https://github.com/LordEidi/fennel.js/blob/abfc371701fcb2581d8f1382426f0ef9e9846554/handler/principal.js#L86.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.