Hi,
did anybody get baikal (http://baikal-server.com) working with caddy?
I already opened an issue on the baikal side, but it might be more related to caddy. Thus, I am asking here again.
The issue on the baikal side can be found here:
https://github.com/netgusto/Baikal/issues/433
It works fine with lighttpd.
My Caddyfiles looks like follows:
$mydomain.net
gzip
fastcgi / /var/run/php5-fpm.sock php
rewrite /wiki {
regexp .*
ext /
to /wiki/index.php?_url={uri}
}
redir {
^/.well-known/carddav /baikal/card.php
^/.well-known/caldav /baikal/cal.php
}
log access.log
errors errors.log
Any suggestions?
Only rewrite
supports regexp in Caddy.
Since the redirect is not doing anything special you can as well rewrite the requests.
rewrite {
r ^/.well-known/carddav
to /baikal/card.php
}
rewrite {
r ^/.well-known/caldav
to /baikal/cal.php
}
Also, what is the expected behaviour and what is not working ?
Thanks, but I figured that I do not need the regexp, therefore I can go with:
redir {
^/.well-known/carddav /baikal/card.php
^/.well-known/caldav /baikal/cal.php
}
Baikal syncs contacts and calendar entries via carddav and caldav. The web-gui works fine and does not report any error. However, the clients such as El Cap. cannot access the calendar any more:
https://$mydomain.net/baikal/cal.php/principals/$user/ is not a location that supports this request.
It seems the errors is the same as here https://github.com/netgusto/Baikal/issues/267.
Thus, the redirect should solve the issue. I can verify that the redirect works via accessing the url:
https://$mydomain.net/.well-known/carddav/
Anything else which could caddy do different than lighttpd regarding the redirect?
Replicating the redirect in the referenced issue.
redir 301 {
/.well-known/carddav /baikal/card.php
/.well-known/caldav /baikal/cal.php
}
Thanks. Still I am unable to create the account and login.
I don`t really where to search the error now.
Can you share a working lighthttpd or nginx configuration.
Sure, this is my current lighttpd config:
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite",
)
server.document-root = "/var/www/"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
# baikal for El Capitan
url.redirect = (
"^/.well-known/carddav" => "/baikal/card.php/",
)
}
Are the register+login pages on .pl or .fcgi files? Or an index file like index.lighttpd.html for some reason? What do you mean by "unable" - what's the exact behavior.
The login page for the web admin interface is a index.php. With this interface everything works fine. I am just unable to connect via caldav or carddav. The Calendar.app from El Cap says: "unable to verify account name or password".
The url to connect the calendar for instance is:
https://mydomain.net/baikal/cal.php/principals/username
@mholt
There is this question posted at fruux/Baikal#433
405 would indicate 'Method not allowed'. Typically this means that it is a server configuration issue. I don't know caddy at all, is it possible that it blocks HTTP methods that it doesn't understand? PROPFIND isn't really a common HTTP method outside of webdav.
$myip - [10/Jan/2016:13:40:08 +0100] "PROPFIND /baikal/cal.php/principals/$user/ HTTP/1.1" 405 47
Yeah, they're right. Caddy's FastCGI middleware currently only supports the standard HTTP methods like GET, POST, DELETE, PATCH, etc...
@abiosoft maybe we could make another function in fcgiclient.go that takes a method then calls .Post() (like the others, but even many of those, like Put, Patch, and Delete could be refactored to use this more general function) after setting the method to a custom value?
Yeah. We can.
This is how it looks like when accessing with DAVdroid
111.222.333.444 - [28/Jan/2016:22:26:14 -0500] "PROPFIND / HTTP/2.0" 405 23
111.222.333.444 - [28/Jan/2016:22:26:14 -0500] "OPTIONS / HTTP/2.0" 200 341
111.222.333.444 - [28/Jan/2016:22:26:15 -0500] "PROPFIND /card.php HTTP/2.0" 200 2873
111.222.333.444 - [28/Jan/2016:22:26:15 -0500] "PROPFIND / HTTP/2.0" 405 23
111.222.333.444 - [28/Jan/2016:22:26:15 -0500] "OPTIONS / HTTP/2.0" 200 341
111.222.333.444 - [28/Jan/2016:22:26:15 -0500] "PROPFIND /cal.php HTTP/2.0" 200 2917
That's weird, in that log every other PROPFIND request was 200. How did those work?
Could this have something to do with the rewrite
?
rewrite {
r ^/.well-known/carddav
to card.php
}
rewrite {
r ^/.well-known/caldav
to cal.php
}
Here is the DAVdroid debug log. To make the log smaller I removed some of the exceptions as well as some of the php.
111.222.333.444
and https://dav.domain.com
are bogus.
1)
Caddy
111.222.333.444 - [29/Jan/2016:09:10:28 -0500] "PROPFIND / HTTP/2.0" 405 23
DAVdroid
[info ] *** STARTING COLLECTION DISCOVERY FOR SERVICE CARDDAV***
[info ] Check whether user-given URL is a calendar collection and/or contains home-set and/or has current-user-principal
[trace] --> PROPFIND https://dav.domain.com/ HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 320
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><CARD:addressboo\
[trace] k-home-set /><resourcetype /><displayname /><CARD:addressbook-description /><current-\
[trace] user-privilege-set /><current-user-principal /></prop></propfind>
[trace] --> END PROPFIND (320-byte body)
[trace] <-- HTTP/1.1 405 (972ms)
[trace] content-type: text/plain; charset=utf-8
[trace] server: Caddy
[trace] x-content-type-options: nosniff
[trace] content-length: 23
[trace] date: Fri, 29 Jan 2016 14:10:28 GMT
[trace] OkHttp-Sent-Millis: 1454076628092
[trace] OkHttp-Received-Millis: 1454076628348
[trace] 405 Method Not Allowed
[trace] <-- END HTTP (23-byte body)
[debug] PROPFIND on user-given URL failed - EXCEPTION:
at.bitfire.dav4android.exception.HttpException: 405
2)
Caddy
111.222.333.444 - [29/Jan/2016:09:10:28 -0500] "OPTIONS / HTTP/2.0" 200 341
DAVdroid
[trace] --> OPTIONS https://dav.domain.com/ HTTP/1.1
[trace] --> END OPTIONS
[trace] <-- HTTP/1.1 200 (115ms)
[trace] cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] content-type: text/html; charset=UTF-8
[trace] expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] pragma: no-cache
[trace] server: Caddy
[trace] set-cookie: PHPSESSID=c5imjqhtt9u67fqfge9o4u2tj0; path=/; HttpOnly
[trace] content-length: 341
[trace] date: Fri, 29 Jan 2016 14:10:28 GMT
[trace] OkHttp-Sent-Millis: 1454076628454
[trace] OkHttp-Received-Millis: 1454076628569
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[info ] User-given URL doesn't contain <current-user-principal>, trying /.well-known/carddav
3)
Caddy
111.222.333.444 - [29/Jan/2016:09:10:28 -0500] "PROPFIND /card.php HTTP/2.0" 200 2873
DAVdroid
[trace] --> PROPFIND https://dav.domain.com/.well-known/carddav HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 198
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-pr\
[trace] incipal /></prop></propfind>
[trace] --> END PROPFIND (198-byte body)
[trace] <-- HTTP/1.1 200 (106ms)
[trace] accept-ranges: bytes
[trace] content-type: text/plain; charset=utf-8
[trace] last-modified: Mon, 03 Feb 2014 20:46:11 GMT
[trace] server: Caddy
[trace] content-length: 2873
[trace] date: Fri, 29 Jan 2016 14:10:28 GMT
[trace] OkHttp-Sent-Millis: 1454076628715
[trace] OkHttp-Received-Millis: 1454076628821
[trace] <?php
[trace] /***************************************************************
[trace] * Copyright notice
[trace] *
[trace] * (c) 2013 Jérôme Schneider <[email protected]>
[trace] * All rights reserved
...
[trace] $server->addPlugin(new \Sabre\DAVACL\Plugin());
[trace] # And off we go!
[trace] $server->exec();
[trace] <-- END HTTP (2873-byte body)
[debug] Couldn't determine <current-user-principal> from well-known carddav path - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
4)
Caddy
111.222.333.444 - [29/Jan/2016:09:10:28 -0500] "PROPFIND / HTTP/2.0" 405 23
DAVdroid
[info ] No principal URL yet, trying SRV/TXT records with domain dav.domain.com
[debug] Looking up SRV records for _carddavs._tcp.dav.domain.com
[info ] *** STARTING COLLECTION DISCOVERY FOR SERVICE CALDAV***
[info ] Check whether user-given URL is a calendar collection and/or contains home-set and/or has current-user-principal
[trace] --> PROPFIND https://dav.domain.com/ HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 435
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><CAL:calendar-ho\
[trace] me-set /><CAL:supported-calendar-component-set /><resourcetype /><displayname /><n0:c\
[trace] alendar-color xmlns:n0="http://apple.com/ns/ical/" /><CAL:calendar-description /><CAL\
[trace] :calendar-timezone /><current-user-privilege-set /><current-user-principal /></prop><\
[trace] /propfind>
[trace] --> END PROPFIND (435-byte body)
[trace] <-- HTTP/1.1 405 (106ms)
[trace] content-type: text/plain; charset=utf-8
[trace] server: Caddy
[trace] x-content-type-options: nosniff
[trace] content-length: 23
[trace] date: Fri, 29 Jan 2016 14:10:28 GMT
[trace] OkHttp-Sent-Millis: 1454076628834
[trace] OkHttp-Received-Millis: 1454076628939
[trace] 405 Method Not Allowed
[trace] <-- END HTTP (23-byte body)
[debug] PROPFIND on user-given URL failed - EXCEPTION:
at.bitfire.dav4android.exception.HttpException: 405
5)
Caddy
111.222.333.444 - [29/Jan/2016:09:10:29 -0500] "OPTIONS / HTTP/2.0" 200 341
DAVdroid
[trace] --> OPTIONS https://dav.domain.com/ HTTP/1.1
[trace] --> END OPTIONS
[trace] <-- HTTP/1.1 200 (111ms)
[trace] cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] content-type: text/html; charset=UTF-8
[trace] expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] pragma: no-cache
[trace] server: Caddy
[trace] content-length: 341
[trace] date: Fri, 29 Jan 2016 14:10:29 GMT
[trace] OkHttp-Sent-Millis: 1454076629092
[trace] OkHttp-Received-Millis: 1454076629203
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[info ] User-given URL doesn't contain <current-user-principal>, trying /.well-known/caldav
6)
Caddy
111.222.333.444 - [29/Jan/2016:09:10:29 -0500] "PROPFIND /cal.php HTTP/2.0" 200 2917
DAVdroid
[trace] --> PROPFIND https://dav.domain.com/.well-known/caldav HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 198
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-pr\
[trace] incipal /></prop></propfind>
[trace] --> END PROPFIND (198-byte body)
[trace] <-- HTTP/1.1 200 (112ms)
[trace] accept-ranges: bytes
[trace] content-type: text/plain; charset=utf-8
[trace] last-modified: Mon, 03 Feb 2014 20:46:11 GMT
[trace] server: Caddy
[trace] content-length: 2917
[trace] date: Fri, 29 Jan 2016 14:10:29 GMT
[trace] OkHttp-Sent-Millis: 1454076629346
[trace] OkHttp-Received-Millis: 1454076629454
[trace] <?php
[trace] /***************************************************************
[trace] * Copyright notice
[trace] *
[trace] * (c) 2013 Jérôme Schneider <[email protected]>
...
[trace] # Server Plugins
[trace] $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, BAIKAL_AUTH_REALM));
[trace] $server->addPlugin(new \Sabre\DAVACL\Plugin());
[trace] $server->addPlugin(new \Sabre\CalDAV\Plugin());
[trace] # And off we go!
[trace] $server->exec();
[trace] <-- END HTTP (2917-byte body)
[debug] Couldn't determine <current-user-principal> from well-known caldav path - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
Oh, okay. The 200s are actually errors. That's nice. :expressionless:
I think the change proposed above will fix it. Either @abiosoft or I will get around to it soon.
Nice to see that you got closer to the issue. Thanks! Looking forward to use caddy as soon as it supports baikal!
See #558 and let me know if it helps with the issue.
It looks like it helped because all of the PROPFIND are 200 now. However DAVdroid is giving me No address books or calendars were found
. This could be DAVdroid server misconfiguration, Caddyfile rewrite or maybe something else. I have to admit I'm not familiar with Baikal nor with DAVdroid so will need to dig deeper. Hopefully @TribuneX can test it out.
Here is the log:
1)
Caddy
111.222.333.444 - [01/Feb/2016:09:17:48 -0500] "PROPFIND / HTTP/2.0" 200 341
DAVdroid
[info ] *** STARTING COLLECTION DISCOVERY FOR SERVICE CARDDAV***
[info ] Check whether user-given URL is a calendar collection and/or contains home-set and/or has current-user-principal
[trace] --> PROPFIND https://dav.domain.com/ HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 320
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><CARD:addressboo\
[trace] k-home-set /><resourcetype /><displayname /><CARD:addressbook-description /><current-\
[trace] user-privilege-set /><current-user-principal /></prop></propfind>
[trace] --> END PROPFIND (320-byte body)
[trace] <-- HTTP/1.1 200 (1012ms)
[trace] cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] content-type: text/html; charset=UTF-8
[trace] expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] pragma: no-cache
[trace] server: Caddy
[trace] set-cookie: PHPSESSID=jekfppt1s4rvvb9iqfukvol1k0; path=/; HttpOnly
[trace] content-length: 341
[trace] date: Mon, 01 Feb 2016 14:17:48 GMT
[trace] OkHttp-Sent-Millis: 1454336268064
[trace] OkHttp-Received-Millis: 1454336268369
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[debug] PROPFIND on user-given URL failed - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
...
[info ] No home sets found, looking for <current-user-principal>
2)
Caddy
111.222.333.444 - [01/Feb/2016:09:17:48 -0500] "OPTIONS / HTTP/2.0" 200 341
DAVdroid
[trace] --> OPTIONS https://dav.domain.com/ HTTP/1.1
[trace] --> END OPTIONS
[trace] <-- HTTP/1.1 200 (111ms)
[trace] cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] content-type: text/html; charset=UTF-8
[trace] expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] pragma: no-cache
[trace] server: Caddy
[trace] content-length: 341
[trace] date: Mon, 01 Feb 2016 14:17:48 GMT
[trace] OkHttp-Sent-Millis: 1454336268375
[trace] OkHttp-Received-Millis: 1454336268486
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[info ] User-given URL doesn't contain <current-user-principal>, trying /.well-known/carddav
3)
Caddy
111.222.333.444 - [01/Feb/2016:09:17:48 -0500] "PROPFIND /card.php HTTP/2.0" 200 2873
DAVdroid
[trace] --> PROPFIND https://dav.domain.com/.well-known/carddav HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 198
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-pr\
[trace] incipal /></prop></propfind>
[trace] --> END PROPFIND (198-byte body)
[trace] <-- HTTP/1.1 200 (107ms)
[trace] accept-ranges: bytes
[trace] content-type: text/plain; charset=utf-8
[trace] last-modified: Mon, 03 Feb 2014 20:46:11 GMT
[trace] server: Caddy
[trace] content-length: 2873
[trace] date: Mon, 01 Feb 2016 14:17:48 GMT
[trace] OkHttp-Sent-Millis: 1454336268625
[trace] OkHttp-Received-Millis: 1454336268732
[trace] <?php
[trace] /***************************************************************
[trace] * Copyright notice
...
[trace] # And off we go!
[trace] $server->exec();
[trace] <-- END HTTP (2873-byte body)
[debug] Couldn't determine <current-user-principal> from well-known carddav path - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
...
[info ] No principal URL yet, trying SRV/TXT records with domain dav.domain.com
[debug] Looking up SRV records for _carddavs._tcp.dav.domain.com
[info ] *** STARTING COLLECTION DISCOVERY FOR SERVICE CALDAV***
[info ] Check whether user-given URL is a calendar collection and/or contains home-set and/or has current-user-principal
4)
Caddy
111.222.333.444 - [01/Feb/2016:09:17:48 -0500] "PROPFIND / HTTP/2.0" 200 341
DAVdroid
[trace] --> PROPFIND https://dav.domain.com/ HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 435
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><CAL:calendar-ho\
[trace] me-set /><CAL:supported-calendar-component-set /><resourcetype /><displayname /><n0:c\
[trace] alendar-color xmlns:n0="http://apple.com/ns/ical/" /><CAL:calendar-description /><CAL\
[trace] :calendar-timezone /><current-user-privilege-set /><current-user-principal /></prop><\
[trace] /propfind>
[trace] --> END PROPFIND (435-byte body)
[trace] <-- HTTP/1.1 200 (628ms)
[trace] cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] content-type: text/html; charset=UTF-8
[trace] expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] pragma: no-cache
[trace] server: Caddy
[trace] content-length: 341
[trace] date: Mon, 01 Feb 2016 14:17:48 GMT
[trace] OkHttp-Sent-Millis: 1454336268744
[trace] OkHttp-Received-Millis: 1454336269372
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[debug] PROPFIND on user-given URL failed - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
...
[info ] No home sets found, looking for <current-user-principal>
5)
Caddy
111.222.333.444 - [01/Feb/2016:09:17:49 -0500] "OPTIONS / HTTP/2.0" 200 341
DAVdroid
[trace] --> OPTIONS https://dav.domain.com/ HTTP/1.1
[trace] --> END OPTIONS
[trace] <-- HTTP/1.1 200 (113ms)
[trace] cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] content-type: text/html; charset=UTF-8
[trace] expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] pragma: no-cache
[trace] server: Caddy
[trace] content-length: 341
[trace] date: Mon, 01 Feb 2016 14:17:49 GMT
[trace] OkHttp-Sent-Millis: 1454336269379
[trace] OkHttp-Received-Millis: 1454336269492
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[info ] User-given URL doesn't contain <current-user-principal>, trying /.well-known/caldav
6)
Caddy
111.222.333.444 - [01/Feb/2016:09:17:49 -0500] "PROPFIND /cal.php HTTP/2.0" 200 2917
DAVdroid
[trace] --> PROPFIND https://dav.domain.com/.well-known/caldav HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 198
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-pr\
[trace] incipal /></prop></propfind>
[trace] --> END PROPFIND (198-byte body)
[trace] <-- HTTP/1.1 200 (104ms)
[trace] accept-ranges: bytes
[trace] content-type: text/plain; charset=utf-8
[trace] last-modified: Mon, 03 Feb 2014 20:46:11 GMT
[trace] server: Caddy
[trace] content-length: 2917
[trace] date: Mon, 01 Feb 2016 14:17:49 GMT
[trace] OkHttp-Sent-Millis: 1454336269499
[trace] OkHttp-Received-Millis: 1454336269602
[trace] <?php
[trace] /***************************************************************
[trace] * Copyright notice
...
[trace] # And off we go!
[trace] $server->exec();
[trace] <-- END HTTP (2917-byte body)
[debug] Couldn't determine <current-user-principal> from well-known caldav path - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
...
[info ] No principal URL yet, trying SRV/TXT records with domain dav.domain.com
[debug] Looking up SRV records for _caldavs._tcp.dav.domain.com
And this is the Caddyfile:
dav.domain.com {
root /var/www/dav.domain.com/html
tls [email protected]
rewrite {
r ^/.well-known/carddav
to card.php
}
rewrite {
r ^/.well-known/caldav
to cal.php
}
# access log
log /var/log/caddy/dav.domain.com.access.log {
rotate {
size 10 # rotate after 10 MB
age 30 # keep log files for 30 days
keep 10 # keep at most 10 log files
}
}
# error log
errors {
404 ../../errors/404.html # not found
401 ../../errors/401.html # access denied
log /var/log/caddy/dav.domain.com.errors.log {
size 10 # rotate after 10 MB
age 30 # keep log files for 30 days
keep 10 # keep at most 10 log files
}
}
# php-fpm with Unix socket
fastcgi / /var/run/php5-fpm.sock php
# authentication
basicauth /admin "adminuser" "adminpassword"
}
I just confirmed that DAVdroid works with Baikal when served with Nginx. I setup environment specifically to track this issue so I'm submitting all of the logs again. I know it is a long entry ... sorry for that.
DAVdroid + Baikal + Caddy
Caddyfile
http://dav {
root /var/www/dav/html
tls off
rewrite {
r ^/.well-known/carddav
to card.php
}
rewrite {
r ^/.well-known/caldav
to cal.php
}
# access log
log /var/log/caddy/dav.access.log {
rotate {
size 10 # rotate after 10 MB
age 30 # keep log files for 30 days
keep 10 # keep at most 10 log files
}
}
# error log
errors {
log /var/log/caddy/dav.errors.log {
size 10 # rotate after 10 MB
age 30 # keep log files for 30 days
keep 10 # keep at most 10 log files
}
}
# php-fpm with Unix socket
fastcgi / /var/run/php5-fpm.sock php
}
Caddy access log
10.10.10.111 - [01/Feb/2016:17:44:01 -0500] "PROPFIND / HTTP/1.1" 200 341
10.10.10.111 - [01/Feb/2016:17:44:01 -0500] "OPTIONS / HTTP/1.1" 200 341
10.10.10.111 - [01/Feb/2016:17:44:01 -0500] "PROPFIND /card.php HTTP/1.1" 200 2873
10.10.10.111 - [01/Feb/2016:17:44:01 -0500] "PROPFIND / HTTP/1.1" 200 341
10.10.10.111 - [01/Feb/2016:17:44:01 -0500] "OPTIONS / HTTP/1.1" 200 341
10.10.10.111 - [01/Feb/2016:17:44:01 -0500] "PROPFIND /cal.php HTTP/1.1" 200 2917
DAVdroid debug log
[info ] *** STARTING COLLECTION DISCOVERY FOR SERVICE CARDDAV***
[info ] Check whether user-given URL is a calendar collection and/or contains home-set and/or has current-user-principal
[trace] --> PROPFIND http://dav/ HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 320
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><CARD:addressboo\
[trace] k-home-set /><resourcetype /><displayname /><CARD:addressbook-description /><current-\
[trace] user-privilege-set /><current-user-principal /></prop></propfind>
[trace] --> END PROPFIND (320-byte body)
[trace] <-- HTTP/1.1 200 OK (31ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: text/html; charset=UTF-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=1lp9qq0ir1nv6tl8e7e5aavh07; path=/; HttpOnly
[trace] Date: Mon, 01 Feb 2016 22:44:01 GMT
[trace] Content-Length: 341
[trace] OkHttp-Sent-Millis: 1454366641151
[trace] OkHttp-Received-Millis: 1454366641156
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[debug] PROPFIND on user-given URL failed - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:124)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:85)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:124)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:85)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[info ] No home sets found, looking for <current-user-principal>
[trace] --> OPTIONS http://dav/ HTTP/1.1
[trace] --> END OPTIONS
[trace] <-- HTTP/1.1 200 OK (479ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: text/html; charset=UTF-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=gt73skf67gae5lfjta4n65djc6; path=/; HttpOnly
[trace] Date: Mon, 01 Feb 2016 22:44:01 GMT
[trace] Content-Length: 341
[trace] OkHttp-Sent-Millis: 1454366641166
[trace] OkHttp-Received-Millis: 1454366641641
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[info ] User-given URL doesn't contain <current-user-principal>, trying /.well-known/carddav
[trace] --> PROPFIND http://dav/.well-known/carddav HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 198
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-pr\
[trace] incipal /></prop></propfind>
[trace] --> END PROPFIND (198-byte body)
[trace] <-- HTTP/1.1 200 OK (16ms)
[trace] Accept-Ranges: bytes
[trace] Content-Length: 2873
[trace] Content-Type: text/plain; charset=utf-8
[trace] Last-Modified: Mon, 01 Feb 2016 21:55:22 GMT
[trace] Server: Caddy
[trace] Date: Mon, 01 Feb 2016 22:44:01 GMT
[trace] OkHttp-Sent-Millis: 1454366641655
[trace] OkHttp-Received-Millis: 1454366641662
[trace] <?php
[trace] /***************************************************************
[trace] * Copyright notice
[trace] *
[trace] * (c) 2013 Jérôme Schneider <[email protected]>
[trace] * All rights reserved
[trace] *
[trace] * http://baikal-server.com
[trace] *
[trace] * This script is part of the Baïkal Server project. The Baïkal
[trace] * Server project is free software; you can redistribute it
[trace] * and/or modify it under the terms of the GNU General Public
[trace] * License as published by the Free Software Foundation; either
[trace] * version 2 of the License, or (at your option) any later version.
[trace] *
[trace] * The GNU General Public License can be found at
[trace] * http://www.gnu.org/copyleft/gpl.html.
[trace] *
[trace] * This script is distributed in the hope that it will be useful,
[trace] * but WITHOUT ANY WARRANTY; without even the implied warranty of
[trace] * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[trace] * GNU General Public License for more details.
[trace] *
[trace] * This copyright notice MUST APPEAR in all copies of the script!
[trace] ***************************************************************/
[trace] define("BAIKAL_CONTEXT", TRUE);
[trace] define("PROJECT_CONTEXT_BASEURI", "/");
[trace] if(file_exists(getcwd() . "/Core")) {
[trace] # Flat FTP mode
[trace] define("PROJECT_PATH_ROOT", getcwd() . "/"); #./
[trace] } else {
[trace] # Dedicated server mode
[trace] define("PROJECT_PATH_ROOT", dirname(getcwd()) . "/"); #../
[trace] }
[trace] if(!file_exists(PROJECT_PATH_ROOT . 'vendor/')) {
[trace] die('<h1>Incomplete installation</h1><p>Baïkal dependencies have not been insta\
[trace] lled. Please, execute "<strong>composer install</strong>" in the folder where you ins\
[trace] talled Baïkal.');
[trace] }
[trace] require PROJECT_PATH_ROOT . 'vendor/autoload.php';
[trace] # Bootstraping Flake
[trace] \Flake\Framework::bootstrap();
[trace] # Bootstrapping Baïkal
[trace] \Baikal\Framework::bootstrap();
[trace] if(!defined("BAIKAL_CARD_ENABLED") || BAIKAL_CARD_ENABLED !== TRUE) {
[trace] throw new ErrorException("Baikal CardDAV is disabled.", 0, 255, __FILE__, __LINE__);
[trace] }
[trace] # Backends
[trace] if( BAIKAL_DAV_AUTH_TYPE == "Basic" || preg_match('/Windows-Phone-WebDAV-Client/i', $\
[trace] _SERVER['HTTP_USER_AGENT']) )
[trace] $authBackend = new \Baikal\Core\PDOBasicAuth($GLOBALS["DB"]->getPDO(), BAIKAL_AUT\
[trace] H_REALM);
[trace] else
[trace] $authBackend = new \Sabre\DAV\Auth\Backend\PDO($GLOBALS["DB"]->getPDO());
[trace] $principalBackend = new \Sabre\DAVACL\PrincipalBackend\PDO($GLOBALS["DB"]->getPDO());
[trace] $carddavBackend = new \Sabre\CardDAV\Backend\PDO($GLOBALS["DB"]->getPDO());
[trace] # Setting up the directory tree
[trace] $nodes = array(
[trace] new \Sabre\DAVACL\PrincipalCollection($principalBackend),
[trace] new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
[trace] );
[trace] # The object tree needs in turn to be passed to the server class
[trace] $server = new \Sabre\DAV\Server($nodes);
[trace] $server->setBaseUri(BAIKAL_CARD_BASEURI);
[trace] # Plugins
[trace] $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, BAIKAL_AUTH_REALM));
[trace] $server->addPlugin(new \Sabre\CardDAV\Plugin());
[trace] $server->addPlugin(new \Sabre\DAVACL\Plugin());
[trace] # And off we go!
[trace] $server->exec();
[trace] <-- END HTTP (2873-byte body)
[debug] Couldn't determine <current-user-principal> from well-known carddav path - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.java:444)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:179)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:85)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.java:444)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:179)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:85)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[info ] No principal URL yet, trying SRV/TXT records with domain dav
[debug] Looking up SRV records for _carddavs._tcp.dav
[info ] *** STARTING COLLECTION DISCOVERY FOR SERVICE CALDAV***
[info ] Check whether user-given URL is a calendar collection and/or contains home-set and/or has current-user-principal
[trace] --> PROPFIND http://dav/ HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 435
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><CAL:calendar-ho\
[trace] me-set /><CAL:supported-calendar-component-set /><resourcetype /><displayname /><n0:c\
[trace] alendar-color xmlns:n0="http://apple.com/ns/ical/" /><CAL:calendar-description /><CAL\
[trace] :calendar-timezone /><current-user-privilege-set /><current-user-principal /></prop><\
[trace] /propfind>
[trace] --> END PROPFIND (435-byte body)
[trace] <-- HTTP/1.1 200 OK (18ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: text/html; charset=UTF-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=6tpt56f6o1nspgrrkcte03i973; path=/; HttpOnly
[trace] Date: Mon, 01 Feb 2016 22:44:01 GMT
[trace] Content-Length: 341
[trace] OkHttp-Sent-Millis: 1454366641685
[trace] OkHttp-Received-Millis: 1454366641693
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[debug] PROPFIND on user-given URL failed - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:117)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:86)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:117)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:86)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[info ] No home sets found, looking for <current-user-principal>
[trace] --> OPTIONS http://dav/ HTTP/1.1
[trace] --> END OPTIONS
[trace] <-- HTTP/1.1 200 OK (14ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: text/html; charset=UTF-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=tfa53tr1mgmlb1lb4pgnh5o0p7; path=/; HttpOnly
[trace] Date: Mon, 01 Feb 2016 22:44:01 GMT
[trace] Content-Length: 341
[trace] OkHttp-Sent-Millis: 1454366641705
[trace] OkHttp-Received-Millis: 1454366641713
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[info ] User-given URL doesn't contain <current-user-principal>, trying /.well-known/caldav
[trace] --> PROPFIND http://dav/.well-known/caldav HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 198
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-pr\
[trace] incipal /></prop></propfind>
[trace] --> END PROPFIND (198-byte body)
[trace] <-- HTTP/1.1 200 OK (10ms)
[trace] Accept-Ranges: bytes
[trace] Content-Length: 2917
[trace] Content-Type: text/plain; charset=utf-8
[trace] Last-Modified: Mon, 01 Feb 2016 21:55:22 GMT
[trace] Server: Caddy
[trace] Date: Mon, 01 Feb 2016 22:44:01 GMT
[trace] OkHttp-Sent-Millis: 1454366641725
[trace] OkHttp-Received-Millis: 1454366641730
[trace] <?php
[trace] /***************************************************************
[trace] * Copyright notice
[trace] *
[trace] * (c) 2013 Jérôme Schneider <[email protected]>
[trace] * All rights reserved
[trace] *
[trace] * http://baikal-server.com
[trace] *
[trace] * This script is part of the Baïkal Server project. The Baïkal
[trace] * Server project is free software; you can redistribute it
[trace] * and/or modify it under the terms of the GNU General Public
[trace] * License as published by the Free Software Foundation; either
[trace] * version 2 of the License, or (at your option) any later version.
[trace] *
[trace] * The GNU General Public License can be found at
[trace] * http://www.gnu.org/copyleft/gpl.html.
[trace] *
[trace] * This script is distributed in the hope that it will be useful,
[trace] * but WITHOUT ANY WARRANTY; without even the implied warranty of
[trace] * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[trace] * GNU General Public License for more details.
[trace] *
[trace] * This copyright notice MUST APPEAR in all copies of the script!
[trace] ***************************************************************/
[trace] ini_set("session.cookie_httponly", 1);
[trace] ini_set("display_errors", 0);
[trace] ini_set("log_errors", 1);
[trace] define("BAIKAL_CONTEXT", TRUE);
[trace] define("PROJECT_CONTEXT_BASEURI", "/");
[trace] if(file_exists(getcwd() . "/Core")) {
[trace] # Flat FTP mode
[trace] define("PROJECT_PATH_ROOT", getcwd() . "/"); #./
[trace] } else {
[trace] # Dedicated server mode
[trace] define("PROJECT_PATH_ROOT", dirname(getcwd()) . "/"); #../
[trace] }
[trace] if(!file_exists(PROJECT_PATH_ROOT . 'vendor/')) {
[trace] die('<h1>Incomplete installation</h1><p>Baïkal dependencies have not been insta\
[trace] lled. Please, execute "<strong>composer install</strong>" in the folder where you ins\
[trace] talled Baïkal.');
[trace] }
[trace] require PROJECT_PATH_ROOT . 'vendor/autoload.php';
[trace] # Bootstraping Flake
[trace] \Flake\Framework::bootstrap();
[trace] # Bootstrapping Baïkal
[trace] \Baikal\Framework::bootstrap();
[trace] if(!defined("BAIKAL_CAL_ENABLED") || BAIKAL_CAL_ENABLED !== TRUE) {
[trace] throw new ErrorException("Baikal CalDAV is disabled.", 0, 255, __FILE__, __LINE__);
[trace] }
[trace] # Backends
[trace] if( BAIKAL_DAV_AUTH_TYPE == "Basic" || preg_match('/Windows-Phone-WebDAV-Client/i', $\
[trace] _SERVER['HTTP_USER_AGENT']) )
[trace] $authBackend = new \Baikal\Core\PDOBasicAuth($GLOBALS["DB"]->getPDO(), BAIKAL_AUT\
[trace] H_REALM);
[trace] else
[trace] $authBackend = new \Sabre\DAV\Auth\Backend\PDO($GLOBALS["DB"]->getPDO());
[trace] $principalBackend = new \Sabre\DAVACL\PrincipalBackend\PDO($GLOBALS["DB"]->getPDO());
[trace] $calendarBackend = new \Sabre\CalDAV\Backend\PDO($GLOBALS["DB"]->getPDO());
[trace] # Directory structure
[trace] $nodes = array(
[trace] new \Sabre\CalDAV\Principal\Collection($principalBackend),
[trace] new \Sabre\CalDAV\CalendarRootNode($principalBackend, $calendarBackend),
[trace] );
[trace] # Initializing server
[trace] $server = new \Sabre\DAV\Server($nodes);
[trace] $server->setBaseUri(BAIKAL_CAL_BASEURI);
[trace] # Server Plugins
[trace] $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, BAIKAL_AUTH_REALM));
[trace] $server->addPlugin(new \Sabre\DAVACL\Plugin());
[trace] $server->addPlugin(new \Sabre\CalDAV\Plugin());
[trace] # And off we go!
[trace] $server->exec();
[trace] <-- END HTTP (2917-byte body)
[debug] Couldn't determine <current-user-principal> from well-known caldav path - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.java:444)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:179)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:86)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.java:444)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:179)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:86)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[info ] No principal URL yet, trying SRV/TXT records with domain dav
[debug] Looking up SRV records for _caldavs._tcp.dav
DAVdroid + Baikal + Nginx
Nginx config
server {
listen 80 default_server;
server_name _;
root /var/www/dav/html;
index index.php;
rewrite ^/.well-known/caldav /cal.php redirect;
rewrite ^/.well-known/carddav /card.php redirect;
charset utf-8;
location ~ /(\.ht|Core|Specific) {
deny all;
return 404;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Nginx access log
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND / HTTP/1.1" 405 172 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "OPTIONS / HTTP/1.1" 405 172 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /.well-known/carddav HTTP/1.1" 302 160 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /card.php HTTP/1.1" 401 304 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /card.php HTTP/1.1" 207 402 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /card.php/principals/user1/ HTTP/1.1" 401 304 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /card.php/principals/user1/ HTTP/1.1" 207 423 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /card.php/addressbooks/user1/ HTTP/1.1" 401 304 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /card.php/addressbooks/user1/ HTTP/1.1" 207 2136 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND / HTTP/1.1" 405 172 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "OPTIONS / HTTP/1.1" 405 172 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /.well-known/caldav HTTP/1.1" 302 160 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:47 -0500] "PROPFIND /cal.php HTTP/1.1" 401 304 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:48 -0500] "PROPFIND /cal.php HTTP/1.1" 207 439 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:48 -0500] "PROPFIND /cal.php/principals/user1/ HTTP/1.1" 401 304 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:48 -0500] "PROPFIND /cal.php/principals/user1/ HTTP/1.1" 207 449 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:48 -0500] "PROPFIND /cal.php/calendars/user1/ HTTP/1.1" 401 304 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
10.10.10.111 - - [01/Feb/2016:17:51:48 -0500] "PROPFIND /cal.php/calendars/user1/ HTTP/1.1" 207 3535 "-" "DAVdroid/0.9.1.3 (2016/01/03; dav4android) Android/6.0.1"
@mholt let me know what else do you need so we can get to the bottom of it.
The first slash /
in the to
field is actually important in rewrite.
e.g.
to cal.php #wrong
to /cal.php #correct.
Does that have any effect ?
No affect after changing the rewrite
rewrite {
r ^/.well-known/carddav
to /card.php
}
rewrite {
r ^/.well-known/caldav
to /cal.php
}
Let me know if you need any logs.
Does Baikal still have a Docker? Why not use that?
Does Baikal still have a Docker? Why not use that?
How would that help here?
I _think_ that using Baikal's Dockerfile would avoid making Caddy deal with any of the PHP, you would just be using Caddy to stamp a SSL cert on things after it's done being processed inside the container.
@hubertbanas @TribuneX Now that #558 is merged, we're halfway there. The remaining outstanding issue seems to be that in the case of carddav/caldav, Caddy returns a 200 when it should return a 207 instead as you mentioned above. Anyone please want to try to figure out why that is the case? :smile:
@hubertbanas @TribuneX Is this still an issue? Apparently ownCloud works (WebDAV stuff included) with latest on master and some rewrites -- and I've seen log entries myself with 208 and other similar status codes being returned.
Been kind of an idle issue, so I'm assuming it's fixed now.
Nope, still not working. Just tested it with 4f5fe2de24d965530b03bee5edc01a640c002ce8.
LOGS:
[info ] *** STARTING COLLECTION DISCOVERY FOR SERVICE CARDDAV***
[info ] Check whether user-given URL is a calendar collection and/or contains home-set and/or has current-user-principal
[trace] --> PROPFIND http://dav/ HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 320
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><CARD:addressboo\
[trace] k-home-set /><resourcetype /><displayname /><CARD:addressbook-description /><current-\
[trace] user-privilege-set /><current-user-principal /></prop></propfind>
[trace] --> END PROPFIND (320-byte body)
[trace] <-- HTTP/1.1 200 OK (29ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: text/html; charset=UTF-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=msfr3i7ulurncnqm6e2fk7tb02; path=/; HttpOnly
[trace] Date: Thu, 17 Mar 2016 19:56:05 GMT
[trace] Content-Length: 341
[trace] OkHttp-Sent-Millis: 1458244567272
[trace] OkHttp-Received-Millis: 1458244567282
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[debug] PROPFIND on user-given URL failed - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:124)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:85)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:124)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:85)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[info ] No home sets found, looking for <current-user-principal>
[trace] --> OPTIONS http://dav/ HTTP/1.1
[trace] --> END OPTIONS
[trace] <-- HTTP/1.1 200 OK (21ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: text/html; charset=UTF-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=83es9rm11eur7etg6f43aehd34; path=/; HttpOnly
[trace] Date: Thu, 17 Mar 2016 19:56:05 GMT
[trace] Content-Length: 341
[trace] OkHttp-Sent-Millis: 1458244567302
[trace] OkHttp-Received-Millis: 1458244567311
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[info ] User-given URL doesn't contain <current-user-principal>, trying /.well-known/carddav
[trace] --> PROPFIND http://dav/.well-known/carddav HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 198
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-pr\
[trace] incipal /></prop></propfind>
[trace] --> END PROPFIND (198-byte body)
[trace] <-- HTTP/1.1 403 Forbidden (18ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: application/xml; charset=utf-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=ls6oobnh82vo0isd0va2ovqmc6; path=/
[trace] Status: 403 Forbidden
[trace] Date: Thu, 17 Mar 2016 19:56:05 GMT
[trace] Content-Length: 310
[trace] OkHttp-Sent-Millis: 1458244567321
[trace] OkHttp-Received-Millis: 1458244567335
[trace] <?xml version="1.0" encoding="utf-8"?>
[trace] <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
[trace] <s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
[trace] <s:message>Requested uri (/.well-known/carddav) is out of base uri (/card.php/)</s:\
[trace] message>
[trace] <s:sabredav-version>1.8.7</s:sabredav-version>
[trace] </d:error>
[trace] <-- END HTTP (310-byte body)
[debug] Couldn't determine <current-user-principal> from well-known carddav path - EXCEPTION:
at.bitfire.dav4android.exception.HttpException: 403 Forbidden
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:281)
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:286)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:250)
at at.bitfire.davdroid.resource.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.java:444)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:179)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:85)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at.bitfire.dav4android.exception.HttpException: 403 Forbidden
at.bitfire.dav4android.exception.HttpException: 403 Forbidden
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:281)
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:286)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:250)
at at.bitfire.davdroid.resource.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.java:444)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:179)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:85)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[info ] No principal URL yet, trying SRV/TXT records with domain dav
[debug] Looking up SRV records for _carddavs._tcp.dav
[info ] *** STARTING COLLECTION DISCOVERY FOR SERVICE CALDAV***
[info ] Check whether user-given URL is a calendar collection and/or contains home-set and/or has current-user-principal
[trace] --> PROPFIND http://dav/ HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 435
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><CAL:calendar-ho\
[trace] me-set /><CAL:supported-calendar-component-set /><resourcetype /><displayname /><n0:c\
[trace] alendar-color xmlns:n0="http://apple.com/ns/ical/" /><CAL:calendar-description /><CAL\
[trace] :calendar-timezone /><current-user-privilege-set /><current-user-principal /></prop><\
[trace] /propfind>
[trace] --> END PROPFIND (435-byte body)
[trace] <-- HTTP/1.1 200 OK (15ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: text/html; charset=UTF-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=nndvaar69c5tpc2heb22fs3333; path=/; HttpOnly
[trace] Date: Thu, 17 Mar 2016 19:56:06 GMT
[trace] Content-Length: 341
[trace] OkHttp-Sent-Millis: 1458244567351
[trace] OkHttp-Received-Millis: 1458244567363
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[debug] PROPFIND on user-given URL failed - EXCEPTION:
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:117)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:86)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at.bitfire.dav4android.exception.InvalidDavResponseException: Expected 207 Multi-Status
at at.bitfire.dav4android.DavResource.assertMultiStatus(DavResource.java:295)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:251)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:117)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:86)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[info ] No home sets found, looking for <current-user-principal>
[trace] --> OPTIONS http://dav/ HTTP/1.1
[trace] --> END OPTIONS
[trace] <-- HTTP/1.1 200 OK (19ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: text/html; charset=UTF-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=a1ifk40ffgah94j2d43agqmlu0; path=/; HttpOnly
[trace] Date: Thu, 17 Mar 2016 19:56:06 GMT
[trace] Content-Length: 341
[trace] OkHttp-Sent-Millis: 1458244567382
[trace] OkHttp-Received-Millis: 1458244567389
[trace] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
[trace] "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[trace] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[trace] <head>
[trace] <title>Baïkal Server</title>
[trace] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
[trace] </head>
[trace] <body>
[trace] <h2>Baïkal is running allright.</h2>
[trace] </body>
[trace] </html>
[trace] <-- END HTTP (341-byte body)
[info ] User-given URL doesn't contain <current-user-principal>, trying /.well-known/caldav
[trace] --> PROPFIND http://dav/.well-known/caldav HTTP/1.1
[trace] Content-Type: application/xml; charset=utf-8
[trace] Content-Length: 198
[trace] Depth: 0
[trace] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:par\
[trace] ams:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-pr\
[trace] incipal /></prop></propfind>
[trace] --> END PROPFIND (198-byte body)
[trace] <-- HTTP/1.1 403 Forbidden (15ms)
[trace] Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[trace] Content-Type: application/xml; charset=utf-8
[trace] Expires: Thu, 19 Nov 1981 08:52:00 GMT
[trace] Pragma: no-cache
[trace] Server: Caddy
[trace] Set-Cookie: PHPSESSID=51ini3lbvggqsvhjusv26itob5; path=/; HttpOnly
[trace] Status: 403 Forbidden
[trace] Date: Thu, 17 Mar 2016 19:56:06 GMT
[trace] Content-Length: 308
[trace] OkHttp-Sent-Millis: 1458244567402
[trace] OkHttp-Received-Millis: 1458244567412
[trace] <?xml version="1.0" encoding="utf-8"?>
[trace] <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
[trace] <s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
[trace] <s:message>Requested uri (/.well-known/caldav) is out of base uri (/cal.php/)</s:me\
[trace] ssage>
[trace] <s:sabredav-version>1.8.7</s:sabredav-version>
[trace] </d:error>
[trace] <-- END HTTP (308-byte body)
[debug] Couldn't determine <current-user-principal> from well-known caldav path - EXCEPTION:
at.bitfire.dav4android.exception.HttpException: 403 Forbidden
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:281)
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:286)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:250)
at at.bitfire.davdroid.resource.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.java:444)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:179)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:86)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at.bitfire.dav4android.exception.HttpException: 403 Forbidden
at.bitfire.dav4android.exception.HttpException: 403 Forbidden
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:281)
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:286)
at at.bitfire.dav4android.DavResource.propfind(DavResource.java:250)
at at.bitfire.davdroid.resource.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.java:444)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:179)
at at.bitfire.davdroid.resource.DavResourceFinder.findResources(DavResourceFinder.java:86)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:164)
at at.bitfire.davdroid.ui.setup.QueryServerDialogFragment$ServerInfoLoader.loadInBackground(QueryServerDialogFragment.java:142)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[info ] No principal URL yet, trying SRV/TXT records with domain dav
[debug] Looking up SRV records for _caldavs._tcp.dav
Working nginx config
server {
listen 80 default_server;
server_name _;
root /var/www/dav/html;
index index.php;
rewrite ^/.well-known/caldav /cal.php redirect;
rewrite ^/.well-known/carddav /card.php redirect;
charset utf-8;
location ~ /(\.ht|Core|Specific) {
deny all;
return 404;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Caddyfile
# ------------------------------
# dav
http://dav {
root /var/www/dav/html
tls off
rewrite {
r ^/.well-known/carddav
to /card.php
}
rewrite {
r ^/.well-known/caldav
to /cal.php
}
# access log
log /var/log/caddy/dav.access.log {
rotate {
size 10 # rotate after 10 MB
age 30 # keep log files for 30 days
keep 10 # keep at most 10 log files
}
}
# error log
errors {
log /var/log/caddy/dav.errors.log {
size 10 # rotate after 10 MB
age 30 # keep log files for 30 days
keep 10 # keep at most 10 log files
}
}
# php-fpm with Unix socket
fastcgi / /var/run/php5-fpm.sock php
}
# ------------------------------
Can we have this issue re-open so it doesn't go under the radar?
Can reproduce.
I won't classify this as show-stopper for 0.8.3.
Is there someone working on this?
Nope. You wanna pick this up @TheGreen ?
@abiosoft I actually would, if I knew how to do it :D I know Java somewhat, but go not at all and i don't know much about http or webdav either ^^
Still open? At least works fine here, tested with davdroid and some paid ones.
@tehscorpion Really?? :flushed: Are you sure? I would love to just close this. Did you build Caddy from source or use 0.9?
@mholt Im using it like Caddy -> Caddy inside container -> php-fpm.
First caddy config for this domain looks like this:
XXXX.XXXX, www.XXXX.XXXX {
tls {
protocols tls1.2 tls1.2
}
header / {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Frame-Options SAMEORIGIN
X-XSS-Protection "1; mode=block"
X-Content-Type-Options nosniff
Content-Security-Policy "default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; font-src 'self' data:; img-src 'self'; style-src 'self' 'unsafe-inline'"
-Server
}
gzip {
level 6
}
proxy / XXXX.XXXX:8080 {
header_upstream Host {host}
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-For {remote}
header_upstream X-Forwarded-Proto {scheme}
}
}
Caddy inside container config:
:8080 {
realip {
header X-Forwarded-For
from XXX.XXX.XXX.XXX/32
}
header / -Server
root /XXXX/XXXX/XXXX
redir 301 {
/.well-known/carddav /baikal/card.php
/.well-known/caldav /baikal/cal.php
}
fastcgi / /run/php/php7.0-fpm.XXXX.sock php
}
Both with:
Caddy 0.9.0
The only interesting content in baikal's config is this line, but it should be the default (if im not wrong)
define("BAIKAL_DAV_AUTH_TYPE", 'Digest');
Works like a charm with iPhones, Androids 4.x.x -> 6.x.x
Okay, cool. I'll close this then. If anyone still has issues with it, let us know.
Most helpful comment
Can reproduce.
I won't classify this as show-stopper for 0.8.3.