-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement URL and IM field types in CardDAV
Partially takes care of: #104
- Loading branch information
Showing
7 changed files
with
318 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,120 @@ | ||
This directory contains random test and exploration code that can be used to activate and test specific areas of the code base in isolation. In particular the "gold/" directory is meant to be the full unit test suite that every change should pass before commit. This directory, otoh, is to do some probing (like print a given outlook entry, or clear specific flags, or some such one time operation in a debug cycle). | ||
This directory contains random test and exploration code that can be | ||
used to activate and test specific areas of the code base in | ||
isolation. In particular the "gold/" directory is meant to be the full | ||
unit test suite that every change should pass before commit. This | ||
directory, otoh, is to do some probing (like print a given outlook | ||
entry, or clear specific flags, or some such one time operation in a | ||
debug cycle). | ||
|
||
* Misc bits about testing | ||
|
||
Some random bits of information relevant for testing. This section is | ||
not meant to be intelligble to anyone other than the author (skarra@) | ||
|
||
** CardDav testing | ||
|
||
*** Setup Baikal on localhost | ||
|
||
At various points in the past I have used CardDav servers from Baikal | ||
and Apple "Calendar Server". | ||
|
||
On upgrading to macOS Mojave stuff stopped working and I had to redo a | ||
bunch of things in Apr 2019: | ||
|
||
- Set up Apache, like so: | ||
https://coolestguidesontheplanet.com/install-apache-mysql-php-on-macos-mojave-10-14/ | ||
(and a bunch of other stuff to get the basic Apache config in | ||
order). | ||
|
||
- Set up Baikal: http://sabre.io/baikal/install/ Ran into this error: | ||
"Baïkal needs to have write permissions in the Specific/ folder." | ||
Had to make that directory world writable. Oh well. | ||
|
||
Eventually http://localhost/baikal/html/admin/install worked well, | ||
and was able to complete some basic config and baikal installation | ||
was completed | ||
|
||
Created a new test account with following credentials: | ||
- username: unittest1 and unittest2 | ||
- email: [email protected] | ||
- Password: <saved to Chrome profile> for URL localhost/baikal/html | ||
|
||
This is super useful information for later reference: | ||
http://sabre.io/dav/building-a-carddav-client/ | ||
|
||
- Finally set up Baikal to be on a separate virtualhost with the | ||
following config: | ||
|
||
<VirtualHost *:80> | ||
DocumentRoot /Library/WebServer/Documents/baikal/html | ||
ServerName baikal | ||
|
||
RewriteEngine On | ||
RewriteRule /.well-known/carddav /dav.php [R,L] | ||
RewriteRule /.well-known/caldav /dav.php [R,L] | ||
|
||
<Directory "/Library/WebServer/Documents/baikal/html"> | ||
Options None | ||
Options +FollowSymlinks | ||
AllowOverride All | ||
|
||
# Confiugration for apache-2.2: | ||
Order allow,deny | ||
Allow from all | ||
|
||
# Confiugration for apache-2.4: | ||
Require all granted | ||
</Directory> | ||
</VirtualHost> | ||
|
||
Note that the main localhost stuff is as follows: | ||
|
||
<VirtualHost *:80> | ||
DocumentRoot "/Library/WebServer/Documents" | ||
ServerName localhost | ||
<Directory "/Library/WebServer/Documents"> | ||
Options FollowSymLinks Multiviews | ||
MultiviewsMatch Any | ||
AllowOverride None | ||
Require all granted | ||
</Directory> | ||
</VirtualHost> | ||
|
||
*** Testing - MacOS Mojave Contacts does not work | ||
|
||
Also tried using caldavclientlibrary to inspect the carddav server | ||
|
||
- One of the main problemsin testing carddav automatically is to | ||
effect changes on the server via "other means" - either | ||
programmatically or manually through another interface. Setting up | ||
Apple Contacts on Mac to read the carddav server has been a pain. | ||
|
||
2019-04-27: The following config does not work: | ||
- CardDAV, Manual | ||
- username:password (same as what I used for ASynK) | ||
- Server Address: http://localhost/baikal/html/card.php | ||
- Server Path: /addressbooks/unittest1/default/ | ||
|
||
Tried a bunch of variations on the Server path to | ||
/addressbooks/default/ etc but nothing works | ||
|
||
I tried enabling some network logging in OSX, like so: | ||
|
||
$ defaults write com.apple.AddressBook.CardDAVPlugin EnableDebug -bool YES | ||
$ defaults write com.apple.AddressBook.CardDAVPlugin LogConnectionDetails -bool YES | ||
|
||
And logs were supposed to show up using Console.app in | ||
~/Library/Logs; it does not work. Just WTF... | ||
|
||
*** Testing - BusyContacts works and displays contacts from Baikal | ||
|
||
Installed 30 day trial version of https://www.busymac.com/busycontacts/ and it just | ||
worked with the localhost version of Baikal. | ||
|
||
username: unittest1 | ||
Password: <from chrome password manager> | ||
server: http://baikal/ - that's it. | ||
|
||
Testing flow was like so: | ||
|
||
- Clear all c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,26 @@ | ||
This directory contains unit tests that must pass before anything can be released. At this time the coverage is, er, rather poor. But the idea is this will evolve into a proper regression test suite that every commit / batch of commits should pass before being accepted to the master branch. | ||
This directory contains unit tests that must pass before anything can | ||
be released. At this time the coverage is, er, rather poor. But the | ||
idea is this will evolve into a proper regression test suite that | ||
every commit / batch of commits should pass before being accepted to | ||
the master branch. | ||
|
||
* 2019-04-22 Thoughts on CardDAV gold testing | ||
|
||
As of today there is no automated testing for CardDAV sync (or any of | ||
the others for that matter). Here are some thoughts on what it could be. | ||
|
||
CardDAV testing can be along following lines: | ||
|
||
Pre-requisites: | ||
- CardDAV server on locahost | ||
- test principal account | ||
|
||
Test 1 | ||
- Clear all the contacts | ||
- Initialize ASynK with a sample BBDB file and write a bunch of | ||
contacts to the CardDAV server | ||
- make a raw HTTP or other carddav query for contacts, and validate | ||
number of contacts and contents. | ||
|
||
The last step might require us to use this project or something | ||
similar to: https://github.com/apple/ccs-caldavtester for automation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
;; -*-coding: utf-8-emacs;-*- | ||
;;; file-format: 7 | ||
["Debajeet, the Great" "Das" nil nil ("HolidayIQ") (["Work" "+91 80 4115 3595"] ["Mobile" "+91 97381 65128"]) nil ("[email protected]") ((bbdb-id . "d476c03a-e5c8-11e1-8d79-3c07541b9945") (creation-date . "2012-08-10 09:47:58 +0000") (timestamp . "2012-08-10 09:50:06 +0000") (title . "Manager") (department . "B2B Marketing") (notes . "Does something in HolidayIQ :) Met him when went to their office in July 2012.") (seen-in . "INBOX") ) nil] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
;; -*-coding: utf-8-emacs;-*- | ||
;;; file-format: 7 | ||
;; | ||
;; One structurd phone number | ||
;;["John" "Doe" nil nil nil (["Mobile" 0 0 0 60]) nil ("[email protected]") ((creation-date . "2013-12-06 14:33:49 +0000") (timestamp . "2013-12-20 17:56:49 +0000")) nil] | ||
;; | ||
;; One structured phone number with a dot notation | ||
["John" "Doe" nil nil nil (["Mobile" 0 0 0 60.8]) nil ("[email protected]") ((creation-date . "2013-12-06 14:33:49 +0000") (timestamp . "2013-12-20 17:56:49 +0000")) nil] | ||
;; | ||
;; One Unstructured European style number | ||
["John" "Doe" nil nil nil (["Mobile" "+91 44 2811 2640"]) nil ("[email protected]") ((creation-date . "2013-12-06 14:33:49 +0000") (timestamp . "2013-12-20 17:56:49 +0000")) nil] | ||
;; | ||
;; Two variants of structured number | ||
["John" "Doe" nil nil nil (["Mobile" 0 0 0 60.8] ["Mobile" 0 0 0 60]) nil ("[email protected]") ((creation-date . "2013-12-06 14:33:49 +0000") (timestamp . "2013-12-20 17:56:49 +0000")) nil] | ||
;; | ||
;; All variants in single entry | ||
["John" "Doe" nil nil nil (["Mobile" 0 0 0 60.8] ["Mobile" 0 0 0 60] ["Mobile" "+91 44 2811 2640"]) nil ("[email protected]") ((creation-date . "2013-12-06 14:33:49 +0000") (timestamp . "2013-12-20 17:56:49 +0000")) nil] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// -*- javascript -*- | ||
|
||
// This is the starter file for test scripts doing testing between | ||
// BBDB and CardDAV | ||
|
||
{ | ||
'file_version' : 4, | ||
'default_profile' : null, | ||
|
||
'profiles' : { | ||
"testbbcd" : { | ||
"coll_1" : { | ||
"dbid" : "bb", | ||
"foid" : "default", | ||
"stid" : "user_dir/01.06-bbdb.v7.names-with-commas" | ||
}, | ||
|
||
"coll_2" : { | ||
"dbid" : "cd", | ||
"foid" : "default" | ||
"stid" : "http://localhost/baikal/html/card.php" | ||
}, | ||
|
||
"conflict_resolve" : "bb", | ||
"items" : {}, | ||
"last_sync_start" : "2000-01-20T13:25:20.16Z", | ||
"last_sync_stop" : "2000-01-20T13:25:20.86Z", | ||
"olgid" : null, | ||
"sync_dir" : "SYNC2WAY" | ||
}, | ||
}, // 'profiles' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BEGIN:VCARD | ||
VERSION:3.0 | ||
PRODID:-//ASynK v2.2.0+//EN | ||
UID:29f46d0f-04f4-11e7-a1c4-9801a799b56f | ||
EMAIL;TYPE=INTERNET,pref,WORK:[email protected] | ||
FN:Ailis Brocato | ||
N:Brocato;Ailis;;; | ||
ORG:To-Me; | ||
REV:20170318T110955 | ||
X-ASYNK-CREATED:20170309T181358Z | ||
X-ASYNK-SYNCTAG-OWNCLD91-BB:d21ae84c-a4e2-11e1-ae00-3c07541b9945 | ||
IMPP;TYPE=HOME:home_im | ||
END:VCARD |