zokradonh / kopano-docker

Unofficial Kopano Docker images for all Kopano services.
MIT License
59 stars 37 forks source link

How to configure kweb to server kdav on root path? #476

Closed stefangries closed 3 years ago

stefangries commented 3 years ago

The default config serves kdav on the /kdav path. Actually, its better to serve it on / as described here.

So in config.php it's obvious that define('DAV_ROOT_URI', '/kdav/'); should be replaced with define('DAV_ROOT_URI', '/');

But actually I don't understand how to reconfigure kweb.cfg:

:9080 {
    log stdout
    errors stderr

    # healthcheck
    status 200 /status

    rewrite /kdav/ {
        to /kdav/server.php
    }

    fastcgi2 /kdav/ /run/php/php-fpm-kopano-kdav.sock php {
        without /kdav/
        root /usr/share/kopano-kdav
        read_timeout 259200s
    }

    redir 302 {
        /.well-known/carddav /kdav/
        /.well-known/caldav /kdav/
    }

    status 403 {
        /kdav/config.php
        /kdav/lib
        /kdav/mapi
        /kdav/vendor
        /kdav/version.php
    }
}

Is it enough to replace rewrite /kdav/ with rewrite /? Or do I have to change this in the fastcgi2, redir and status parts as well?

fbartels commented 3 years ago

Hi @stefangries,

I am curious where you got the impression from that its better to serve kdav at the root of the domain. Technically it should not make a difference.

The file you copied here seems to be originally from https://github.com/zokradonh/kopano-docker/blob/master/kdav/kweb.cfg

Like you already stated you would need to updated the rewrite block, the fastcgi2 block, the redir block and also the status block. all removing /kav and pointing to / instead.

Additionally when running kdav in this setup you will also need to adapt the front facing proxy, which is configured in https://github.com/zokradonh/kopano-docker/blob/master/web/kweb.cfg, but this is where it gets difficult, since this setup expects to run a single domain, but when running kdav in the root of a domain, you will also need to make larger modifications there.

The overall setup here tries to keeps things simple by separating tasks into dedicated containers and by exposing everything under a single fqdn.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days