Skip to content

Commit cbce9a8

Browse files
committed
重新上传一次,并升级
1 parent 2bb11bc commit cbce9a8

35 files changed

+6785
-97
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
index.js
2+
index.ts
3+
index.d.ts

.eslintrc.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
sourceType: 'module',
6+
},
7+
plugins: ['@typescript-eslint/eslint-plugin'],
8+
extends: [
9+
'plugin:@typescript-eslint/eslint-recommended',
10+
'plugin:@typescript-eslint/recommended',
11+
'prettier',
12+
'prettier/@typescript-eslint',
13+
],
14+
root: true,
15+
env: {
16+
node: true,
17+
jest: true,
18+
},
19+
rules: {
20+
'@typescript-eslint/interface-name-prefix': 'off',
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
semi: ['error', 'always'],
24+
},
25+
};

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.js linguist-language=Typescript
2+
*.css linguist-language=Typescript
3+
*.html linguist-language=Typescript
4+
*.jsx linguist-language=Typescript
5+
*.ts linguist-language=Typescript

.github/workflows/codeql-analysis.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [1.0.2]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [1.0.2]
9+
schedule:
10+
- cron: '0 16 * * 4'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
# Override automatic language detection by changing the below list
21+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
22+
language: ['javascript']
23+
# Learn more...
24+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v2
29+
with:
30+
# We must fetch at least the immediate parents so that if this is
31+
# a pull request then we can checkout the head.
32+
fetch-depth: 2
33+
34+
# If this run was triggered by a pull request event, then checkout
35+
# the head of the pull request instead of the merge commit.
36+
- run: git checkout HEAD^2
37+
if: ${{ github.event_name == 'pull_request' }}
38+
39+
# Initializes the CodeQL tools for scanning.
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@v1
42+
with:
43+
languages: ${{ matrix.language }}
44+
45+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
46+
# If this step fails, then you should remove it and run the build manually (see below)
47+
- name: Autobuild
48+
uses: github/codeql-action/autobuild@v1
49+
50+
# ℹ️ Command-line programs to run using the OS shell.
51+
# 📚 https://git.io/JvXDl
52+
53+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
54+
# and modify them (or add more) to build your code if your project
55+
# uses a compiled language
56+
57+
#- run: |
58+
# make bootstrap
59+
# make release
60+
61+
- name: Perform CodeQL Analysis
62+
uses: github/codeql-action/analyze@v1

.gitignore

+26-96
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# compiled output
2+
#/dist
3+
/node_modules
4+
15
# Logs
26
logs
37
*.log
@@ -6,99 +10,25 @@ yarn-debug.log*
610
yarn-error.log*
711
lerna-debug.log*
812

9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
66-
*.tgz
67-
68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
72-
.env
73-
.env.test
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
13+
# OS
14+
.DS_Store
15+
16+
# Tests
17+
/coverage
18+
/.nyc_output
19+
20+
# IDEs and editors
21+
/.idea
22+
.project
23+
.classpath
24+
.c9/
25+
*.launch
26+
.settings/
27+
*.sublime-workspace
28+
29+
# IDE - VSCode
30+
.vscode/*
31+
!.vscode/settings.json
32+
!.vscode/tasks.json
33+
!.vscode/launch.json
34+
!.vscode/extensions.json

.prettierrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "tabWidth": 4, "singleQuote": true, "trailingComma": "all" }

README.md

+83-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,84 @@
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+
217
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

certs/self-signed.cert.pem

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIDOzCCAiOgAwIBAgIUMeTYKq547CQcDyNj5Sj5ZwcxDN8wDQYJKoZIhvcNAQEL
3+
BQAwLTELMAkGA1UEBhMCVUExDTALBgNVBAgMBEt5aXYxDzANBgNVBAoMBnN2dHNs
4+
djAeFw0yMDAzMDIyMjUxNDBaFw0zMDAyMjgyMjUxNDBaMC0xCzAJBgNVBAYTAlVB
5+
MQ0wCwYDVQQIDARLeWl2MQ8wDQYDVQQKDAZzdnRzbHYwggEiMA0GCSqGSIb3DQEB
6+
AQUAA4IBDwAwggEKAoIBAQDBxLjsrteSkjSsT+NnlDM8hJxDI7YGEMOwyJodTNT1
7+
8raXt3iD0LKViqDCxHn5szuwdPo/YlY9o2g5z1xJn7QlzVdRAqtMoxFz9sj8vAqY
8+
sAv/jvkJYlcwIamgJhYYmAZM0Lban2x2bDo5oeyUGjk8gtk0V6Y4sfgPm7uJpoE4
9+
pNoFfTA7fN+JQZetaKLfsXazYvUjUn9QFS0AsLZX7mhx7t5ASDCuOmlVRqmD9xiX
10+
x6oo8/qGC/sMTEnWeJzpGzyIKXpwMrN/oKxn3/JCgFcDKt+iIEhDQ6YJN23DVBIp
11+
mayZ/PWuQ5g1cCWXqZQ7nEMGgW3cSo7xzKb4QNwDLgm/AgMBAAGjUzBRMB0GA1Ud
12+
DgQWBBQz4DMPb30ovUO0zd+ECY4M5r1T9zAfBgNVHSMEGDAWgBQz4DMPb30ovUO0
13+
zd+ECY4M5r1T9zAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBN
14+
pE0Z3Jf3TSVCxygjh/ylrVLnXuUi3QbrXgKhXVA6a4qHIUnmcAzZCF2YKwZb2p4p
15+
27+DDPGEvVd9nulN8hDQ561B4mggch1KuTZTW7X028AEFIns/+BQJj9v2YnAwn8L
16+
IVnmhcqxaerLgKq4KRobLIPIxKeIPBcEcgBlDL244cMDnwOnYp7v5BYxN/s1L5OU
17+
5wCGs6FEt6Nzcw8x777xvVxvAe6TRen0Y0PheCHkoELsJ1Q0UGZHFnXxUP3c3THD
18+
WgGG3DuSoc4VNbSGz3yr+08YY2VgNJpYhSQUrBpNEjgeKHTtht1Vi20pb9inSxLj
19+
kYXUCOt+RRoAqiulwFLy
20+
-----END CERTIFICATE-----

certs/self-signed.key.pem

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-----BEGIN PRIVATE KEY-----
2+
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDBxLjsrteSkjSs
3+
T+NnlDM8hJxDI7YGEMOwyJodTNT18raXt3iD0LKViqDCxHn5szuwdPo/YlY9o2g5
4+
z1xJn7QlzVdRAqtMoxFz9sj8vAqYsAv/jvkJYlcwIamgJhYYmAZM0Lban2x2bDo5
5+
oeyUGjk8gtk0V6Y4sfgPm7uJpoE4pNoFfTA7fN+JQZetaKLfsXazYvUjUn9QFS0A
6+
sLZX7mhx7t5ASDCuOmlVRqmD9xiXx6oo8/qGC/sMTEnWeJzpGzyIKXpwMrN/oKxn
7+
3/JCgFcDK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U16BkO
23+
0N8Bfswu3MtiWko2o9s3yGox894uQJME4wlqnrtC9mgGSpJkq5N0h9sTAR3hk2Z9
24+
+1uiCzvSJfmysK0NPY2z/fMVMANT1i40OVDZeN5JAoGBAMgeJgeP8+K7Z0ecd4TL
25+
QONJ9j27mLsHCjSpxdaM98xM7Dw82KxQ4SJ74ZB0LPbSLtkhJhorRmXsAMCDih4Q
26+
BGyGnC11c8h1qRCuu2evXkXn6gK8OLcZxZJGTe/3vNR/hn1HCYlAX/sjEyaVVCbL
27+
bluIUqnVB577qS3yfxP9dWhu
28+
-----END PRIVATE KEY-----

dist/index.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './webdav-cli.constants';
2+
export * from './webdav-cli.interfaces';
3+
export * from './webdav-cli.server';
4+
export * from './webdav-cli.utils';

0 commit comments

Comments
 (0)