GithubHelp home page GithubHelp logo

forwardemail / caldav-adapter Goto Github PK

View Code? Open in Web Editor NEW
25.0 9.0 8.0 202 KB

CalDAV server for Node.js and Koa. Modernized and maintained for @forwardemail

Home Page: https://forwardemail.net

License: MIT License

JavaScript 99.67% Shell 0.33%
cal caldav card carddav dav email express forward imap javascript

caldav-adapter's People

Contributors

aharter avatar sdenardi avatar sedenardi avatar titanism avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caldav-adapter's Issues

CardDAV support

Hey πŸ‘‹ would happily sponsor efforts to add CardDAV support too πŸ”₯

Allday events not working properly

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?

ETag with Android

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

SQLITE DUMP
android_metadata
| locale |
| ***** |

settings
| setting | value |

services
| _id | accountName | service | principal |
| 1 | user@ex | caldav | https://192.168.100.11:3001/caldav/p/[email protected]/ |

sqlite_sequence
| name | seq |
| services | 1 |
| homesets | 2 |
| collections | 2 |

homesets
| _id | serviceID | url |
| 2 | 1 | https://192.168.100.11:3001/caldav/cal/[email protected]/ |

collections
| _id | serviceID | url | readOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | sync |
| 1 | 1 | https://192.168.100.11:3001/caldav/cal/[email protected]/exampleCal2/ | 0 | Example Calendar 2 | | | | 1 | 0 | 1 |
| 2 | 1 | https://192.168.100.11:3001/caldav/cal/[email protected]/exampleCal1/ | 1 | Example Calendar 1 | | | | 1 | 0 | 0 |

SYSTEM INFORMATION
Android version: 10 (QP1A.190711.020.A705MNXXU5BTC2)
Device: Samsung SM-A705MN (a70q)

--- END DEBUG INFO ---

Tests and Compatibility Documentation (CardDAV/CalDAV RFC Support)

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:

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.

Question: setting macOS

Hello.

I run sample code.

I'm getting rid of something ... I can't configure the CalDav account (macOS Catalina - 10.15.5):
caldav-account-setup

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

getEventsByDate seems to have not the correct response for iCal

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.

Which clients has this been tested with?

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?

Webapp/Express framework support

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}"`
      });

how to run?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.