Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
aigem authored Sep 10, 2024
0 parents commit 00cdb4b
Show file tree
Hide file tree
Showing 9 changed files with 1,640 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = tab
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
172 changes: 172 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
\*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
\*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

\*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

\*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.cache
.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

.cache/

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp
.cache

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.\*

# wrangler project

.dev.vars
.wrangler/
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 120,
"singleQuote": true,
"semi": true,
"useTabs": true
}
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# WebDAV and S3 Server [免费cfworker应用]

This project implements a WebDAV and S3 compatible server using Cloudflare Workers and R2.

## Setup

1. Install dependencies:
npm install




2. Configure `wrangler.toml` with your credentials and bucket information.

3. Deploy to Cloudflare Workers:
wrangler publish




## Usage

- WebDAV endpoints are available at the root path.
- S3 compatible endpoints are available under the `/s3` path.

For more detailed usage instructions, please refer to the API documentation.

## Development

To run the project locally:
wrangler dev




## Testing

Run the test suite:
npm test




## License

This project is licensed under the MIT License.
37 changes: 37 additions & 0 deletions output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os

def read_file(file_path):
try:
with open(file_path, 'r', encoding='utf-8') as file:
return file.read()
except FileNotFoundError:
return f"文件不存在: {file_path}"
except Exception as e:
return f"读取文件时出错: {file_path}\n错误: {str(e)}"

def export_files(files, output_file):
with open(output_file, 'w', encoding='utf-8') as out:
for file_path in files:
out.write(f"文件名:{file_path}\n")
out.write(read_file(file_path))
out.write("\n++++++\n\n")
print(f"文件内容已成功导出到 {output_file}")

files_to_export = [
# "tsconfig.json",
"src/utils/templates.ts",
# "package.json",
"src/index.ts",
"src/types.ts",
"src/handlers/requestHandler.ts",
"src/handlers/webdavHandler.ts",
"src/handlers/s3Handler.ts",
"src/utils/s3Client.ts",
"src/utils/auth.ts",
"src/utils/cors.ts",
"src/utils/logger.ts",
"src/utils/webdavUtils.ts"
]

output_file = "output.txt"
export_files(files_to_export, output_file)
Loading

0 comments on commit 00cdb4b

Please sign in to comment.