mirror of
https://github.com/ZSCGR/CloudFlare-ImgBed.git
synced 2026-08-13 04:03:42 +08:00
feat: add webdav upload channel
This commit is contained in:
@@ -188,25 +188,6 @@ Provides detailed deployment documentation, feature docs, development plans, upd
|
||||
|
||||
# 4. Tips
|
||||
|
||||
- **WebDAV storage channel**: Besides the built-in `/dav` WebDAV server, this project can also use a third-party WebDAV server as an upload storage channel. Configure a fixed channel with `WEBDAV_BASE_URL`; optional variables are `WEBDAV_USERNAME`, `WEBDAV_PASSWORD`, `WEBDAV_PUBLIC_URL`, `WEBDAV_HEADERS` (JSON object string), and `WEBDAV_CREATE_DIRECTORY=false`. Runtime channel config uses:
|
||||
```json
|
||||
{
|
||||
"webdav": {
|
||||
"loadBalance": { "enabled": false },
|
||||
"channels": [{
|
||||
"name": "dav-main",
|
||||
"type": "webdav",
|
||||
"baseUrl": "https://dav.example.com/remote.php/dav/files/user/imgbed/",
|
||||
"username": "user",
|
||||
"password": "pass",
|
||||
"publicUrl": "https://cdn.example.com/imgbed/",
|
||||
"enabled": true
|
||||
}]
|
||||
}
|
||||
}
|
||||
```
|
||||
The implementation uses Fetch/Web APIs only, so it is compatible with Cloudflare Pages Functions and Workers deployments. Basic authentication and no-auth WebDAV endpoints are supported; Digest-only providers are not supported. WebDAV chunked uploads are intentionally disabled, so large uploads must stay within your Cloudflare request body limits.
|
||||
|
||||
- Frontend is open source, see [MarSeventh/Sanyue-ImgHub](https://github.com/MarSeventh/Sanyue-ImgHub).
|
||||
|
||||
- Desktop software is open source, see [MarSeventh/satellite](https://github.com/MarSeventh/satellite).
|
||||
|
||||
@@ -200,25 +200,6 @@
|
||||
|
||||
# 4. Tips
|
||||
|
||||
- **WebDAV 存储渠道**:除了内置 `/dav` WebDAV 服务外,本项目也可以把第三方 WebDAV 服务作为上传存储渠道使用。固定环境变量渠道可配置 `WEBDAV_BASE_URL`;可选变量包括 `WEBDAV_USERNAME`、`WEBDAV_PASSWORD`、`WEBDAV_PUBLIC_URL`、`WEBDAV_HEADERS`(JSON 对象字符串)和 `WEBDAV_CREATE_DIRECTORY=false`。运行时渠道配置结构如下:
|
||||
```json
|
||||
{
|
||||
"webdav": {
|
||||
"loadBalance": { "enabled": false },
|
||||
"channels": [{
|
||||
"name": "dav-main",
|
||||
"type": "webdav",
|
||||
"baseUrl": "https://dav.example.com/remote.php/dav/files/user/imgbed/",
|
||||
"username": "user",
|
||||
"password": "pass",
|
||||
"publicUrl": "https://cdn.example.com/imgbed/",
|
||||
"enabled": true
|
||||
}]
|
||||
}
|
||||
}
|
||||
```
|
||||
实现仅使用 Fetch/Web API,因此可用于 Cloudflare Pages Functions 和 Workers 部署。支持 Basic 认证或无认证 WebDAV 端点;暂不支持仅 Digest 认证的服务。WebDAV 分片上传已明确禁用,大文件需在 Cloudflare 请求体限制范围内直接上传。
|
||||
|
||||
- **前端开源**:参见[MarSeventh/Sanyue-ImgHub](https://github.com/MarSeventh/Sanyue-ImgHub)项目。
|
||||
|
||||
- **桌面端开源**:参见[MarSeventh/satellite](https://github.com/MarSeventh/satellite)项目。
|
||||
|
||||
@@ -23,13 +23,6 @@ not_found_handling = "single-page-application"
|
||||
[vars]
|
||||
# TG_BOT_TOKEN = ""
|
||||
# TG_CHAT_ID = ""
|
||||
# Optional third-party WebDAV storage channel:
|
||||
# WEBDAV_BASE_URL = "https://dav.example.com/remote.php/dav/files/user/imgbed/"
|
||||
# WEBDAV_USERNAME = ""
|
||||
# WEBDAV_PASSWORD = ""
|
||||
# WEBDAV_PUBLIC_URL = ""
|
||||
# WEBDAV_HEADERS = "{\"X-Example\":\"value\"}"
|
||||
# WEBDAV_CREATE_DIRECTORY = "true"
|
||||
|
||||
# [[d1_databases]]
|
||||
# binding = "img_d1"
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1 +1 @@
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/static/media/logo.png"><link rel="apple-touch-icon" href="/static/media/logo.png"><link rel="mask-icon" href="/static/media/logo.png" color="#f4b400"><meta name="description" content="Sanyue ImgHub - A modern file hosting platform"><meta name="keywords" content="Sanyue, ImgHub, file hosting, image hosting, cloud storage"><meta name="author" content="SanyueQi"><title>Sanyue ImgHub</title><script defer="defer" src="/js/chunk-vendors.faaf8b59.js"></script><script defer="defer" src="/js/app.30c4ad3d.js"></script><link href="/css/chunk-vendors.f9cd4701.css" rel="stylesheet"><link href="/css/app.75711fde.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but sanyue_imghub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/static/media/logo.png"><link rel="apple-touch-icon" href="/static/media/logo.png"><link rel="mask-icon" href="/static/media/logo.png" color="#f4b400"><meta name="description" content="Sanyue ImgHub - A modern file hosting platform"><meta name="keywords" content="Sanyue, ImgHub, file hosting, image hosting, cloud storage"><meta name="author" content="SanyueQi"><title>Sanyue ImgHub</title><script defer="defer" src="/js/chunk-vendors.82c104b1.js"></script><script defer="defer" src="/js/app.5863a19f.js"></script><link href="/css/chunk-vendors.f9cd4701.css" rel="stylesheet"><link href="/css/app.75711fde.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but sanyue_imghub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
+1
-1
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+1
-1
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user