Hi @irreleph4nt
years later i’m come back and try again 🙈
the installation of composer are done with version 2.3.6 on the www-data user.
root@noise:/var/www/kdav# su www-data -s /bin/bash
www-data@noise:~/kdav$ cd /var/www/kdav
www-data@noise:~/kdav$ ./composer update
bash: ./composer: No such file or directory
www-data@noise:~/kdav$ ./composer install
bash: ./composer: No such file or directory
www-data@noise:~/kdav$ ls
composer.json composer.phar config.php lib log4php.xml phpunit.xml server.php TRADEMARKS version.php
composer.lock config doc LICENSE mapi README.md tests vendor
www-data@noise:~/kdav$ composer install
Cannot create cache directory /var/www/.cache/composer/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /var/www/.cache/composer/files/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 26 installs, 0 updates, 0 removals
- Installing symfony/polyfill-ctype (v1.18.1): Downloading (100%)
- Installing webmozart/assert (1.9.1): Downloading (100%)
- Installing phpdocumentor/reflection-common (2.2.0): Downloading (100%)
- Installing phpdocumentor/type-resolver (1.3.0): Downloading (100%)
- Installing phpdocumentor/reflection-docblock (5.2.1): Downloading (100%)
- Installing phpunit/php-token-stream (2.0.2): Downloading (100%)
- Installing symfony/yaml (v4.4.13): Downloading (100%)
- Installing sebastian/version (2.0.1): Downloading (100%)
- Installing sebastian/resource-operations (1.0.0): Downloading (100%)
- Installing sebastian/recursion-context (2.0.0): Downloading (100%)
- Installing sebastian/object-enumerator (2.0.1): Downloading (100%)
- Installing sebastian/global-state (1.1.1): Downloading (100%)
- Installing sebastian/exporter (2.0.0): Downloading (100%)
- Installing sebastian/environment (2.0.0): Downloading (100%)
- Installing sebastian/diff (1.4.3): Downloading (100%)
- Installing sebastian/comparator (1.2.4): Downloading (100%)
- Installing phpunit/php-text-template (1.2.1): Downloading (100%)
- Installing doctrine/instantiator (1.3.1): Downloading (100%)
- Installing phpunit/phpunit-mock-objects (3.4.4): Downloading (100%)
- Installing phpunit/php-timer (1.0.9): Downloading (100%)
- Installing phpunit/php-file-iterator (1.4.5): Downloading (100%)
- Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)
- Installing phpunit/php-code-coverage (4.0.8): Downloading (100%)
- Installing phpspec/prophecy (v1.10.3): Downloading (100%)
- Installing myclabs/deep-copy (1.10.1): Downloading (100%)
- Installing phpunit/phpunit (5.7.27): Downloading (100%)
symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.1)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
www-data@noise:~/kdav$ exit
exit
but now i think my directive ist completly wrong
domain/kdav = blank site instead of asking user/password
caldav is working properly
this is at the end of the z-push config:
location /kdav {
alias /var/www/kdav/;
#root /var/www/kdav/;
index server.php;
# rewrite ^/.well-known/caldav /cal.php redirect;
rewrite ^/.well-known/carddav /card.php redirect;
rewrite ^/server.php$uri break;
rewrite .*/server.php$uri break;
rewrite .*/.well-known/carddav$ / redirect;
# rewrite .*/.well-known/caldav$ / redirect;
charset utf-8;
location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_index server.php;
include fastcgi_params;
}
}
location /caldav {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8080;
}
}
Also i try a simpler directive:
location /kdav {
root /var/www/kdav/;
rewrite ^/.well-known/carddav$ / redirect;
# rewrite ^/.well-known/caldav$ / redirect;
rewrite ^(.*)$ /server.php break;
}
location /caldav {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8080;
}
}
This downloads the following file:
<?php
/***********************************************
* File : server.php
* Project : KopanoDAV
* Descr : This is the entry point
* through which all requests
* are processed.
*
* Created : 13.12.2016
*
* Copyright 2016 - 2018 Kopano b.v.
*
* This file is part of kDAV. kDAV is free software; you can redistribute
* it and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation; either version 3
* or (at your option) any later version.
*
* This software uses SabreDAV, an open source software distributed
* under three-clause BSD-license. Please see <http://sabre.io/dav/>
* for more information about SabreDAV.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Consult LICENSE file for details
************************************************/
namespace Kopano\DAV;
// require composer auto-loader
require __DIR__ . '/vendor/autoload.php';
// Configure & create main logger
KLogger::configure(__DIR__ . '/log4php.xml');
$logger = new KLogger('main');
// don't log any Sabre asset requests (images etc)
if (isset($_REQUEST['sabreAction']) && $_REQUEST['sabreAction'] == 'asset') {
$logger->resetConfiguration();
}
// log the start data
$logger->debug('------------------ Start');
$logger->debug('%s %s', $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);
$logger->debug('KDAV version %s', KDAV_VERSION);
$logger->debug('SabreDAV version %s',\Sabre\DAV\Version::VERSION);
$kdavBackend = new KopanoDavBackend(new KLogger(('dav')));
$authBackend = new AuthBasicBackend($kdavBackend);
$authBackend->setRealm(SABRE_AUTH_REALM);
$principalBackend = new PrincipalsBackend($kdavBackend);
$kCarddavBackend = new KopanoCardDavBackend($kdavBackend, new KLogger('card'));
$kCaldavBackend = new KopanoCalDavBackend($kdavBackend, new KLogger('cal'));
// Setting up the directory tree
$nodes = array(
new \Sabre\DAVACL\PrincipalCollection($principalBackend),
new \Sabre\CardDAV\AddressBookRoot($principalBackend, $kCarddavBackend),
new \Sabre\CalDAV\CalendarRoot($principalBackend, $kCaldavBackend),
);
// initialize the server
$server = new \Sabre\DAV\Server($nodes);
$server->setBaseUri(DAV_ROOT_URI);
$server->setLogger(new KPSR3Logger($logger));
$authPlugin = new \Sabre\DAV\Auth\Plugin($authBackend, SABRE_AUTH_REALM);
$server->addPlugin($authPlugin);
// add our version to the headers
$server->httpResponse->addHeader('X-KDAV-Version', KDAV_VERSION);
// log the incoming request (only if authenticated)
$logger->LogIncoming($server->httpRequest);
$aclPlugin = new DAVACL();
$aclPlugin->allowUnauthenticatedAccess = false;
$server->addPlugin($aclPlugin);
$schedulePlugin = new KopanoSchedulePlugin($kdavBackend, new KLogger('schedule'));
$server->addPlugin($schedulePlugin);
$imipPlugin = new KopanoIMipPlugin($kdavBackend, new KLogger('imip'));
$server->addPlugin($imipPlugin);
$server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
$server->addPlugin(new \Sabre\CardDAV\Plugin());
// TODO: do we need $caldavPlugin for anything?
$caldavPlugin = new \Sabre\CalDAV\Plugin();
$server->addPlugin($caldavPlugin);
if (strlen(SYNC_DB) > 0) {
$server->addPlugin(new \Sabre\DAV\Sync\Plugin());
}
if (DEVELOPER_MODE) {
$server->addPlugin(new \Sabre\DAV\Browser\Plugin(false));
}
$server->exec();
// Log outgoing data
$logger->LogOutgoing($server->httpResponse);
$logger->debug("httpcode='%s' memory='%s/%s' time='%ss'",
http_response_code(), $logger->FormatBytes(memory_get_peak_usage(false)), $logger->FormatBytes(memory_get_peak_usage(true)),
number_format(microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"], 2));
$logger->debug('------------------ End');
Has anyone running kdav with nginx?