AlistGo / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
44.4k stars 5.76k forks source link

希望添加群晖套件Hyper Backup的支持 #701

Closed lkxlzx closed 2 years ago

lkxlzx commented 2 years ago

Description of the feature / 需求描述

通过WebDav备份NAS内文件

Suggested solution / 实现思路

现在使用报远程目的地忙

Additional context / 附件

No response

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

xhofe commented 2 years ago

没群晖……

lkxlzx commented 2 years ago

我可提供群晖账号供调试使用

lkxlzx commented 2 years ago

没群晖……

我可提供群晖账号供调试使用

lee-cq commented 2 years ago

alist已经实现了webdav,你可以在群晖上运行并正确配置alist,并启用webdav功能, 之后打开Hyper Backup, 选择 webdav image 值得注意的是,群晖Hyper Backup 只支持 HTTPS协议的webdav,所以需要Nginx代理或者 在alist的配置文件中选择https协议并配置证书

lkxlzx commented 2 years ago

谢谢我试试

lkxlzx commented 2 years ago

alist已经实现了webdav,你可以在群晖上运行并正确配置alist,并启用webdav功能, 之后打开Hyper Backup, 选择 webdav image 值得注意的是,群晖Hyper Backup 只支持 HTTPS协议的webdav,所以需要Nginx代理或者 在alist的配置文件中选择https协议并配置证书

我添加证书后测试还是一样的问题,提示备份失败,目的地正忙。网页访问证书已经显示支持了

tsui603 commented 2 years ago

alist已经实现了webdav,你可以在群晖上运行并正确配置alist,并启用webdav功能, 之后打开Hyper Backup, 选择 webdav image 值得注意的是,群晖Hyper Backup 只支持 HTTPS协议的webdav,所以需要Nginx代理或者 在alist的配置文件中选择https协议并配置证书

http可以用的啊

OldTaoge commented 2 years ago

遇到了同样的问题,排查应该是Hyper Backup的lock创建后未成功创建后删除失败。在日志中有如下:

[GIN] 2022/04/19 - 21:33:34 | 201 |       34.65µs |     172.16.64.2 | PUT      "/dav/odadm/OldTaogeDSM_2.hbk/Control/lock/lock_keep_alive.@writer_version_0.eb2457f8-192e-45b9-8e2b-135dddd60c0b"

.....................

ERRO[2022-04-19 21:33:49] delete error: The resource could not be found. 
ERRO[2022-04-19 21:33:49] The resource could not be found.             
[GIN] 2022/04/19 - 21:33:49 | 405 |  218.090892ms |     172.16.64.2 | DELETE   "/dav/odadm/OldTaogeDSM_2.hbk/Control/lock/lock_keep_alive.@writer_version_0.eb2457f8-192e-45b9-8e2b-135dddd60c0b"

创建lock不可能只需要34.65µs(考虑到Onedrive创建文件都在百毫秒级别,本地存储可能实现µs).考虑可能是Hyper Backup特殊字符(在Windows上挂载复现:创建成功,刷新就消失)测试存储为本地存储和Onedrive。均创建成功但消失(包括从服务器系统查看

OldTaoge commented 2 years ago

这是连接到OneDrive的debug日志,能够明确不是文件夹未创建的错误.另外通过网页的方式能够上传同名同目录层级的文件,考虑Bug在webDAV部分

DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/model/account.go:135 github.com/Xhofe/alist/model.GetBalancedAccount() accounts: [{ID:3 Name:/odadm Index:8 Type:Onedrive Username: Password: RefreshToken:0. RootFolder:/ Status:work CronId:0 DriveId: Limit:0 OrderBy: OrderDirection: UpdatedAt:2022-04-19 07:18:35.966 +0000 UTC Search:false ClientId:6ac136ca-730d-4700-bfb3-550bf14f7055 ClientSecret: Zone:global RedirectUri:https://tool.nn.ci/onedrive/callback SiteUrl: SiteId: InternalType:onedrive WebdavProxy:false Proxy:false WebdavDirect:false DownProxyUrl: APIProxyUrl: Bucket: Endpoint: Region: AccessKey: AccessSecret: CustomHost: ExtractFolder:front Bool1:false}] 
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/server/webdav/file.go:35 github.com/Xhofe/alist/server/webdav.(*FileSystem).File() &{3 /odadm 8 Onedrive   0. / work 0  0   2022-04-19 07:18:35.966 +0000 UTC false 6ac136ca-730d-4700-bfb3-550bf14f7055  global https://tool.nn.ci/onedrive/callback   onedrive false false false         front false} /OldTaogeDSM_1.hbk/Control/lock &{} <nil> 
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/drivers/base/cache.go:13 github.com/Xhofe/alist/drivers/base.KeyCache() cache key:  /odadm/OldTaogeDSM_1.hbk/Control 
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/drivers/base/cache.go:13 github.com/Xhofe/alist/drivers/base.KeyCache() cache key:  /odadm/OldTaogeDSM_1.hbk/Control 
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/model/account.go:135 github.com/Xhofe/alist/model.GetBalancedAccount() accounts: [{ID:3 Name:/odadm Index:8 Type:Onedrive Username: Password: RefreshToken:0. RootFolder:/ Status:work CronId:0 DriveId: Limit:0 OrderBy: OrderDirection: UpdatedAt:2022-04-19 07:18:35.966 +0000 UTC Search:false ClientId:6ac136ca-730d-4700-bfb3-550bf14f7055 ClientSecret: Zone:global RedirectUri:https://tool.nn.ci/onedrive/callback SiteUrl: SiteId: InternalType:onedrive WebdavProxy:false Proxy:false WebdavDirect:false DownProxyUrl: APIProxyUrl: Bucket: Endpoint: Region: AccessKey: AccessSecret: CustomHost: ExtractFolder:front Bool1:false}] 
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/server/common/files.go:21 github.com/Xhofe/alist/server/common.Path() use account:  /odadm                         
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/drivers/onedrive/driver.go:188 github.com/Xhofe/alist/drivers/onedrive.Onedrive.Path() onedrive path: /OldTaogeDSM_1.hbk/Control/lock 
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/drivers/base/cache.go:13 github.com/Xhofe/alist/drivers/base.KeyCache() cache key:  /odadm/OldTaogeDSM_1.hbk/Control 
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/drivers/base/cache.go:13 github.com/Xhofe/alist/drivers/base.KeyCache() cache key:  /odadm/OldTaogeDSM_1.hbk/Control/lock 
DEBU[2022-04-19 07:19:10]/home/runner/work/alist/alist/alist/server/webdav/file.go:91 github.com/Xhofe/alist/server/webdav.(*FileSystem).Files() admin                                        
OldTaoge commented 2 years ago

已明确是webDAV忽略大小为0的文件导致的(向文件中填充内容即无此bug

fsnhljz commented 2 years ago

群晖同步能用吗?file station添加都不行

OldTaoge commented 2 years ago

在升级到DSM7之后,Hyper backup的lock不再是大小为0的文件,可以正常备份,这就是@tsui603 成功而@lkxlzx 失败的原因

tsui603 commented 2 years ago

我也没成功,我只是说可以用htp协议,不过我确实是在群晖6下试的

feitianyul commented 2 years ago

在升级到DSM7之后,超级备份的锁不再是大小为0的文件,可以正常备份,这就是@tsui603成功而@lkxlzx失败的原因

我在升级7.0 后 hyperbackup 版本 3.0.2-2517 还是空文件, 备份一样不成功

wangty163 commented 2 years ago

在升级到DSM7之后,Hyper backup的lock不再是大小为0的文件,可以正常备份,这就是@tsui603 成功而@lkxlzx 失败的原因

你可以正常备份了吗?我现在是DSM7的系统,但是备份到webdav依然是会有空的lock文件导致备份失败

johnhorse commented 2 years ago

在升级到DSM7之后,Hyper backup的lock不再是大小为0的文件,可以正常备份,这就是@tsui603 成功而@lkxlzx 失败的原因

你可以正常备份了吗?我现在是DSM7的系统,但是备份到webdav依然是会有空的lock文件导致备份失败

我的也是DSM7,同样备份失败,我试了天翼、阿里云盘 都不行

lkxlzx commented 2 years ago

现在还是一样的问题,群晖的问题吧

OldTaoge commented 2 years ago

需要手动修改alist源码去除空文件忽略相关代码并且使用支持空文件的后端

fanzh365 commented 2 years ago

aliyundrive-webdav这个是可用的,换成alist就不行了,但是其他的webdav和文件下载都不受影响

caogle commented 2 years ago

webdav方式的sharepoint用raidrive持载到win10,只能创建文件夹,无法创建文件,但是在安卓的solid explorer 上却正常

Yang-z commented 2 years ago

试了很多次,群晖 hyper backup 确实都无法备份成功。天翼云到一半总报错,百度云直接连不上去。

Imoagn commented 2 years ago

image 的确是向百度云盘上传空文件会导致失败,直接在alist网页端即可复现,百度网盘自身是可以上传空文件的,这个是否可能调整呢。 备份类的软件常常用空文件做lock @Xhofe ,谢谢

日志如下:

[GIN] 2022/10/08 - 15:02:43 | 401 | 32.84µs | 192.168.2.2 | PUT "/dav/BaiduPan/新建文本文档.txt" ERRO[2022-10-08 15:02:43] failed put /BaiduPan: errno: 2, refer to https://pan.baidu.com/union/doc/ github.com/alist-org/alist/v3/internal/op.Put /app/internal/op/fs.go:353 github.com/alist-org/alist/v3/internal/fs.putDirectly /app/internal/fs/put.go:54 github.com/alist-org/alist/v3/internal/fs.PutDirectly /app/internal/fs/fs.go:84 github.com/alist-org/alist/v3/server/webdav.(Handler).handlePut /app/server/webdav/webdav.go:303 github.com/alist-org/alist/v3/server/webdav.(Handler).ServeHTTP /app/server/webdav/webdav.go:59 github.com/alist-org/alist/v3/server.ServeWebDAV /app/server/webdav.go:44 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/alist-org/alist/v3/server.WebDAVAuth /app/server/webdav.go:93 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded /app/server/middlewares/check.go:11 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1 /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/recovery.go:101 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.LoggerWithConfig.func1 /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/logger.go:240 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.(Engine).handleHTTPRequest /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/gin.go:613 github.com/gin-gonic/gin.(Engine).ServeHTTP /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/gin.go:569 net/http.serverHandler.ServeHTTP /usr/lib/go/src/net/http/server.go:2947 net/http.(conn).serve /usr/lib/go/src/net/http/server.go:1991 runtime.goexit /usr/lib/go/src/runtime/asm_amd64.s:1594 ERRO[2022-10-08 15:02:43] PUT /dav/BaiduPan/新建文本文档.txt errno: 2, refer to https://pan.baidu.com/union/doc/ github.com/alist-org/alist/v3/internal/op.Put /app/internal/op/fs.go:353 github.com/alist-org/alist/v3/internal/fs.putDirectly /app/internal/fs/put.go:54 github.com/alist-org/alist/v3/internal/fs.PutDirectly /app/internal/fs/fs.go:84 github.com/alist-org/alist/v3/server/webdav.(Handler).handlePut /app/server/webdav/webdav.go:303 github.com/alist-org/alist/v3/server/webdav.(Handler).ServeHTTP /app/server/webdav/webdav.go:59 github.com/alist-org/alist/v3/server.ServeWebDAV /app/server/webdav.go:44 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/alist-org/alist/v3/server.WebDAVAuth /app/server/webdav.go:93 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded /app/server/middlewares/check.go:11 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1 /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/recovery.go:101 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.LoggerWithConfig.func1 /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/logger.go:240 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.(Engine).handleHTTPRequest /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/gin.go:613 github.com/gin-gonic/gin.(Engine).ServeHTTP /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/gin.go:569 net/http.serverHandler.ServeHTTP /usr/lib/go/src/net/http/server.go:2947 net/http.(conn).serve /usr/lib/go/src/net/http/server.go:1991 runtime.goexit /usr/lib/go/src/runtime/asm_amd64.s:1594

github-actions[bot] commented 2 years ago

Hello @, this issue was closed due to inactive more than 60 days. You can reopen or recreate it if you think it should continue.

kimi360 commented 2 years ago

试过修改docker的时区吗,我发现不设置时区会一直提示没有权限

designtandy commented 1 year ago

@kimi360 设置了也没用 还是一样提示没权限

xhofe commented 1 year ago

image 的确是向百度云盘上传空文件会导致失败,直接在alist网页端即可复现,百度网盘自身是可以上传空文件的,这个是否可能调整呢。 备份类的软件常常用空文件做lock @Xhofe ,谢谢

日志如下:

[GIN] 2022/10/08 - 15:02:43 | 401 | 32.84µs | 192.168.2.2 | PUT "/dav/BaiduPan/新建文本文档.txt" �[31mERRO�[0m[2022-10-08 15:02:43] failed put /BaiduPan: errno: 2, refer to https://pan.baidu.com/union/doc/ github.com/alist-org/alist/v3/internal/op.Put /app/internal/op/fs.go:353 github.com/alist-org/alist/v3/internal/fs.putDirectly /app/internal/fs/put.go:54 github.com/alist-org/alist/v3/internal/fs.PutDirectly /app/internal/fs/fs.go:84 github.com/alist-org/alist/v3/server/webdav.(Handler).handlePut /app/server/webdav/webdav.go:303 github.com/alist-org/alist/v3/server/webdav.(Handler).ServeHTTP /app/server/webdav/webdav.go:59 github.com/alist-org/alist/v3/server.ServeWebDAV /app/server/webdav.go:44 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/alist-org/alist/v3/server.WebDAVAuth /app/server/webdav.go:93 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded /app/server/middlewares/check.go:11 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1 /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/recovery.go:101 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.LoggerWithConfig.func1 /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/logger.go:240 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.(Engine).handleHTTPRequest /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/gin.go:613 github.com/gin-gonic/gin.(Engine).ServeHTTP /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/gin.go:569 net/http.serverHandler.ServeHTTP /usr/lib/go/src/net/http/server.go:2947 net/http.(conn).serve /usr/lib/go/src/net/http/server.go:1991 runtime.goexit /usr/lib/go/src/runtime/asm_amd64.s:1594 �[31mERRO�[0m[2022-10-08 15:02:43] PUT /dav/BaiduPan/新建文本文档.txt errno: 2, refer to https://pan.baidu.com/union/doc/ github.com/alist-org/alist/v3/internal/op.Put /app/internal/op/fs.go:353 github.com/alist-org/alist/v3/internal/fs.putDirectly /app/internal/fs/put.go:54 github.com/alist-org/alist/v3/internal/fs.PutDirectly /app/internal/fs/fs.go:84 github.com/alist-org/alist/v3/server/webdav.(Handler).handlePut /app/server/webdav/webdav.go:303 github.com/alist-org/alist/v3/server/webdav.(Handler).ServeHTTP /app/server/webdav/webdav.go:59 github.com/alist-org/alist/v3/server.ServeWebDAV /app/server/webdav.go:44 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/alist-org/alist/v3/server.WebDAVAuth /app/server/webdav.go:93 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded /app/server/middlewares/check.go:11 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1 /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/recovery.go:101 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.LoggerWithConfig.func1 /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/logger.go:240 github.com/gin-gonic/gin.(Context).Next /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/context.go:173 github.com/gin-gonic/gin.(Engine).handleHTTPRequest /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/gin.go:613 github.com/gin-gonic/gin.(Engine).ServeHTTP /root/go/pkg/mod/github.com/gin-gonic/gin@v1.8.0/gin.go:569 net/http.serverHandler.ServeHTTP /usr/lib/go/src/net/http/server.go:2947 net/http.(conn).serve /usr/lib/go/src/net/http/server.go:1991 runtime.goexit /usr/lib/go/src/runtime/asm_amd64.s:1594

image

Nothend commented 1 year ago

群晖的Hyper Backup 使用alist的WebDAV时,要么提示目的地权限不够,要么让重新登陆DSM。楼上几位的方法都试了一下,http或者https都是一样的情况。但是使用Cloud Sync就没有问题,很正常

lkxlzx commented 1 year ago

我的现在也是提示权限不够,有记得以前有个版本没问题

Nothend @.***> 于2023年2月19日周日 16:26写道:

群晖的Hyper Backup 使用alist的WebDAV时,要么提示目的地权限不够,要么让重新登陆DSM。楼上几位的方法都试了一下,http或者https都是一样的情况。但是使用Cloud Sync就没有问题,很正常

— Reply to this email directly, view it on GitHub https://github.com/alist-org/alist/issues/701#issuecomment-1435924474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXGJNFBUMOPIZSTTFLIY4DWYHKKLANCNFSM5QFDS3IQ . You are receiving this because you were mentioned.Message ID: @.***>

kimi360 commented 1 year ago

除了偶尔的备份失败,我这边备份到阿里云还是挺正常的,可以看我写的文章https://post.smzdm.com/p/aevklg2m/

cdpath commented 1 year ago

AList 挂载的阿里云盘的 WebDAV 策略要选择本地代理

wyizhou commented 1 year ago

AList 挂载的阿里云盘的 WebDAV 策略要选择本地代理

这个是正解

gofunbox commented 3 months ago

用夸克备份 其实文件是有上传上去的 但是一段时间就会报错 救命~~ [WebDAV][WebDAV 1] Exception occurred while backing up data. (No permission to access the backup destination [xxxx]. Please check you have the right permission to the backup destination.)

javabcde commented 2 weeks ago

用夸克备份 其实文件是有上传上去的 但是一段时间就会报错 救命~~ [WebDAV][WebDAV 1] Exception occurred while backing up data. (No permission to access the backup destination [xxxx]. Please check you have the right permission to the backup destination.)

我也是忽然报这个错误了 怎么样 你解决了吗

gofunbox commented 2 weeks ago

用夸克备份 其实文件是有上传上去的 但是一段时间就会报错 救命~~ [WebDAV][WebDAV 1] Exception occurred while backing up data. (No permission to access the backup destination [xxxx]. Please check you have the right permission to the backup destination.)

我也是忽然报这个错误了 怎么样 你解决了吗

放弃了 不稳定 永无止境的上传