Befox/cdav

carddav client settings (mac contacts)

punkyard opened this issue · 24 comments

to set up a carddav client, it takes:
type of account : (advanced?)
username: (superadmin user name, for instance)
password: (password, ok)
server: http(s?)://mywebsite.net/../cdav/server.php/addressbooks/SameUsernameAsAbove/default/
or
https://mywebsite.net:8843/../cdav/server.php
path: /addressbooks/tresorier/default/ ?
Port: 443? 8843? SSL, no SSL?
or ..
or ..
which makes more than a hundred possibilities to test :/ ..

so far: "impossible de vérifier le nom et le mot de passe du compte"
the sabre interface is accessible in Safari
but impossible to "log in" and have the user validated in Contacts ..

could someone share precisely one's functioning settings please XXL?

bitte schone
punk, france

(contacts mac os x catalina)

jpfox commented

Have you read troubleshootings paragraph in Readme file?
What is your server configuration?
apache / nginx?
php in apache module, php fast cgi, php fpm ?
php version?

hey thanks for the reply and suggestion
i guess the ReadMe file holds the same content as https://github.com/Befox/cdav?

my host server :
Version Apache | 2.4.41
Version de PHP | 7.2.24
i can't access the PHP settings, fast cgi ou fpm, I dont know

i'm about to set my choice on Dolibarr for a public organization
cdav needs to work for every plateforme according to each user working with us
i would like to give correct settings to each user .. but i can't have it to work for myself on Contacts mac nor iOs !! ^^
though, I have two other carddav accounts installed which work fine (with path as /principals/..)
(and these two are deactivated as i'm trying to install cdav account)

i've noticed in the readme the comment about apache in .htaccess
but these lines seem to be already in the .htaccess file of cdav
SetEnvIf Authorization
and <IfModule too

i have tried Cdav in htdocs and custom folders, same answer "Unable to verify account name or password."

cheers JP

(on planethoster free plan for this dolibarr test)

jpfox commented

I think your hosting environment is not compatible with cdav module authentication. It occurs sometimes with this kind of hosting :-(

jpfox commented

It doesn't depend on client software, it is a server setup problem

arff bugger!

then, do you think it would be possible for you to tell me the exact needs of a right server setup?
cause i've tried with mamp and another online hosting, and it won't work either ..
probably something i'm doing wrong ..

wishing u a happy new year
and thanks a lot for your response 👍

jpfox commented

I do not know how Mac environment works.

SabreDAV is well known to work on Apache 2 with mod_php. Be sure that these php extensions are active :

  • ctype
  • date
  • dom
  • gd
  • iconv
  • libxml
  • mbstring
  • pcre
  • spl
  • simplexml

This script in a simple test.php page on your server would let you know :

<?php
    phpinfo();
?>

YES all these extensions are active

  • the cdav module in dolibarr is active
  • on the different local or web installations of dolibarr i'm testing (planethoster, byehost32 and mamp) i can read in "URL CardDAV": http://.../htdocs/cdav/server.php/addressbooks/tresorier/default/
  • if i type this URL in my browser, I can login and access to the vcards ..

if my 3 servers are not right, is there a documentation where I could read the exact server needs of this cdav module for dolibarr to work fine?

or is there any other information about my server that could lead you to help me again?

( btw, i'm using fruux, which created sabre, and i have no problem using it on every environment i have tested it on. on another website, the cpanel offers a carddav sync based on nextcloud, and it works all fine, mac os and ios )

jpfox commented

Have you enabled a specific authentication method ? 2fa, captcha or other ? it could be incompatible !

You can also enable debug logging to know what is happening while sync. You should find in generated log file some precious information.

In cdav/server.php line 32 remove comments and specify a path where server is enable to write :

// debug in cdav module folder
$debug_file = fopen( __DIR__ . '/cdav_'.date('Ymd').'.log','a');
// $debug_file = false;

no, no authentification method

i've created a 'log' folder : should it be :
32 $debug_file = fopen( '/log/' . '/cdav_'.date('Ymd').'.log','a');
33 $debug_file = false;

you told me about the server specifications before. can you tell me which server i should use?
amongst 3 i'm using, is there one i should run these tests on?
do you reckon the localhost version (mamp) could be the most appropriate to run these tests?

do you acknoledge the fact that i can login through the URL designated in the URL CardDAV menu?

http://localhost:8888/dolibarr-10.0.4/htdocs/cdav/server.php/addressbooks/tresorier/default/
loggin
logged

hi,
i moved the module to another online server, and the authentification functioned straight away!
so i guess I won't have an explanation for the other servers .. tho, I found no logs ..

so, the account has been added to Contacts on mac os
but the contacts won't synch ..

the server is apache, php is fastCGI, php version is on 'default' (the latest being 7.3 on ISPconfig)
any lead to move on please ?

enabling debug logging seems too advanced for me
dolibarr is v10

I've the same problem... Connection OK, but contacts don't appear..

jpfox commented

A new version has been published with some changes in contact synchronization. You should try it. It permits contacts and thirdparties synchronization (must be activated in module settings).

Hi, sync on Mac still impossible... Connection seems OK, but any contact appears yet...

jpfox commented

Have your tried to connect, as punkyard made, with a simple web browser ?
What happened ? Are you able to navigate in Sabre DAV directories and find your contacts ? (I just want to know if it is specific to mac or a general server problem)

Yes it works. and it works on iOS devices.

Capture d’écran 2022-03-16 à 11 28 03

jpfox commented

and in Node "addressbooks" and then "default", you have a list of contacts ?
If so, are you able to open it ? it is a vcf file

Yes, I can download the fil
Capture d’écran 2022-03-16 à 11 34 06
e

jpfox commented

could you put the url of your last screenshot (ending with default/) in your mac sync settings ?

jpfox commented

There is a debugging option on macos X
Maybe you could enable it to see some error messages.

First paragraph : "debuging" on this page :
https://sabre.io/dav/clients/osx-addressbook/

could you put the url of your last screenshot (ending with default/) in your mac sync settings ?

Done, nothing happened