Commit graph

78 commits

Author SHA1 Message Date
bohwaz 4db04614da Update dependencies 2024-01-01 19:15:52 +01:00
bohwaz 7f0a87be44 Allow to empty trash from users page 2023-12-31 16:53:00 +01:00
bohwaz ef96655277 Make sure we create directories in the right place, fix #46 2023-12-31 16:41:12 +01:00
bohwaz f9ae56c3b0 Don't try to touch after rename 2023-12-31 16:23:09 +01:00
bohwaz b5aeb7903f Adjust Storage according to new WebDAV library changes 2023-12-31 15:49:00 +01:00
bohwaz 23da9a2d33 Update dependencies 2023-12-31 15:48:50 +01:00
bohwaz 30c342316b Fix creating a file was creating a directory 2023-10-15 14:58:34 +02:00
bohwaz 4cde41e2f5 Update dependencies 2023-10-15 12:19:20 +02:00
bohwaz 18bb00057b Implement trashbin support 2023-09-11 16:38:07 +02:00
bohwaz 5bda7a72fc Update deps 2023-09-11 01:44:08 +02:00
bohwaz b28b9c8fec Again 2023-09-11 01:41:26 +02:00
bohwaz 3a11e33b48 Update deps 2023-09-11 01:40:48 +02:00
bohwaz dc065255e8 Fix bug where NC Android didn't want to allow file/directory creation 2023-09-11 01:37:05 +02:00
bohwaz cdbcd1b411 Update deps 2023-09-11 01:15:14 +02:00
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 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 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 661c2edfaa Fix auth_callback return, provide namespace in example callback 2023-05-12 10:53:58 +02:00
bohwaz d2f57e3fdc Implement auth callback fix #33 2023-05-11 01:54:43 +02:00
bohwaz 595a1ad141 Update dependencies, fix printing issue with Collabora Office 2023-04-24 21:59:34 +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 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 42b9c0b602 Update dependencies, split NextCloud permissions 2022-11-27 06:54:44 +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 45f52c5459 Update dependencies 2022-11-22 04:05:07 +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 97cbdd15c9 * Fix issues with brackets in directory names
* Update dependencies
2022-11-15 13:10:52 +01:00
bohwaz 1cf9bcc412 Update dependencies 2022-11-14 01:55:23 +01:00
bohwaz 60acfc6117 Update dependencies 2022-11-14 01:53:25 +01:00
bohwaz 3641b1d2e1 Fix issue with Cyberduck, move WWW_URL auto-detection outside of config file, add CHANGES log 2022-11-13 18:35:31 +01:00
bohwaz 3d1af68671 Fix issue with NextCloud direct URLs crashing 2022-11-04 20:52:02 +01:00
bohwaz 7356c8a574 Various security enhancements:
* forbid XML with DOCTYPE
* use a common HMAC method for consistency
* Generate a secret key and store it in local config if it does not exist
2022-10-30 00:52:35 +02:00
bohwaz bcaed89caf Update dependencies 2022-10-29 21:41:48 +02:00
bohwaz f277271971 Update dependencies 2022-10-29 21:31:34 +02:00
bohwaz 1c59441101 Use hash_hmac, it makes it clearer what this code does 2022-10-29 21:26:34 +02:00
bohwaz 7dfa0af73b Only set Access-Control-Allow-Origin to '*' when you actually want it 2022-10-28 23:57:47 +02:00
bohwaz c82952de75 Add CSRF stateless protection to forms 2022-10-28 23:42:55 +02:00