Giter Site home page Giter Site logo

cozy-sync's Introduction

Cozy Sync

Cozy Sync allows you to synchronize your Contacts and your Calendars from your Cozy with any device or software that supports CalDAV and CarDAV protocols.

Install

We assume here that the Cozy platform is correctly installed on your server.

You can simply install the WebDAV application via the app registry. Click on ythe Chose Your Apps button located on the right of your Cozy Home.

From the command line you can type this command:

cozy-monitor install webdav

Contribution

You can contribute to the Cozy WebDAV in many ways:

  • Pick up an issue and solve it.
  • Translate it in a new language.
  • Allow to sync only contacts with a given tag.
  • Allow to sync only calendars with a given tag.

Hack

Hacking the WebDAV app requires you setup a dev environment. Once it's done you can hack Cozy Contact just like it was your own app.

git clone https://github.com/mycozycloud/cozy-webdav.git

Run it with:

node server.js

Each modification of the server requires a new build, here is how to run a build:

cake build

Tests

Build Status

To run tests type the following command into the Cozy WebDAV folder:

cake tests

In order to run the tests, you must only have the Data System started.

Icons

by iconmonstr

Main icon by Elegant Themes.

Contribute with Transifex

Transifex can be used the same way as git. It can push or pull translations. The config file in the .tx repository configure the way Transifex is working : it will get the json files from the server/locales repository. If you want to learn more about how to use this tool, I'll invite you to check this tutorial.

License

Cozy WebDAV is developed by Cozy Cloud and distributed under the AGPL v3 license.

What is Cozy?

Cozy Logo

Cozy is a platform that brings all your web services in the same private space. With it, your web apps and your devices can share data easily, providing you with a new experience. You can install Cozy on your own hardware where no one profiles you.

Community

You can reach the Cozy Community by:

  • Chatting with us on IRC #cozycloud on irc.freenode.net
  • Posting on our Forum
  • Posting issues on the Github repos
  • Mentioning us on Twitter

cozy-sync's People

Contributors

aenario avatar clochix avatar dkm avatar felix-lambert avatar frankrousseau avatar jacquarg avatar jsilvestre avatar kelukelu avatar m4dz avatar nono avatar poupotte avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cozy-sync's Issues

sync mac not ok, sync android 95% ok

We tried again to sync contact and calendar with mac apps (ical and contact).
We let you see the files attached.

blablabib
calendrier

However, if nothing happen for calendar, for contact, the mac app managed to send a new contact (just created as a test) to the server.
What is weird is that, mac doesn't say anything when we create the account, everything seems fine. Only when we want to sync, it says that...

Finally, on android device, after installing "Caldav Sync Free Beta" and "Carddav Sync Free Beta", we manage to sync contact both way, and have a sync android to cozy for the calendar (cozy to android work only to delete an event, not to create).

getCard function breaks when contact is null.

When a CardDAV client creates a new contact, the getCard function gets executed.
https://github.com/mycozycloud/cozy-webdav/blob/master/backends/carddav.coffee#L31

This is because a PUT request is called with a client-side generated ID.
Using the if-none-match: * request header the client indicates that it wants to create the contact if the client-side generated ID does not conflict with a server-side ID already present. See the RFC chapter on this.

Using the redis.js backend as example I noticed that the getCard function should call the callback with no arguments if there is no entry in the database.

Adding the following line resolves the issue.

return callback() if !contact

Error HPE_INVALID_CONSTANT

Error found in the logs of the proxy, but when syncing calendar, so I think this is the better place to report it.

[Tue, 08 Sep 2015 09:29:12 GMT] - PROPFIND /public/sync/calendars/me/Cozy/ - 207 - 11.280 ms -  -
[Tue, 08 Sep 2015 09:29:12 GMT] - REPORT /public/sync/calendars/me/Cozy/ - 207 - 145.291 ms -  -
{ [Error: Parse Error] bytesParsed: 637, code: 'HPE_INVALID_CONSTANT' }

Sync server identifier field does not allow choice of username

On this page cozycloud.cc/#apps/sync/
there is a request to provide identifiers for syncing.

A randomly generated password is conveniently thrown in the password field, but there is no other choice available than "ME" in the username field. Bug of feature?

iOS caldav sync appears to be broken

On iOS8 with calendar app, there's a strange sequences of webdav requests that produces an unexpected effect: we can add events to the cozy calendars, but the cozy calendars' events never appears in iOS calendar app oO…

So, when accessing to https://matthias.cozycloud.cc/public/sync/principals/me/, the sequence of requests is:

  • METHOD PROPFIND / STATUS 207
  • METHOD OPTIONS / STATUS 200
  • METHOD PROPFIND / STATUS 401 UNAUTHORIZED
<d:error xmlns:d="DAV:" xmlns:a="http://ajax.org/2005/aml"> 
    <a:exception>NotAuthenticated</a:exception> 
    <a:message>No basic authentication headers were found</a:message> 
    <a:jsdav-version>0.3.2</a:jsdav-version> 
</d:error>
  • METHOD PROPFIND / STATUS 207

Then when accessing a calendar such as https://matthias.cozycloud.cc/public/sync/calendars/me/M4D/, sequence is:

  • METHOD PROPFIND / STATUS 207
  • METHOD REPORT / STATUS 501 Not Implemented

So the lack of REPORT method support seems to prevent calendar app to get remote calendar informations.

FYI, when adding an event (https://matthias.cozycloud.cc/public/sync/calendars/me/Confs/CC66969A-DCFF-4FE5-9404-1E6152B4D1D6.ics), the sequence is:

  • METHOD PUT / STATUS 201 Created

But I can't edit it because of:

  • METHOD PUT / STATUS 412 Precondition Failed
<d:error xmlns:d="DAV:" xmlns:a="http://ajax.org/2005/aml"> 
    <a:exception>PreconditionFailed</a:exception> 
    <a:message>An If-None-Match header was specified, but the ETag matched (or * was specified).</a:message> 
    <a:jsdav-version>0.3.2</a:jsdav-version> 
    <a:header>If-None-Match</a:header>
</d:error>

But deletion is OK with:

  • METHOD DELETE / STATUS 204 No Content

Calendar Sync: Error 401 on some apps only

I changed my MacOS calendar software form iCal to BusyCal2 and tried others :

iCal

Account adding and sync works fine on iCal:

PROPFIND /public/principals/me/ 207 7.507 ms - -                                
OPTIONS /public/principals/me/ 200 6.557 ms - -                                 
REPORT /public/principals 401 0.467 ms - -                                      
REPORT /public/principals 200 5.963 ms - -                                      
PROPFIND /public/calendars/me/ 401 0.454 ms - -                                 
PROPFIND /public/calendars/me/ 207 26.052 ms - -                                
PROPPATCH /public/calendars/me/ 207 6.316 ms - -                                
PROPPATCH /public/calendars/me/ 207 5.977 ms - -                                
PROPPATCH /public/calendars/me/mon%20agenda/ 207 9.317 ms - -                   
PROPPATCH /public/calendars/me/mon%20agenda/ 207 9.306 ms - -

Notice the strange

PROPFIND /public/calendars/me/ 401 0.454 ms - - 

in the middle though.

BusyCal2

When on BusyCal 2, I use the exact same settings (URL, protocol, credentials), but can't fetch anything :

PROPFIND /public/principals/me/ 401 8.503 ms - -                                
PROPFIND /public/principals/me/ 401 7.369 ms - -                                
PROPFIND /public/principals/me/ 401 8.026 ms - -  
...

Tried to change my password, iCal detected it and gave me a 401, which became a 207 after password change.
I also tried on both a Cozy test instance and on a personal instance.
On random, after several similars 401 errors, I managed to connect on my personal instance.

PROPFIND /public/principals/me/ 401 1.728 ms - -
PROPFIND /public/principals/me/ 207 15.876 ms - -
OPTIONS /public/principals/me/ 200 8.219 ms - -
REPORT /public/principals 401 0.669 ms - -
REPORT /public/principals 200 9.526 ms - -
PROPFIND /public/calendars/me/ 401 0.703 ms - -
PROPFIND /public/calendars/me/ 207 65.832 ms - -
PROPPATCH /public/calendars/me/ 207 20.734 ms - -
PROPPATCH /public/calendars/me/ 207 13.658 ms - -
PROPPATCH /public/calendars/me/mon%20agenda/ 207 17.343 ms - -

Soho Organizer 9

Works fine

aCal on Android

Works fine

Trouble getting today events with CalDav

Hi,

I'm trying to write an application that get today events from my CozyCloud calendar with CalDav.

I'm writing NodeJS code and I'm using https://github.com/gaye/dav as a connector, but the time-range filters do not seem to be taken into account. I tried https://github.com/jachwe/node-caldav but I get

{ declaration: { attributes: { version: '1.0', encoding: 'utf-8' } },
  root: 
   { name: 'd:error',
     attributes: { 'xmlns:d': 'DAV:', 'xmlns:a': 'http://ajax.org/2005/aml' },
     children: 
      [ { name: 'a:exception',
          attributes: {},
          children: [],
          content: 'ReportNotImplemented' },
        { name: 'a:message',
          attributes: {},
          children: [],
          content: 'ReportNotImplemented' },
        { name: 'a:jsdav-version',
          attributes: {},
          children: [],
          content: '0.3.2' },
        { name: 'd:supported-report', attributes: {}, children: [] } ],
     content: '' } }

So I'm wondering if this functionality has been implemented server side or if I'm the one doing something wrong.

Thank you for your help,

Jb

Event upstreaming not working

When I create an event on my smartphone (android) and that I make a sync it doesn't appear on my Cozy.

Editing an existing event works though. It also works from Cozy to the smartphone.

Calendar sync error

When my smartphone tries to sync the calendars on my cozy, I get this error :

undefined
REPORT /public/calendars/me/Perso/ 501 729.838 ms - -

This is the only Calendar for which I get this error.

The client is Caldav-Sync (Android)
I can provide the ical file on demand.
If I launch "Synchronisation Longue" in the "Comptes et synchronisations" I can sync again the calandar

Unsupported "BDAY" property

As reported by @hansbkk

Google's representation for birthday

BDAY:1961-04-05

gets dropped completely on import into Cozy

Cozy's vCard export represents it as:

X-;TYPE=BIRTHDAY:1961-04-05

Cozy-Sync crash when I sync my contacts

Hello,

When I try to synchronize my contacts with my phone, cozy-sync crash with this message in log file:

info: socket.io started
^[[90mGET / ^[[36m304 ^[[90m354.934 ms - -^[[0m
[Fri, 01 May 2015 18:44:37 GMT] - GET / - 304 - 355.937 ms -  -
^[[90mPUT /public/addressbooks/me/all-contacts/c87fb0b2973ec5f0746c2e32de280dd8.vcf ^[[33m412 ^[[90m127.721 ms - -^[[0m
^[[90mPROPFIND /public/addressbooks/me/all-contacts/ ^[[32m207 ^[[90m125.916 ms - -^[[0m

TypeError: Cannot call method 'toUpperCase' of undefined
    at Function.VCardParser.toVCF (/usr/local/cozy/apps/sync/node_modules/cozy-vcard/lib/index.js:576:28)
    at ModelConstructor.Contact.toVCF (/usr/local/cozy/apps/sync/build/server/models/contact.js:101:39)
    at /usr/local/cozy/apps/sync/build/server/backends/carddav.js:94:24
    at /usr/local/cozy/apps/sync/node_modules/async/lib/async.js:227:13
    at iterate (/usr/local/cozy/apps/sync/node_modules/async/lib/async.js:134:13)
    at /usr/local/cozy/apps/sync/node_modules/async/lib/async.js:145:25
    at /usr/local/cozy/apps/sync/node_modules/async/lib/async.js:229:17
    at /usr/local/cozy/apps/sync/build/server/backends/carddav.js:95:18
    at ModelConstructor.Contact.toVCF (/usr/local/cozy/apps/sync/build/server/models/contact.js:101:12)
    at /usr/local/cozy/apps/sync/build/server/backends/carddav.js:94:24

Especially when I remove a contact.

Thank you.

Problem syncing with DAVdroid

Auth is working fine, but sync (contact / calendar) does not work.

Also opened an issue in DAVdroid :
https://github.com/rfc2822/davdroid/issues/260#issuecomment-45704094

I/davdroid.SNISocketFactory(17538): Established TLSv1 connection with dkm.cozycloud.cc using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "PROPFIND /public/webdav/calendars/me/my-calendar/ HTTP/1.1[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "Depth: 1[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "Content-Length: 134[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "Host: dkm.cozycloud.cc[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "User-Agent: DAVdroid/0.5.14-alpha[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "Authorization: Basic bWU6bDFwLVFKQjNS[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "<propfind xmlns="DAV:">[\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "   <prop>[\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "      <CS:getctag xmlns:CS="http://calendarserver.org/ns/"/>[\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "      <getetag/>[\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "   </prop>[\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 >> "</propfind>"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "HTTP/1.1 207 Multi-Status[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "Server: nginx[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "Date: Tue, 27 May 2014 16:16:19 GMT[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "Content-Type: application/xml; charset=utf-8[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "Connection: keep-alive[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "Set-Cookie: connect.sid=s%3A0%2BuuNzQCemGon1rR9cU3YLBQ.vQbqJceV3hnyEgf%2FbQ20vuElp8e19TjZ39Xn%2BrMqj9c; Path=/; Expires=Thu, 26 Jun 2014 16:16:19 GMT; HttpOnly[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "vary: Brief,Prefer[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "dav: 1,3,extended-mkcol,addressbook,calendar-access,access-control,calendarserver-principal-property-search[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "10a[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "<?xml version="1.0" encoding="utf-8"?><d:multistatus xmlns:d="DAV:" xmlns:a="http://ajax.org/2005/aml" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:dav="urn:DAV" xmlns:card="urn:ietf:params:xml:ns:carddav"></d:multistatus>[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "0[\r][\n]"
D/ch.boye.httpclientandroidlib.wire(17538): http-outgoing-0 << "[\r][\n]"
E/davdroid.DavSyncAdapter(17538): Invalid DAV response
E/davdroid.DavSyncAdapter(17538): at.bitfire.davdroid.webdav.DavNoContentException: Invalid DAV response: HTTP response entity (content) expected but not received
E/davdroid.DavSyncAdapter(17538):   at at.bitfire.davdroid.webdav.WebDavResource.processMultiStatus(WebDavResource.java:409)
E/davdroid.DavSyncAdapter(17538):   at at.bitfire.davdroid.webdav.WebDavResource.propfind(WebDavResource.java:273)
E/davdroid.DavSyncAdapter(17538):   at at.bitfire.davdroid.resource.RemoteCollection.getMemberETags(RemoteCollection.java:68)
E/davdroid.DavSyncAdapter(17538):   at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:75)
E/davdroid.DavSyncAdapter(17538):   at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:129)
E/davdroid.DavSyncAdapter(17538):   at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
I/davdroid.DavSyncAdapter(17538): Sync complete for com.android.calendar
D/davdroid.DavSyncAdapter(17538): Closing httpClient

Card creation does not preserve the URI

When cards are created by the client, it sends a PUT request with a URI like this.

PUT /public/webdav/addressbooks/me/all-contacts/<UID>.vcf
<CARD_DATA>

---
201 Created

Both on Android with CardDav Sync Free and Thunderbird with the 2 Oct nightly build of SOGo-connector, they do a lookup of the expected resource after that.

HEAD|PROPFIND /public/webdav/addressbooks/me/all-contacts/<UID>.vcf

---
404 File not found

On Android, this results in the assumption that the resource is in fact in sync with the server, because of the 201 reply with the PUT request.
The next time a sync is performed, the vCard associated with the URI proposed by the client is discarded in favour of the server-side generated URI (<ID>.ics).

On Thunderbird with SOGo however, the 404 reply of the PROPFIND of the client-side proposed URI means that the client assumes it was never in sync with the server. Meaning that the next time a sync is performed, the client will try to PUT the resource again. But it also adds the server-side generated URI to the contact list. Meaning that a new contact will be inserted in the total list, every sync.

Unsupported field "type" of property TEL

As reported by @hansbkk

In the Google interface, there is a pre-defined pair of strings "Home fax" and "Work fax", which get exported as follows in the vCard:

TEL;TYPE=WORK;TYPE=FAX:212 555 2345
TEL;TYPE=HOME;TYPE=FAX:212 555 3456

These both show up in Cozy as "FAX" alone, so it is impossible to tell which is the home fax number and which is the work number.

My work-around solution for now is to enter these as a custom string rather than using Google's predefined labels, which will export as:

item1.TEL:212 555 2345
item1.X-ABLabel:Work Fax

and this works fine, but obviously it isn't ideal to require the user to have to remember which google labels work with Cozy and which don't.

sync - reset - bug d'affichage

dans l'appli Sync,
sur Android / chrome.
je clique sur reset password. je vois le "login" mais pas le user.

même chose sur pc / windows / chrome, je vois le mdp.

guillaume

Re initializing password doesn't update the password in the UI without a reload

As reported by user Cemoi71 :

On appuie d'abord sur "montrer" (le mot de passe) pour l'avoir en clair. Quand on appuie après sur réinitialise, un nouveau mot de passe est créé. En appuyant de nouveau sur "montrer", il est de nouveau changé surl 'ancien. Le seul moyen de le fixer/enregistrer est de se déconnecter, après avoir réinitialiser.

Improve contact tooltip UX

The contact adding UX is bad: it displays poorly the contact information, the contact pictures is bigger than the tooltip and the button doesn't react when mouse is over.

WebDAV status

When I add the "Sync" app, I see the setup instructions for cal/carddav, but under webdav it states "Cozy doesn't support file synchronization through WebDAV". Does that mean webdav is unavailable, or that the sync client is not yet available? I'm interested in the webdav server part.

Keep unknown attributes

When adding an event that contains CalDAV attributes that are unknown to Cozy, they are deleted by default. While cozy/cozy-calendar issue #97 is not mandatory, this one would be sufficient to use only cozy (and get rid of my owncloud instance for realz \o/). I guess you could set up a member of Event that would contain a String attribute "others" or something like this. I can do it if you want, but I might need a lot of help for finding all places that need changes!

STR

  • Set up a synced calendar account on Thunderbird, e.g.
  • Create an event in Thunderbird.
  • Give it a reminder.

Expected

When synchronizing with the cozy instance, the reminder should be kept (even if the cozy calendar doesn't handle them).

Observed

The reminder is "forgotten" during the sync, i.e. the event doesn't have a reminder after a sync.

Needed ports

Hi !

On my server, all ports are blocked by default (It's a VM with NAT port redirections).

When I try to configure Webdav with my iPhone, he cannot connect.
But with my browser, it's possible.

The https port is 26003.

Webdav need other ports to be open ?
Or any idea ?

Thank's a lot guys and good work ;-)

Sync FFOX 3.0

Caldav works perfectly between cozy and FFOS 3.0 using the Thunderbird link! Both way, it works great!

About contact, I try using the two apps that I could find on the marketplace, SyncDav (https://marketplace.firefox.com/app/syncdav?src=search, github : https://github.com/tuxgasy/SyncDav/issues ) and CardDavSync (https://marketplace.firefox.com/app/carddavsync?src=search , contact : [email protected] ). In both cases, it syncs only one way from server to pocket computer, from cozy to FFOS.

SyncDav download only the phone number, and everytime I click on sync it download everything, even the one I downloaded before.
CardDavSync seems better because it download names and number (probably the rest also, email and stuff but I don't know, I didn't try). And it doesn't download all everytime. However, it "download/create" weird contact, uncomplete (just the phone or an empty contact..).

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.