Skip to content

Commit aded234

Browse files
author
Taois
committed
feat: 增加webdav工具
1 parent deba904 commit aded234

File tree

17 files changed

+2752
-0
lines changed

17 files changed

+2752
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ todo:
120120
## 参考资料
121121

122122
* [crypto-js-wasm使用教程](docs/crypto-js-wasm/readme-CN.md)
123+
* [webdav使用教程](docs/webdav.md)
123124
* [puppeteer使用教程](docs/pupInstall.md)
124125
* [drpyS源属性说明](docs/ruleAttr.md)
125126
* [drpy2写源简述](docs/ruleDesc.md)

config/map.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
webdav[盘]@@?render=1&type=url&params=../json/webdav.json@@本地文件[盘]
12
哔哩收藏[官]@@?render=1&type=url&params=../json/哔哩收藏.json@@哔哩收藏[官]
23
我的哔哩[官]@@?render=1&type=url&params=../json/哔哩教育.json@@哔哩教育[官]
34
我的哔哩[官]@@?render=1&type=url&params=../json/哔哩少儿.json@@哔哩少儿[官]

controllers/api.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export default (fastify, options, done) => {
132132
const httpUrl = `${protocol}://${hostname}/http`;
133133
const imageApi = `${protocol}://${hostname}/image`;
134134
const mediaProxyUrl = `${protocol}://${hostname}/mediaProxy`;
135+
const webdavProxyUrl = `${protocol}://${hostname}/webdav/`;
135136
const hostUrl = `${hostname.split(':')[0]}`;
136137
const fServer = fastify.server;
137138

@@ -155,6 +156,7 @@ export default (fastify, options, done) => {
155156
httpUrl,
156157
imageApi,
157158
mediaProxyUrl,
159+
webdavProxyUrl,
158160
hostUrl,
159161
hostname,
160162
fServer,
@@ -408,6 +410,7 @@ export default (fastify, options, done) => {
408410
const httpUrl = `${protocol}://${hostname}/http`;
409411
const imageApi = `${protocol}://${hostname}/image`;
410412
const mediaProxyUrl = `${protocol}://${hostname}/mediaProxy`;
413+
const webdavProxyUrl = `${protocol}://${hostname}/webdav/`;
411414
const hostUrl = `${hostname.split(':')[0]}`;
412415
const fServer = fastify.server;
413416

@@ -432,6 +435,7 @@ export default (fastify, options, done) => {
432435
httpUrl,
433436
imageApi,
434437
mediaProxyUrl,
438+
webdavProxyUrl,
435439
hostUrl,
436440
hostname,
437441
fServer,
@@ -547,6 +551,7 @@ export default (fastify, options, done) => {
547551
const httpUrl = `${protocol}://${hostname}/http`;
548552
const imageApi = `${protocol}://${hostname}/image`;
549553
const mediaProxyUrl = `${protocol}://${hostname}/mediaProxy`;
554+
const webdavProxyUrl = `${protocol}://${hostname}/webdav/`;
550555
const hostUrl = `${hostname.split(':')[0]}`;
551556
const fServer = fastify.server;
552557

@@ -571,6 +576,7 @@ export default (fastify, options, done) => {
571576
httpUrl,
572577
imageApi,
573578
mediaProxyUrl,
579+
webdavProxyUrl,
574580
hostUrl,
575581
hostname,
576582
getProxyUrl,

controllers/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import cronTaskerController from './cron-tasker.js';
3636
import sourceCheckerController from './source-checker.js';
3737
// 图片存储控制器
3838
import imageStoreController from './image-store.js';
39+
// WebDAV 代理控制器
40+
import webdavProxyController from './webdav-proxy.js';
3941

4042
/**
4143
* 注册所有路由控制器
@@ -76,4 +78,6 @@ export const registerRoutes = (fastify, options) => {
7678
fastify.register(sourceCheckerController, options);
7779
// 注册图片存储路由
7880
fastify.register(imageStoreController, options);
81+
// 注册 WebDAV 代理路由
82+
fastify.register(webdavProxyController, options);
7983
};

0 commit comments

Comments
 (0)