|
1 |
| -# masx200-webdav-cli- |
| 1 | +# WebDAV CLI |
| 2 | + |
| 3 | +forked from svtslv/webdav-cli |
| 4 | + |
| 5 | +https://github.com/svtslv/webdav-cli |
| 6 | + |
| 7 | +## Table of Contents |
| 8 | + |
| 9 | +- [Description](#description) |
| 10 | +- [Installation](#installation) |
| 11 | +- [Examples](#examples) |
| 12 | +- [TLS/SSL](#tlsssl) |
| 13 | +- [License](#license) |
| 14 | + |
| 15 | +## Description |
| 16 | + |
2 | 17 | A simple zero-configuration command-line webdav server
|
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +#### Globally via `npm` |
| 22 | + |
| 23 | +```bash |
| 24 | +yarn global add @masx200/webdav-cli |
| 25 | +``` |
| 26 | + |
| 27 | +#### Running on-demand: |
| 28 | + |
| 29 | +```bash |
| 30 | +npx @masx200/webdav-cli [options] |
| 31 | +``` |
| 32 | + |
| 33 | +## Examples |
| 34 | + |
| 35 | +```bash |
| 36 | +npx @masx200/webdav-cli --help |
| 37 | +``` |
| 38 | + |
| 39 | +```bash |
| 40 | + 'usage: webdav-cli [options]', |
| 41 | + '', |
| 42 | + 'options:', |
| 43 | + ' --path Path to folder [process.cwd()]', |
| 44 | + ' --host Host to use [127.0.0.1]', |
| 45 | + ' --port Port to use [1900]', |
| 46 | + ' --digest Enable digest authentication [basic]', |
| 47 | + ' --username Username for basic/digest authentication [random]', |
| 48 | + ' --password Password for basic/digest authentication [random]', |
| 49 | + ' --ssl Enable https [false]', |
| 50 | + ' --sslKey Path to ssl key file [self-signed]', |
| 51 | + ' --sslCert Path to ssl cert file [self-signed]', |
| 52 | + ' --help Print this list and exit', |
| 53 | + ' --version Print the version and exit.', |
| 54 | + ' --rights Comma separated values without spaces [all]', ` |
| 55 | + 'all', 'canCreate', 'canDelete', 'canMove', 'canRename', |
| 56 | + 'canAppend', 'canWrite', 'canRead', 'canSource', |
| 57 | + 'canGetMimeType', 'canGetSize', 'canListLocks', |
| 58 | + 'canSetLock', 'canRemoveLock', 'canGetAvailableLocks', |
| 59 | + 'canGetLock', 'canAddChild', 'canRemoveChild', |
| 60 | + 'canGetChildren', 'canSetProperty', 'canGetProperty', |
| 61 | + 'canGetProperties', 'canRemoveProperty', 'canGetCreationDate', |
| 62 | + 'canGetLastModifiedDate', 'canGetWebName', 'canGetType'`, |
| 63 | + 'env:', |
| 64 | + ' WEBDAV_CLI_PATH, WEBDAV_CLI_HOST, WEBDAV_CLI_PORT,', |
| 65 | + ' WEBDAV_CLI_USERNAME, WEBDAV_CLI_PASSWORD, WEBDAV_CLI_DIGEST,', |
| 66 | + ' WEBDAV_CLI_SSL, WEBDAV_CLI_SSL_KEY, WEBDAV_CLI_SSL_CERT,', |
| 67 | + ' WEBDAV_CLI_RIGHTS, WEBDAV_CLI_DISABLE_AUTHENTICATION', |
| 68 | +``` |
| 69 | + |
| 70 | +## TLS/SSL |
| 71 | + |
| 72 | +First, you need to make sure that openssl is installed correctly, and you have `key.pem` and `cert.pem` files. You can generate them using this command: |
| 73 | + |
| 74 | +```bash |
| 75 | +openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem |
| 76 | +``` |
| 77 | + |
| 78 | +Use `127.0.0.1` as value for `Common name` if you want to be able to install the certificate in your OS's root certificate store or browser so that it is trusted. |
| 79 | + |
| 80 | +Then you need to run the server with `--ssl` for enabling SSL and `--sslKey=key.pem --sslCert=cert.pem` for your certificate files. |
| 81 | + |
| 82 | +## License |
| 83 | + |
| 84 | +MIT |
0 commit comments