GithubHelp home page GithubHelp logo

masx200 / webdav-cli Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 2.04 MB

A simple zero-configuration command-line webdav server

License: MIT License

TypeScript 92.89% JavaScript 7.11%
webdav-cli webdav-server

webdav-cli's Introduction

WebDAV CLI

forked from svtslv/webdav-cli

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

Optimized a problem

OpenMarshal/npm-WebDAV-Server#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'

webdav-cli's People

Contributors

dependabot[bot] avatar masx200 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kaivio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.