-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: CardDAV support #1284
feat: CardDAV support #1284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing. Really amazing. I could not have done this myself. Can't wait to see how it evolves.
\Debugbar::disable(); | ||
|
||
// TODO: Not sure if this is needed, check later | ||
date_default_timezone_set('Europe/Berlin'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything, probably should be set to UTC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
* Returns the list of addressbooks for a specific user. | ||
* | ||
* Every addressbook should have the following properties: | ||
* id - an arbitrary unique id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use our HashID here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try, need to see if we can use non-numeric values.
* This method should work identical to getCard, but instead return all the | ||
* cards in the list as an array. | ||
* | ||
* If the backend supports this, it may allow for some speed-ups. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't it?
*/ | ||
function check(\Sabre\HTTP\RequestInterface $request, \Sabre\HTTP\ResponseInterface $response) { | ||
Log::debug(__CLASS__.' check', func_get_args()); | ||
if (Auth::check() || Auth::attempt(['email' => $request->getRawServerValue('PHP_AUTH_USER'), 'password' => $request->getRawServerValue('PHP_AUTH_PW')])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be easier to put Auth::attempt(['email' => $request->getRawServerValue('PHP_AUTH_USER'), 'password' => $request->getRawServerValue('PHP_AUTH_PW')])
in a variable so this line is more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I might revert back to using https://laravel.com/docs/5.6/authentication#stateless-http-basic-authentication I prefer using the framework systems whenever possible, but I need to figure out the issue with sync first.
It currently works for IOS and Evolution. This means the basic building blocks for CardDAV are in place and all that remains is polishing. This means adding other fields, data, and setting up the ReadOnly permissions. |
@kidk awesome! Let me know when you need a review! |
I'm super excited for this to land. Having a contacts database that's shared with my wife + a nice UI + a way to record extra notes and stuff is gonna be amazing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @kidk for your help!! |
No problem, just glad to help on such an amazing project. Thanks for cleaning up the code. I have some time the next couple of weeks to test and improve the code where needed. So feel free to tag me on any bugs or feature requests. |
// Disable debugger for caldav output | ||
Debugbar::disable(); | ||
|
||
// Initiate custom backends for link between Sabra and Monica |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Initiate custom backends for link between Sabra and Monica | |
// Initiate custom backends for link between Sabre and Monica |
} | ||
|
||
/** | ||
* Returns a specific principal, specified by it's path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Returns a specific principal, specified by it's path. | |
* Returns a specific principal, specified by its path. |
CHANGELOG
Outdated
@@ -18,6 +18,7 @@ UNRELEASED CHANGES: | |||
* API breaking change: Remove 'PUT /contacts/:contact_id/pets/:id' in favor of 'PUT /pets/:id' with a 'contact_id' | |||
* API breaking change: Every validator fails now send a HTTP 400 code (was 200) with the error 32 | |||
* API breaking change: Every Invald Parameters errors now send a HTTP 400 (was 500 or 200) code with the error 41 | |||
* Add CardDAV support (readonly) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Add CardDAV support (readonly) | |
* Add CardDAV support (readonly - disabled by default). To enable it, toggle the `CARDDAV_ENABLED` env variable. |
I am unable to see the options to sync over CardDav. Is there already some documentation, or where can find this? Thnx! |
@dosch The feature is not yet available on app.monicahq.com, we have to validate it yet, but it will be activated soon. |
Hi folks! Carddav is now activated on all account on app.monicahq.com! |
I (finally) added the Monica Carddav to my Contacts.app in MacOS. Am I missing something? |
This pull request has been automatically locked since there |
WIP for #582
This is what I have after spending a couple of hours on it, the basic UI of Sabre works, but the two clients I've tested give me errors.
There is still a lot of debug code in there, but I wanted to already share this to see if people have comments or requests. I've added a TODO below to give you an idea on the work that is still needed.