Fix issue with Cyberduck, move WWW_URL auto-detection outside of config file, add CHANGES log
This commit is contained in:
parent
3d1af68671
commit
3641b1d2e1
|
@ -82,6 +82,7 @@ Here is a list of clients tested with KaraDAV:
|
||||||
* [FUSE webdavfs](https://github.com/miquels/webdavfs) is **recommended** for Linux
|
* [FUSE webdavfs](https://github.com/miquels/webdavfs) is **recommended** for Linux
|
||||||
* davfs2 is NOT recommended: it is very slow, and it is using a local cache, meaning changing a file locally may not be synced to the server for a few minutes, leading to things getting out of sync. If you have to use it, at least disable locks, by setting `use_locks=0` in the config.
|
* davfs2 is NOT recommended: it is very slow, and it is using a local cache, meaning changing a file locally may not be synced to the server for a few minutes, leading to things getting out of sync. If you have to use it, at least disable locks, by setting `use_locks=0` in the config.
|
||||||
* Microsoft Windows native webclient (also called 'MiniRedir') is notoriously bad. We tested it successfully on Windows 10, but it is recommended to use [CyberDuck](https://cyberduck.io/download/) or [WinSCP](https://winscp.net/) instead, both are free software.
|
* Microsoft Windows native webclient (also called 'MiniRedir') is notoriously bad. We tested it successfully on Windows 10, but it is recommended to use [CyberDuck](https://cyberduck.io/download/) or [WinSCP](https://winscp.net/) instead, both are free software.
|
||||||
|
* CyberDuck (Windows) version 8.5.0
|
||||||
* Dolphin (KDE)
|
* Dolphin (KDE)
|
||||||
* Thunar (GTK/GNOME)
|
* Thunar (GTK/GNOME)
|
||||||
* [rclone](https://rclone.org/webdav/) on Linux
|
* [rclone](https://rclone.org/webdav/) on Linux
|
||||||
|
@ -102,7 +103,12 @@ This might get supported in future (maybe):
|
||||||
|
|
||||||
* Probably: [NextCloud Trashbin](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/trashbin.html)
|
* Probably: [NextCloud Trashbin](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/trashbin.html)
|
||||||
* Maybe: [NextCloud sharing](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html)
|
* Maybe: [NextCloud sharing](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html)
|
||||||
* Maybe: NextCloud files versioning (see [API](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/versions.html), [versioning pattern](https://docs.nextcloud.com/server/latest/user_manual/en/files/version_control.html), [code](https://github.com/nextcloud/server/blob/master/apps/files_versions/lib/Storage.php))
|
* Maybe: NextCloud files versioning
|
||||||
|
* [NextCloud API](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/versions.html)
|
||||||
|
* [NextCloud versioning pattern](https://docs.nextcloud.com/server/latest/user_manual/en/files/version_control.html)
|
||||||
|
* [NextCloud implementation](https://github.com/nextcloud/server/blob/master/apps/files_versions/lib/Storage.php))
|
||||||
|
* [Mercurial revlog](https://www.mercurial-scm.org/wiki/Revlog)
|
||||||
|
* [Eric Sink on SCM versioning](https://ericsink.com/scm/scm_repositories.html)
|
||||||
|
|
||||||
This probably won't get supported anytime soon:
|
This probably won't get supported anytime soon:
|
||||||
|
|
||||||
|
|
|
@ -22,17 +22,12 @@ const DB_FILE = __DIR__ . '/data/db.sqlite';
|
||||||
/**
|
/**
|
||||||
* WWW_URL is the complete URL of the root of this server
|
* WWW_URL is the complete URL of the root of this server
|
||||||
*
|
*
|
||||||
* This code auto-detects it as well as it can
|
* If you don't define it, KaraDAV will try to auto-detects it as well as it can.
|
||||||
* But you may have to assign something static instead, for example:
|
* But you may have to assign something static instead if that fails, for example:
|
||||||
*
|
*
|
||||||
* const WWW_URL = 'https://dav.website.example/';
|
* const WWW_URL = 'https://dav.website.example/';
|
||||||
*/
|
*/
|
||||||
$https = (!empty($_SERVER['HTTPS']) || $_SERVER['SERVER_PORT'] == 443) ? 's' : '';
|
#const WWW_URL = 'http://karadav.localhost/';
|
||||||
$name = $_SERVER['SERVER_NAME'];
|
|
||||||
$port = !in_array($_SERVER['SERVER_PORT'], [80, 443]) ? ':' . $_SERVER['SERVER_PORT'] : '';
|
|
||||||
$root = '/';
|
|
||||||
|
|
||||||
define('KaraDAV\WWW_URL', sprintf('http%s://%s%s%s', $https, $name, $port, $root));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WOPI client discovery URL
|
* WOPI client discovery URL
|
||||||
|
|
16
doc/CHANGES.md
Normal file
16
doc/CHANGES.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# 0.3.2
|
||||||
|
|
||||||
|
* Fix issue with Cyberduck (Windows)
|
||||||
|
* Move auto-detection code for WWW_URL outside of config.local.php, if WWW_URL is not defined, then KaraDAV will trigger auto-detection
|
||||||
|
|
||||||
|
# 0.3.1
|
||||||
|
|
||||||
|
* Fix issue with NextCloud direct URLs crashing
|
||||||
|
|
||||||
|
# 0.3.0
|
||||||
|
|
||||||
|
* Fix typos
|
||||||
|
* Fix security issues
|
||||||
|
* Add list of tested clients in README
|
||||||
|
* Add systemd service file
|
||||||
|
* Don't store WOPI tokens in database, instead use a time-limited HMAC hash
|
|
@ -606,17 +606,23 @@ class Server
|
||||||
// Find all properties
|
// Find all properties
|
||||||
// Allow for empty namespace, see Litmus FAQ for propnullns
|
// Allow for empty namespace, see Litmus FAQ for propnullns
|
||||||
// https://github.com/tolsen/litmus/blob/master/FAQ
|
// https://github.com/tolsen/litmus/blob/master/FAQ
|
||||||
preg_match_all('!<(?:([\w-]+):)([\w-]+)|<([\w-]+)[^>]*xmlns="([^"]*)"!', $match[2], $match, PREG_SET_ORDER);
|
preg_match_all('!<([\w-]+)[^>]*xmlns="([^"]*)"|<(?:([\w-]+):)?([\w-]+)!', $match[2], $match, PREG_SET_ORDER);
|
||||||
|
|
||||||
$properties = [];
|
$properties = [];
|
||||||
|
|
||||||
foreach ($match as $found) {
|
foreach ($match as $found) {
|
||||||
$url = $found[4] ?? (array_search($found[1], $ns) ?: $default_ns);
|
if (isset($found[4])) {
|
||||||
$name = isset($found[4]) ? $found[3] : $found[2];
|
$url = array_search($found[3], $ns) ?: $default_ns;
|
||||||
|
$name = $found[4];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$url = $found[2];
|
||||||
|
$name = $found[1];
|
||||||
|
}
|
||||||
|
|
||||||
$properties[$url . ':' . $name] = [
|
$properties[$url . ':' . $name] = [
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'ns_alias' => $found[1],
|
'ns_alias' => $found[3] ?: null,
|
||||||
'ns_url' => $url,
|
'ns_url' => $url,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,15 @@ if (!defined('KaraDAV\SECRET_KEY')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!defined('KaraDAV\WWW_URL')) {
|
||||||
|
$https = (!empty($_SERVER['HTTPS']) || $_SERVER['SERVER_PORT'] == 443) ? 's' : '';
|
||||||
|
$name = $_SERVER['SERVER_NAME'];
|
||||||
|
$port = !in_array($_SERVER['SERVER_PORT'], [80, 443]) ? ':' . $_SERVER['SERVER_PORT'] : '';
|
||||||
|
$root = '/';
|
||||||
|
|
||||||
|
define('KaraDAV\WWW_URL', sprintf('http%s://%s%s%s', $https, $name, $port, $root));
|
||||||
|
}
|
||||||
|
|
||||||
// Init database
|
// Init database
|
||||||
if (!file_exists(DB_FILE)) {
|
if (!file_exists(DB_FILE)) {
|
||||||
$db = DB::getInstance();
|
$db = DB::getInstance();
|
||||||
|
|
Loading…
Reference in a new issue