6.14
Stretch
Odroid HC2
or (EG: RPi3)dietpi-bugreport
a2778078-b465-4286-8a6b-76ecddbc78b1CalDav/CardDav clients should connect without further configuration from an end-user
Nextcloud CalDav/CardDav services aren't seen by CalDav/CardDav clients
@LexiconCode
Checking user-given URL: https://CensoredURL/nextcloud
As we do not place any .well-known
dirs into the webroot (or into nextcloud directory), or redirect those to the final Cal/Card/WebDAV URLs, you need to add the full URL.
Go to Nextcloud web UI, navigate to calendar and contacts app respectively, open settings at the bottom left. There you can copy the Cal/CardDAV URL. In my case e.g. its:
DAVdroid btw. accesses Card- and CalDAV, not WebDAV, which is for data transfer, e.g. used by the Nextcloud clients. Can you configure Nextcloud desktop/mobile clients without issues?
If with the above method sync works as expected, we can turn the issue into a feature request to allow adding URLs
@LexiconCode
Just another quick question, which webserver do you use?
In case of nginx e.g. the following entries inside location ^~ /nextcloud {
statement should do it, without creaking any other parallel Cal/CardDAV servers: https://docs.nextcloud.com/server/14/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx
location = /nextcloud/.well-known/carddav {
return 301 $scheme://$host/nextcloud/remote.php/dav;
}
location = /nextcloud/.well-known/caldav {
return 301 $scheme://$host/nextcloud/remote.php/dav;
}
There are similar possibilities for other webservers.
I'm using the Apache Web server. Normal clients desktop/android nextcloud clients connect as expected.
I believe the configuration for enabling Apache.
Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav
I'll get back to you today but with the results of testing.
Apparently I need to edit .htaccess
but where is it stored?
@LexiconCode
I believe it's
Redirect 301 /nextcloud/.well-known/carddav /nextcloud/remote.php/dav
Redirect 301 /nextcloud/.well-known/caldav /nextcloud/remote.php/dav
then, if your.domain.org/nextcloud
shall work. Yours should further allow DAVdroid to find the endpoints by just entering only your.domain.org
๐ค.
@MichaIng
Which file do I edit and were?
.htaccess
? nextcloud.conf
?
@LexiconCode
Not sure if it works inside .htaccess
, there are some limitations and more importantly it gets overwritten by Nextcloud on update and occ maintenance commands.
So better add it to /etc/apache2/sites-available/nextcloud.conf
, inside the
On Lighttpd:
url.redirect = (
"^/nextcloud/.well-known/caldav" => "/nextcloud/remote.php/dav",
"^/nextcloud/.well-known/carddav" => "/nextcloud/remote.php/dav"
)
๐ด DAVdroid still fails, while manual access to <URL>/nextcloud/.well-known/caldav
via browser correctly is redirected to <URL>/nextcloud/remote.php/dav
and entering <URL>/nextcloud/remote.php/dav
in DAVdroid works as well ๐ค. Does DAVdroid not search for .well-known/cal[/card]dav
?
๐ฏ๏ธ The following works, outside the /nextcloud location directive:
url.redirect = (
"^/.well-known/caldav" => "/nextcloud/remote.php/dav",
"^/.well-known/carddav" => "/nextcloud/remote.php/dav"
)
.well-known
inside nextcloud sub dir, but only inside webroot. With the above, regardless if only my.domain.org
or my.domain.org/nextcloud
is added as base URL, DAVdroid finds the dav endpoints as wanted.In case of Apache, /var/www/nextcloud/.htaccess
already contains the following:
RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
I tried to test with Thunderbird Lightning. Seems the same there, with /nextcloud
inside redirect, a yellow rectangle and error log indicates that caldav could not be connected to. With the above working solution, Lightning does not show the rectangle any more. But instead it disables the calendar completely. Not sure, since v60 Lightning <> Nextcloud cal/carddav sync anyway has some issues. Could fix it with a cookie ignore workaround, but maybe there is more broken.
@LexiconCode
Do you have another Cal/CardDAV client than DAVdroid, to test? Would be great if you could verify that with all clients you use:
cat << _EOF_ >> /etc/apache/sites-available/nextcloud.conf
Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav
_EOF_
your.domain.org/nextcloud
and as well your.domain.org
If there is no way to limit it to your.domain.org/nextcloud
, we have to decide if we expect ownCloud/Nextcloud users to also use it for Cal/CardDAV and implement the above. Because if another Cal/CardDAV client, e.g. baikal is used, this may break connection. Of course we could do some magic cross checks to decide where to redirect cal/cardDAV requests to, but I am not keen to implement such things, based on guesses how users might want to use their system. Then better leave it as it is and suggest users to copy the full dav endpoint path into their clients ๐ค.
I will work on finding and testing some Cal/CardDAV clients tomorrow. DAVdroid works.
I have a good idea how we can handle it and by this implement redirection into other DAV servers as well:
dietpi-dav_redirect.conf
or something.Everything checks it seems to work in a few clients I was able to find for Windows!
@LexiconCode
Great, will finish the PR about this tomorrow. The other new network issues prevented from finish this today ๐
.
@LexiconCode
I added the redirects to the PR: https://github.com/Fourdee/DietPi/pull/2065
For Apache, I followed the method that is used within their .htaccess
, using mod_rewrite
. Not sure about the difference/advantage to the Redirect
directive of mod_alias
: https://httpd.apache.org/docs/2.2/mod/mod_alias.html#Redirect
mod_rewrite
exists(?).Redirect
directive, some mod_rewrite. Certbot default configuration uses the latter as well, so somehow this seems to be beneficial. But I will investigate by times when to use which method.โฌ: Finally moved everything to use redirection (301 status reply) instead of rewrite, as this is faster and cleaner and recommended by all official docs.
PR finished, finally ๐ : https://github.com/Fourdee/DietPi/pull/2065
Testing on all webservers and distro versions passed here.
We implemented this just the right time. Since Nextcloud v14.0.2 there appear admin panel warnings, if .well-known/caldav|carddav
is not found ๐:
Whoopsie, fixed wrong Nextcloud+Apache redirect conf: https://github.com/Fourdee/DietPi/commit/3d79bc418893ae7574876ccc38fef557f18ef069
๐ฏ๏ธ Nextcloud + Apache
@MichaIng
Thanks for resolving this ๐ , now looks completed? I'll mark as closed, please reopen if required.