I have DAViCal and CalDAVzap installed on my workstation. Assume the hostname of the workstation is 'ws.mydomain.com'. I have a CNAME 'davical.mydomain.com'. The system is running Fedora 17, with apache 2.2.23.
'davical.mydomain.com' is configured as a virtual host:
<VirtualHost *:80 >
DocumentRoot /usr/share/davical/htdocs
DirectoryIndex index.php index.html
ServerName davical.mydomain.com Alias /images/ /usr/share/davical/htdocs/images/
<Directory /usr/share/davical/htdocs/> AllowOverride None Order allow,deny Allow from all </Directory>
AcceptPathInfo On
</VirtualHost>
In the CalDAVzap config, I use the following settings:
var globalNetworkCheckSettings = undefined; var globalAccountSettings = [ { href: 'http://davical.mydomain.com/caldav.php/jv/', hrefLabel: null, crossDomain: true, forceReadOnly: null, withCredentials: true, showHeader: true, userAuth: { userName: 'jv', userPassword: '******' }, syncInterval: 60000, timeOut: 30000, lockTimeOut: 10000, delegation: false, // CalDAVzap specific. settingsAccount: true, ignoreAlarms: false, backgroundCalendars: [] } ];
CalDAVzap is accesed via an alias in the httpd.conf:
Alias /caldavzap /home/jv/wrk/CalDAVzap/caldavzap
This works great as long as I use
http://davical.mydomain.com/caldavzap/
(which surprises me -- I'd expect a virtual host to take precedence over an alias)
But it doesn't work if I use
http://ws.mydomain.com/caldavzap/
which is the way I'd want it to work, in particular since I need to move davical to a separate server.
Any ideas what I'm doing wrong?
-- Johan
Johan,
your working setup is non cross-domain, and the setup you want is cross-domain setup.
Check the new readme.txt with detailed cross-domain setup information/instructions ...
JM
On 27 Nov 2013, at 09:44, Johan Vromans jvromans@squirrel.nl wrote:
I have DAViCal and CalDAVzap installed on my workstation. Assume the hostname of the workstation is 'ws.mydomain.com'. I have a CNAME 'davical.mydomain.com'. The system is running Fedora 17, with apache 2.2.23.
'davical.mydomain.com' is configured as a virtual host:
<VirtualHost *:80 >
DocumentRoot /usr/share/davical/htdocs
DirectoryIndex index.php index.html
ServerName davical.mydomain.com Alias /images/ /usr/share/davical/htdocs/images/
<Directory /usr/share/davical/htdocs/> AllowOverride None Order allow,deny Allow from all
</Directory>
AcceptPathInfo On
</VirtualHost>
In the CalDAVzap config, I use the following settings:
var globalNetworkCheckSettings = undefined; var globalAccountSettings = [ { href: 'http://davical.mydomain.com/caldav.php/jv/', hrefLabel: null, crossDomain: true, forceReadOnly: null, withCredentials: true, showHeader: true, userAuth: { userName: 'jv', userPassword: '******' }, syncInterval: 60000, timeOut: 30000, lockTimeOut: 10000, delegation: false, // CalDAVzap specific. settingsAccount: true, ignoreAlarms: false, backgroundCalendars: [] } ];
CalDAVzap is accesed via an alias in the httpd.conf:
Alias /caldavzap /home/jv/wrk/CalDAVzap/caldavzap
This works great as long as I use
http://davical.mydomain.com/caldavzap/
(which surprises me -- I'd expect a virtual host to take precedence over an alias)
But it doesn't work if I use
http://ws.mydomain.com/caldavzap/
which is the way I'd want it to work, in particular since I need to move davical to a separate server.
Any ideas what I'm doing wrong?
-- Johan
Ján Máté jan.mate@inf-it.com writes:
your working setup is non cross-domain, and the setup you want is cross-domain setup.
Yes, that's what I already figured out...
Check the new readme.txt with detailed cross-domain setup information/instructions ...
I've added misc/config_davical.txt to the VirtualHost section.
<VirtualHost *:80 >
DocumentRoot /usr/share/davical/htdocs DirectoryIndex index.php index.html ServerName davical.squirrel.nl Alias /images/ /usr/share/davical/htdocs/images/
<Directory /usr/share/davical/htdocs/> AllowOverride None Order allow,deny Allow from all </Directory>
AcceptPathInfo On RewriteEngine On <IfModule mod_headers.c> Header unset Access-Control-Allow-Origin Header unset Access-Control-Allow-Methods Header unset Access-Control-Allow-Headers Header unset Access-Control-Allow-Credentials Header unset Access-Control-Expose-Headers
Header always set Access-Control-Allow-Origin "*" Header always set Access-Control-Allow-Methods "GET,POST,OPTIONS,PROPFIND,PROPPATCH,REPORT,PUT,MOVE,DELETE,LOCK,UNLOCK" Header always set Access-Control-Allow-Headers "User-Agent,Authorization,Content-type,Depth,If-match,If-None-Match,Lock-Token,Timeout,Destination,Overwrite,X-client,X-Requested-With" Header always set Access-Control-Allow-Credentials true Header always set Access-Control-Expose-Headers "Etag"
RewriteCond %{HTTP:Access-Control-Request-Method} !^$ RewriteCond %{REQUEST_METHOD} OPTIONS RewriteRule ^(.*)$ $1 [R=200,L] </IfModule>
</VirtualHost>
Firefox webconsole (Net+Logging) shows:
[13:58:43.417] Info: [account: 'http://jv@davical.squirrel.nl/caldav.php/jv/'] crossDomain set to: 'true' [13:58:43.724] OPTIONS http://davical.squirrel.nl/caldav.php/jv/ [HTTP/1.1 200 OK 0ms]
When I inspect the OPTIONS query, it seems that the reply does indeed return everything that is required. See http://www.squirrel.nl/pub/xfer/uploads/3CF0ERVc8bsqDINxTME0ar7g.png
So apparently I'm still missing something.
-- Johan
Heh,
now I know ... change the:
Header always set Access-Control-Allow-Credentials true
to
Header always set Access-Control-Allow-Credentials false
... I will also change it in the misc/config_davical.txt for the final release
The problem is, that Access-Control-Allow-Origin "*" is not compatible with Access-Control-Allow-Credentials true (and there is no reason to set this to true for DAViCal and 99% of other servers).
JM
On 27 Nov 2013, at 14:14, Johan Vromans jvromans@squirrel.nl wrote:
Ján Máté jan.mate@inf-it.com writes:
your working setup is non cross-domain, and the setup you want is cross-domain setup.
Yes, that's what I already figured out...
Check the new readme.txt with detailed cross-domain setup information/instructions ...
I've added misc/config_davical.txt to the VirtualHost section.
<VirtualHost *:80 >
DocumentRoot /usr/share/davical/htdocs DirectoryIndex index.php index.html ServerName davical.squirrel.nl Alias /images/ /usr/share/davical/htdocs/images/
<Directory /usr/share/davical/htdocs/> AllowOverride None Order allow,deny Allow from all
</Directory>
AcceptPathInfo On RewriteEngine On
<IfModule mod_headers.c> Header unset Access-Control-Allow-Origin Header unset Access-Control-Allow-Methods Header unset Access-Control-Allow-Headers Header unset Access-Control-Allow-Credentials Header unset Access-Control-Expose-Headers
Header always set Access-Control-Allow-Origin "*" Header always set Access-Control-Allow-Methods "GET,POST,OPTIONS,PROPFIND,PROPPATCH,REPORT,PUT,MOVE,DELETE,LOCK,UNLOCK" Header always set Access-Control-Allow-Headers "User-Agent,Authorization,Content-type,Depth,If-match,If-None-Match,Lock-Token,Timeout,Destination,Overwrite,X-client,X-Requested-With" Header always set Access-Control-Allow-Credentials true Header always set Access-Control-Expose-Headers "Etag" RewriteCond %{HTTP:Access-Control-Request-Method} !^$ RewriteCond %{REQUEST_METHOD} OPTIONS RewriteRule ^(.*)$ $1 [R=200,L]
</IfModule>
</VirtualHost>
Firefox webconsole (Net+Logging) shows:
[13:58:43.417] Info: [account: 'http://jv@davical.squirrel.nl/caldav.php/jv/'] crossDomain set to: 'true' [13:58:43.724] OPTIONS http://davical.squirrel.nl/caldav.php/jv/ [HTTP/1.1 200 OK 0ms]
When I inspect the OPTIONS query, it seems that the reply does indeed return everything that is required. See http://www.squirrel.nl/pub/xfer/uploads/3CF0ERVc8bsqDINxTME0ar7g.png
So apparently I'm still missing something.
-- Johan
Ján Máté jan.mate@inf-it.com writes:
now I know ... change the:
Header always set Access-Control-Allow-Credentials true
to
Header always set Access-Control-Allow-Credentials false
Done. Verified.
But no change :( .
I've added the complete log for your convenience.
-- Johan
Hi Johan,
looks like you use wrong URL in config (404 = not found) ... can you please create a demo account on your server and send me a private e-mail with credentials + caldavzap URL? ... I will try to check where exactly is your problem ...
JM
On 27 Nov 2013, at 16:16, Johan Vromans jvromans@squirrel.nl wrote:
Ján Máté jan.mate@inf-it.com writes:
now I know ... change the:
Header always set Access-Control-Allow-Credentials true
to
Header always set Access-Control-Allow-Credentials false
Done. Verified.
But no change :( .
I've added the complete log for your convenience.
-- Johan
<ph.log>
Ján Máté jan.mate@inf-it.com writes:
looks like you use wrong URL in config (404 = not found) ... can you please create a demo account on your server and send me a private e-mail with credentials + caldavzap URL? ... I will try to check where exactly is your problem ...
Thanks for the offer. Since this is not trivial to achieve, I spent some more time debugging...
The culprit was the setting
withCredentials: true,
in config.js. Setting it to false solved the problem, and the setup now works with DAViCal on a physically distinct server.
A question that keeps bugging me is how CalDAVzap can get a 404 while there is no evidence whatsoever of any HTTP action executed on the DAViCal server. I'd say there ought to be a log entry somewhere...?
Anyway, we got one step further; thanks for your patient support.
-- Johan
On 27 Nov 2013, at 21:23, Johan Vromans jvromans@squirrel.nl wrote:
Ján Máté jan.mate@inf-it.com writes:
looks like you use wrong URL in config (404 = not found) ... can you please create a demo account on your server and send me a private e-mail with credentials + caldavzap URL? ... I will try to check where exactly is your problem ...
Thanks for the offer. Since this is not trivial to achieve, I spent some more time debugging...
The culprit was the setting
withCredentials: true,
in config.js. Setting it to false solved the problem, and the setup now works with DAViCal on a physically distinct server.
in the latest beta I removed this (and also the crossDomain) options from config.js examples:
// special options not present in the default config (use only if you know what are you doing!): // the crossDomain sets jQuery ajax crossDomain value (use only if you know what are you doing!) - by default null = autodetect /detected setting is shown in the console/ // the withCredentials sets jQuery's ajax withCredentials value for cross domain queries (use only if you know what are you doing!); note: if true, Access-Control-Allow-Origin "*" is not allowed
A question that keeps bugging me is how CalDAVzap can get a 404 while there is no evidence whatsoever of any HTTP action executed on the DAViCal server. I'd say there ought to be a log entry somewhere...?
The problem is that this error is returned by the browser internals, so there is no way to show you what exactly is wrong ...
JM
Anyway, we got one step further; thanks for your patient support.
-- Johan