1 Star 7 Fork 0

masx200 / webdav-cli

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

WebDAV CLI

forked from svtslv/webdav-cli

https://github.com/svtslv/webdav-cli

Optimized a problem

https://github.com/OpenMarshal/npm-WebDAV-Server/issues/84

Description

A simple zero-configuration command-line webdav server

给 "webdav" 服务器加上了 "etag" 头部和条件请求的功能

支持范围请求,跨域访问,支持内容压缩

支持在浏览器中展示文件夹内容了,使用"koa2-serve-index"

如果请求方法是"GET"或者"HEAD",交给"koa"服务器处理,提供静态文件

使用 "http-auth"进行用户验证。

Installation

Globally via yarn

yarn global add @masx200/webdav-cli

Running on-demand:

npx @masx200/webdav-cli [options]

Examples

npx @masx200/webdav-cli --help
   usage: webdav-cli [options]

options:
  --path,-pa       Path to folder [process.cwd()]
  --host,-ho       Host to use [0.0.0.0]
  --port,-po       Port to use [1900]
  --digest,-dg     Enable digest authentication [basic]
  --username,-u   Username for basic/digest authentication [random]
  --password,-ps   Password for basic/digest authentication [random]

  --disableAuthentication,-da  The server file becomes read-only without Authentication.[false]
  --ssl,-s        Enable https [false]
  --methodsWithoutAuthentication          methods Without Authentication[undefined]
  --sslKey     Path to ssl key file [self-signed]
  --sslCert    Path to ssl cert file [self-signed]
  --help,-h       Print this list and exit

  --rights,-r     Comma separated values without spaces [all]

        'all', 'canCreate', 'canDelete', 'canMove', 'canRename',
        'canAppend', 'canWrite', 'canRead', 'canSource',
        'canGetMimeType', 'canGetSize', 'canListLocks',
        'canSetLock', 'canRemoveLock', 'canGetAvailableLocks',
        'canGetLock', 'canAddChild', 'canRemoveChild',
        'canGetChildren', 'canSetProperty', 'canGetProperty',
        'canGetProperties', 'canRemoveProperty', 'canGetCreationDate',
        'canGetLastModifiedDate', 'canGetWebName', 'canGetType'
env:
  WEBDAV_CLI_PATH, WEBDAV_CLI_HOST, WEBDAV_CLI_PORT,
  WEBDAV_CLI_USERNAME, WEBDAV_CLI_PASSWORD, WEBDAV_CLI_DIGEST,
  WEBDAV_CLI_SSL, WEBDAV_CLI_SSL_KEY, WEBDAV_CLI_SSL_CERT,
   WEBDAV_CLI_AUTO_INDEX, WEBDAV_CLI_RIGHTS
  WEBDAV_CLI_DISABLE_AUTHENTICATION

TLS/SSL

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:

openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem

Use 0.0.0.0 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.

Then you need to run the server with --ssl for enabling SSL and --sslKey=key.pem --sslCert=cert.pem for your certificate files.

License

MIT

changelog

2022 年 6 月 15 日 10:12:28

添加了可选参数 methodsWithoutAuthentication,可以允许某些方法不需要身份验证,例如:

'--methodsWithoutAuthentication=GET,HEAD,PROPFIND,OPTIONS'
MIT License Copyright (c) 2020 masx200 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

A simple zero-configuration command-line webdav server 展开 收起
JavaScript 等 2 种语言
MIT
取消

发行版 (6)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/masx200/webdav-cli.git
git@gitee.com:masx200/webdav-cli.git
masx200
webdav-cli
webdav-cli
master

搜索帮助