Commit graph

120 commits

Author SHA1 Message Date
bohwaz b37df95c7b Update dependencies 2023-09-11 01:03:49 +02:00
bohwaz ef2a3eeea6 Fix glob return 2023-09-11 00:48:59 +02:00
bohwaz a115f54775 Make sure parent directory exists 2023-09-11 00:27:35 +02:00
bohwaz a93265b4ec Make config.local.php optional 2023-09-11 00:24:06 +02:00
bohwaz eee1570e33 Remove unused dependency 2023-09-11 00:23:43 +02:00
bohwaz 5062012840 Update dependencies 2023-09-11 00:23:27 +02:00
bohwaz f58482b053 Use file inode for file ID 2023-09-11 00:23:14 +02:00
bohwaz c44b54d48e Bump version 2023-09-10 23:51:03 +02:00
bohwaz ee7ca4c3ed Upgrade to PHP 8.2 + add docker compose 2023-09-04 23:05:30 +02:00
bohwaz e944776863 Put error.log in data directory by default 2023-09-04 23:05:09 +02:00
bohwaz 86c5da4a47 Update list of tested clients 2023-07-20 01:04:23 +02:00
bohwaz a97180ef35 Bump version 2023-06-12 00:06:22 +02:00
bohwaz 8b09483ea7 Update deps: NextCloud desktop client crashes if fileId is not returned 2023-06-12 00:03:40 +02:00
bohwaz d456ba6764 Changes for KD2 lib API change 2023-06-11 23:43:29 +02:00
bohwaz 520a49e736 Update dependencies 2023-06-11 23:43:23 +02:00
bohwaz eb04a1e7a8 Merge branch 'main' of github.com:kd2org/karadav 2023-05-12 10:54:38 +02:00
bohwaz 661c2edfaa Fix auth_callback return, provide namespace in example callback 2023-05-12 10:53:58 +02:00
poVoq 48d15388f8
Add nginx example (#36)
This works here on Fedora 37 with TLS termination done via a separate
Nginx reverse-proxy. I do not claim to be an expert on this so there
might be unnecessary or wrong stuff in it.
2023-05-12 01:15:00 +02:00
bohwaz c00077c12c Update JS dependency 2023-05-11 20:22:32 +02:00
bohwaz ff7e598486 Update deps to fix #34 2023-05-11 19:15:55 +02:00
bohwaz 2fc03d83cf Make sure AUTH_CALLBACK is always defined 2023-05-11 19:15:31 +02:00
bohwaz d2f57e3fdc Implement auth callback fix #33 2023-05-11 01:54:43 +02:00
bohwaz 36cddead3e Bump version 2023-04-24 22:01:24 +02:00
bohwaz 595a1ad141 Update dependencies, fix printing issue with Collabora Office 2023-04-24 21:59:34 +02:00
bohwaz a6f96ed87d Fix #30 by applying #31 to Dockerfile: remove user nobody 2023-04-24 21:59:05 +02:00
lubiana e736dfc86d
add nullable user property to nextcloud class (#32)
this fixes a deprecation notices on php8.2 which results in an error and
therefore inability to register on nextcloud client

ErrorReport:
```
[24-Apr-2023 19:07:01 UTC] =========== Error ref. 25qisnme ===========

ErrorException: Deprecated: Creation of dynamic property KaraDAV\NextCloud::$user is deprecated in /home/lubiana/dev/private/karadav/lib/KaraDAV/NextCloud.php:33
Stack trace:
#0 /home/lubiana/dev/private/karadav/lib/KaraDAV/NextCloud.php(33): KD2\ErrorManager::errorHandler(8192, '...', '...', 33)
#1 /home/lubiana/dev/private/karadav/lib/KD2/WebDAV/NextCloud.php(380): KaraDAV\NextCloud->auth('...', '...')
#2 /home/lubiana/dev/private/karadav/lib/KD2/WebDAV/NextCloud.php(559): KD2\WebDAV\NextCloud->requireAuth()
#3 /home/lubiana/dev/private/karadav/lib/KD2/WebDAV/NextCloud.php(317): KD2\WebDAV\NextCloud->nc_user('...')
#4 /home/lubiana/dev/private/karadav/lib/KaraDAV/Server.php(44): KD2\WebDAV\NextCloud->route('...')
#5 /home/lubiana/dev/private/karadav/www/_router.php(47): KaraDAV\Server->route('...')
#6 {main}

<errorReport>
{
    "errors": [
        {
            "message": "Deprecated: Creation of dynamic property KaraDAV\\NextCloud::$user is deprecated",
            "errorCode": 0,
            "type": "PHP error",
            "backtrace": [
                {
                    "file": "\/home\/lubiana\/dev\/private\/karadav\/lib\/KaraDAV\/NextCloud.php",
                    "line": 33,
                    "code": {
                        "29": "\t\tif (!$user) {",
                        "30": "\t\t\treturn false;",
                        "31": "\t\t}",
                        "32": "",
                        "33": "\t\t$this->user = $user;",
                        "34": "",
                        "35": "\t\treturn true;",
                        "36": "\t}",
                        "37": ""
                    }
                },
                {
                    "function": "KaraDAV\\NextCloud->auth",
                    "file": "\/home\/lubiana\/dev\/private\/karadav\/lib\/KD2\/WebDAV\/NextCloud.php",
                    "line": 380,
                    "args": {
                        "$login": "string(7) \"lubiana\"",
                        "$password": "string(33) \"redacted\""
                    },
                    "code": {
                        "376": "\t}",
                        "377": "",
                        "378": "\tprotected function requireAuth(): void",
                        "379": "\t{",
                        "380": "\t\tif (!$this->auth($_SERVER['PHP_AUTH_USER'] ?? null, $_SERVER['PHP_AUTH_PW'] ?? null)) {",
                        "381": "\t\t\theader('WWW-Authenticate: Basic realm=\"Please login\"');",
                        "382": "\t\t\tthrow new Exception('Please login to access this resource', 401);",
                        "383": "\t\t}",
                        "384": "\t}"
                    }
                },
                {
                    "function": "KD2\\WebDAV\\NextCloud->requireAuth",
                    "file": "\/home\/lubiana\/dev\/private\/karadav\/lib\/KD2\/WebDAV\/NextCloud.php",
                    "line": 559,
                    "code": {
                        "555": "\t}",
                        "556": "",
                        "557": "\tpublic function nc_user(): array",
                        "558": "\t{",
                        "559": "\t\t$this->requireAuth();",
                        "560": "",
                        "561": "\t\t$quota = $this->getUserQuota();",
                        "562": "\t\t$user = $this->getUserName() ?? 'null';",
                        "563": ""
                    }
                },
                {
                    "function": "KD2\\WebDAV\\NextCloud->nc_user",
                    "file": "\/home\/lubiana\/dev\/private\/karadav\/lib\/KD2\/WebDAV\/NextCloud.php",
                    "line": 317,
                    "args": [
                        "string(21) \"ocs\/v1.php\/cloud\/user\""
                    ],
                    "code": {
                        "313": "\t\t$method = $_SERVER['REQUEST_METHOD'] ?? null;",
                        "314": "\t\t$this->server->log('NC <= %s %s => routed to: %s', $method, $uri, $route);",
                        "315": "",
                        "316": "\t\ttry {",
                        "317": "\t\t\t$v = $this->{'nc_' . $route}($uri);",
                        "318": "\t\t}",
                        "319": "\t\tcatch (Exception $e) {",
                        "320": "\t\t\t$this->server->log('NC => %d - %s', $e->getCode(), $e->getMessage());",
                        "321": "\t\t\thttp_response_code($e->getCode());"
                    }
                },
                {
                    "function": "KD2\\WebDAV\\NextCloud->route",
                    "file": "\/home\/lubiana\/dev\/private\/karadav\/lib\/KaraDAV\/Server.php",
                    "line": 44,
                    "args": {
                        "$uri": "string(21) \"ocs\/v1.php\/cloud\/user\""
                    },
                    "code": {
                        "40": "\t\t}",
                        "41": "",
                        "42": "\t\t$this->nc->setServer($this->dav);",
                        "43": "",
                        "44": "\t\tif ($r = $this->nc->route($uri)) {",
                        "45": "\t\t\t\/\/ NextCloud route already replied something, stop here",
                        "46": "\t\t\treturn true;",
                        "47": "\t\t}",
                        "48": ""
                    }
                },
                {
                    "function": "KaraDAV\\Server->route",
                    "file": "...\/_router.php",
                    "line": 47,
                    "args": {
                        "$uri": "string(22) \"\/ocs\/v1.php\/cloud\/user\""
                    },
                    "code": {
                        "43": "if (isset($_SERVER['REDIRECT_REQUEST_METHOD'])) {",
                        "44": "\t$_SERVER['REQUEST_METHOD'] = $_SERVER['REDIRECT_REQUEST_METHOD'];",
                        "45": "}",
                        "46": "",
                        "47": "if (!$s->route($uri)) {",
                        "48": "\tif (PHP_SAPI == 'cli-server') {",
                        "49": "\t\t$s->dav->log(\"ROUTER: => Route is not managed: 404\");",
                        "50": "\t}",
                        "51": ""
                    }
                }
            ]
        }
    ],
    "context": {
        "date": "2023-04-24T19:07:01+00:00",
        "duration": 155.84897994995117,
        "environment": "development",
        "hostname": "0.0.0.0",
        "http_files": "array(0) {\n}",
        "http_method": "GET",
        "http_post": "array(0) {\n}",
        "http_user_agent": "Mozilla\/5.0 (Linux) mirall\/3.8.1git (Nextcloud, arch-6.2.12-arch1-1 ClientArchitecture: x86_64 OsArchitecture: x86_64)",
        "id": "25qisnme",
        "language": "PHP 8.2.5",
        "memory_peak": 2097152,
        "memory_used": 2097152,
        "os": "Linux",
        "php_sapi": "cli-server",
        "remote_ip": "127.0.0.1",
        "root_directory": "\/home\/lubiana\/dev\/private\/karadav\/www",
        "user_addr": "127.0.0.1",
        "url": "http:\/\/127.0.0.1:8080\/ocs\/v1.php\/cloud\/user?format=json"
    }
}
</errorReport>
```
2023-04-24 21:54:47 +02:00
bohwaz ec518aed1d Allow to install in a subdirectory 2023-03-12 20:40:55 +01:00
bohwaz 7b5ca7914f Allow to disable slow file operations (directory size / mtime) 2023-03-12 15:34:04 +01:00
bohwaz 883275da1a Update dependencies 2023-03-12 15:32:19 +01:00
bohwaz d3b21dd270 Update README 2023-02-18 12:33:19 +01:00
bohwaz 855d4b8d47 Update README 2023-02-14 13:30:24 +01:00
bohwaz 87f27e9c6b Create error log if possible by default 2023-02-14 13:27:42 +01:00
bohwaz a1dfe67638 Add support for ownCloud/NextCloud checksum verification 2023-02-14 13:27:19 +01:00
bohwaz 26863fd18a Update dependencies 2023-02-14 13:26:40 +01:00
bohwaz 6386bba8ac * Change methods to get recursive directory size and to delete a directory recursively
* Allow "unlimited" disk quota
2023-02-14 12:15:15 +01:00
bohwaz 94635065b3 Fix #25 undefined property 2023-02-11 15:28:57 +01:00
bohwaz b9e765be83 Update dependencies 2023-01-28 03:11:31 +01:00
bohwaz 255e3a56d0 Fix issue #24 division by zero when quota is zero 2023-01-28 02:40:05 +01:00
bohwaz a6bf02b20b Just in case the HTTP client (like csync) is sending the full REQUEST_URI with host and scheme, only extract the path 2022-11-27 15:39:38 +01:00
bohwaz 42b9c0b602 Update dependencies, split NextCloud permissions 2022-11-27 06:54:44 +01:00
bohwaz ade93f8518 Add mention of csync in README 2022-11-27 06:36:55 +01:00
bohwaz 5d34c4d996 Fix #20: use a temporary storage path inside the users storage path, fix missing path prefix in $tmp_file 2022-11-23 00:42:59 +01:00
bohwaz b3d7e5e628 Fix #21 typo in method name 2022-11-23 00:10:50 +01:00
bohwaz 10df7c043d Update CSS dependency 2022-11-22 16:29:24 +01:00
bohwaz 45f52c5459 Update dependencies 2022-11-22 04:05:07 +01:00
bohwaz 12d685fd6e Update JS dependencies 2022-11-21 18:24:31 +01:00
bohwaz 68cb4e8cc4 Raise errors if the user does not have access to a directory or file 2022-11-21 18:18:04 +01:00
bohwaz b2c97b0d55 Handle non-writeable and non-readable files 2022-11-21 18:05:55 +01:00
bohwaz e59c30bf1a Expose all ErrorManager options to configuration 2022-11-21 16:13:02 +01:00
Amey a392730ec9
Allow to disable error messages in production (was: Initialize ErrorManager based on RUN_MODE environment variable. (#17)) 2022-11-21 15:52:31 +01:00