-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could you implement infcloud with your docker image #13
Comments
I'll look into it... although I'd currently go for a separate "infocloud" image and add examples on how to make them work together. Can you let me know what set up you're planning, i.e. the cross-domain or same-origin scenario? |
A separate “infcloud” sounds good to me. If you could add examples how to make them work together would be great! I guess my setup would prefer same-origin scenario. |
+1 I am planning to implement/begging for a baikal+infcloud setup, cross-domain (but on the same hardware), as with a 2-separate docker images unfortunately |
Hi all, sorry this took so long - there are good and bad news. The good news is that an image with InfCloud 0.13.1 exists, including an example with Baikal.
The bad news is though that I couldn't get it to work with Baikal yet, because Digest Authentication doesn't seem to work. I'm not sure if it's because the configuration in the config.js is incorrect or if it's the JS/browser incompatibility mentioned in InfCloud's readme. So far I've only added CORS headers to the nginx configuration file to keep this repository as clean and simple as possible. Once I know - and all help and PRs are welcome here - how the correct setup looks like, I'll check which repositories and images get the code update. Like before, due to the number of images being built on Docker Hub, it might take a few hours until the new images are available. |
Have you already taken a look at this repo https://github.com/bjuretko/docker-baikal-infcloud |
Did you try to set DIGEST to BASIC? As described here https://thomastaucher.at/pages/infcloud-in-conjunction-with-baikal/ |
Thanks for the hint - this might have solved it, my local tests here worked, but I don't have a full setup where I could do further testing. Can you give it a try? I've added an example Docker Compose file and config.js file to the repository which worked in my test runs. |
Sure I can give it a try, but I have a few questions first before messing up my setup. At the moment I have the following setup: baikal 0.4.6 on Apache with mariadb 10.* will this work with infcloud nginx? And also do I need to install the php docker image as well as you described in your comment? |
I can seems to get this to work. I've followed your examples but I keep getting an error page when surfing to the infcloud-page http://my-host-ip:portnummer I'm getting 403 Forbidden. Could you please clarify things please! |
There's still a problem because NGINX is returning a 401 when the preflight OPTIONS request is sent by the browser without authentication, and therefore the browser doesn't even send a PROPFIND because the preflight failed |
I still haven’t managed to get this to work with my Baikal (latest) version. This guy managed to make it work but his repo is outdated. https://github.com/bjuretko/docker-baikal-infcloud |
Yes but both baikal and infcloud are on the same domain so he doesn't have the cross-domain problem |
Sorry, feeling bad for neglecting this - I'll have another run at this after I come back from vacation. I might have some progress on the weekend of Jan 16th. |
No worries m8, don’t feel bad! You got to what you got to do and only if you have enough spare time for this then you can work on it. We do understand that developers also have a life beside programming 😉. Thanks for all your hard work and keeping the Baikal image up to date. |
Ok, I think I now know why all this happens:
Only returning the typical CORS response doesn't work, it results in #19. Only returning Baikal responses doesn't work, it results in the issue we have here. I tried to come up with an Nginx configuration that:
I need someone to test it though... could you please try the following configuration file. Happy to do a call with someone and do live debugging to sort this out, just let me know. # /etc/nginx/conf.d/default.conf
# Based on http://sabre.io/baikal/install/
server {
listen 80;
server_name _;
root /var/www/baikal/html;
index index.php;
rewrite ^/.well-known/caldav /dav.php redirect;
rewrite ^/.well-known/carddav /dav.php redirect;
charset utf-8;
location ~ /(\.ht|Core|Specific) {
deny all;
return 404;
}
# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ ^(.+\.php)(.*)$ {
try_files $fastcgi_script_name =404;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
# Add CORS support, e.g. for InfCloud
# See
# - https://enable-cors.org/server_nginx.html
# - https://www.inf-it.com/infcloud/readme.txt section 3
# - https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/
# cors_flags is 0 : Not a browser request, not a preflight request
# cors_flags is 1 : Browser request, not a preflight request
# cors_flags is 11: Preflight request sent by a browser
set $cors_flags 0;
if ($http_user_agent ~ "Mozilla") {
set $cors_flags 1;
}
if ($request_method = 'OPTIONS') {
set $cors_flags "${cors_flags}1";
}
# Browser preflight request: add CORS headers and don't forward to Baikal
if ($cors_flags = 11) {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PROPFIND, PROPPATCH, REPORT, PUT, MOVE, DELETE, LOCK, UNLOCK' always;
add_header 'Access-Control-Allow-Headers' 'User-Agent,Authorization,Content-type,Depth,If-match,If-None-Match,Lock-Token,Timeout,Destination,Overwrite,Prefer,X-client,X-Requested-With' always;
# Tell client that this pre-flight info is valid for 20 days
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
# From browser, but not a preflight request: add CORS headers and forward to Baikal
if ($cors_flags = 1) {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PROPFIND, PROPPATCH, REPORT, PUT, MOVE, DELETE, LOCK, UNLOCK' always;
add_header 'Access-Control-Allow-Headers' 'User-Agent,Authorization,Content-type,Depth,If-match,If-None-Match,Lock-Token,Timeout,Destination,Overwrite,Prefer,X-client,X-Requested-With' always;
add_header 'Access-Control-Expose-Headers' 'Etag,Preference-Applied' always;
}
}
} |
That works for me. No issues so far. Thank you. |
CORS isn't needed or required for Baikal, but only for other applications like InfCloud. Hence moving CORS configuration to ckulka/infcloud-docker as part of #13 , #19 and ckulka/infcloud-docker#1.
Thanks for testing @theniwo ! I moved the CORS configuration from this repository over to ckulka/infcloud-docker. Reason for removing it from here is because Baikal doesn't require or need CORS by itself and I want to remove complexity as much as possible to avoid issues like #19. The example on how to use Baikal + InfCloud can be found here at ckulka/infcloud-docker: examples/docker-compose.baikal.yaml. Closing this issue since it looks like we're good, but please let me know if this doesn't work for one of you. |
Could you implement https://www.inf-it.com/open-source/clients/infcloud/ with your baikal image.
I've found this image: https://hub.docker.com/r/plaguedr/baikal/ but it isn't working for me. The calendar kept giving me an error.
It would be nice If you could do this with your image as it is a very stable container.
The text was updated successfully, but these errors were encountered: