-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(archive): archive manage #7817
Conversation
Front-end part AlistGo/alist-web#234 |
Cool. Just testing the latest beta, and I don't see the archive support anywhere (it will make my backup process slot better). Offline downloading only shows simple HTTP; it does not matter if it's a supported host or not. I don't see any new options to configure or change things. What am I missing? 🤔 |
Check whether there are two additional permissions in the user management. If so, you need to enable them to use this new feature. If there are no new permissions, you may have encountered the familiar issue of inconsistent front-end and back-end versions. |
After enabling the two permissions, you can see the new "Decompress" option by right-clicking the compressed file. Clicking on the compressed file will reveal the new preview method. |
Same problem, then. Hahaha. But this time those new options aren't there,
at all. Can you tell me the code for the db to have them all enabled?
El sáb., 18 de ene. de 2025 11:02 PM, KirCute_ECT ***@***.***>
escribió:
… Cool. Just testing the latest beta, and I don't see the archive support
anywhere (it will make my backup process slot better). Offline downloading
only shows simple HTTP; it does not matter if it's a supported host or not.
I don't see any new options to configure or change things. What am I
missing? 🤔
After enabling the two permissions, you can see the new "Decompress"
option by right-clicking the compressed file. Clicking on the compressed
file will reveal the new preview method.
—
Reply to this email directly, view it on GitHub
<#7817 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUE6MR7AEGLSGEKJPHCONMD2LMIVRAVCNFSM6AAAAABVDN47BSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBQGUZTEMRZGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
You can change the |
对压缩文件的在线预览/在线解压支持,在线预览需要驱动支持 range 请求。
尚未解决的问题:
mholt/archives
实现了对加密rar
和7z
的支持,但internal/archive/archives/utils.go#L28这种用法似乎是错误的。saintfish/chardet
推测文件名的编码,但对于文件名较短的情况效果不尽如人意,可能删除一些不常用的编码效果会更好。内容:
/api/public/archive_extensions
:获取后端支持的压缩文件后缀。/api/fs/archive/meta
:获取压缩文件的元信息,包括是否被加密、注释内容、和可选的完整目录结构。/api/fs/archive/list
:当/meta
没有返回完整目录结构时,用于获取压缩文件内部的目录结构。/api/fs/archive/decompress
:解压。/ad/*path?inner=<内部路径>pass=<解压密码>
:通过驱动提取压缩文件内部的一个文件。/ap/*path?inner=<内部路径>pass=<解压密码>
:通过驱动本地代理上述文件。/ae/*path?inner=<内部路径>pass=<解压密码>
:通过内部工具提取压缩文件内部的一个文件。/api/task/decompress/*
:管理下载和解压压缩文件任务。/api/task/decompress_upload/*
:管理上传解压后文件的任务。decompress
和decompress_upload
两种任务,分别用于下载待解压的压缩文件和上传解压后的内容,支持使用 HttpRange 访问压缩文件的部分内容以实现不下载压缩文件的完整内容就解压其一部分。GetArchiveMeta(ctx context.Context, obj model.Obj, args model.ArchiveArgs) (model.ArchiveMeta, error)
:获取压缩文件的元信息。ListArchive(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) ([]model.Obj, error)
:列举压缩文件内部的目录结构。Extract(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) (*model.Link, error)
:提取压缩文件内的文件。ArchiveGet(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) (model.Obj, error)
:直接获取压缩文件内的文件信息。ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, args model.ArchiveDecompressArgs) ([]model.Obj, error)
:解压。internal/archive
,用于在驱动没有实现压缩文件相关接口,或进行跨驱动解压时,使用内部工具操作压缩文件,管理工具接口:AcceptedExtensions() []string
:返回工具支持的压缩文件后缀。GetMeta(ss *stream.SeekableStream, args model.ArchiveArgs) (model.ArchiveMeta, error)
:获取元信息。List(ss *stream.SeekableStream, args model.ArchiveInnerArgs) ([]model.Obj, error)
:列举目录结构。Extract(ss *stream.SeekableStream, args model.ArchiveInnerArgs) (io.ReadCloser, int64, error)
:提取。Decompress(ss *stream.SeekableStream, outputPath string, args model.ArchiveInnerArgs, up model.UpdateProgress) error
:解压(到临时目录)。mholt/archives
:.br
,.bz2
,.gz
,.lz4
,.lz
,.sz
,.s2
,.xz
,.zz
,.zst
,.tar
,.rar
,.7z
yeka/zip
:.zip
(mholt/archives
不支持加密的.zip
,所以用了这个)kdomanski/iso9660
:.iso
stream.SStreamReadAtSeeker
用于将stream.SeekableStream
封装为io.ReaderAt
、io.Seeker
使用。stream.ReaderUpdatingProgress
用于在读取一个流的同时基于driver.UpdateProgress
(现移至model
包)提交进度。model.FileStreamer
新增CacheFullInTempFileAndUpdateProgress(up UpdateProgress)
用于在将流缓存到本地的过程中提交进度。kill
,与原stop
指令相同,stop
指令终止服务端进程的方式从发送SIGKILL
信号改为发送SIGTERM
信号。这一改动是因为decompress_upload
为了实现重试,会在失败的时候不删除本地的临时文件,直到任务本身被删除时才同时删除临时文件,为了避免服务端退出时还有剩余失败的decompress_upload
任务,需要在退出时将它们删除,这就必须保证stop
指令的效果是在cmd/server.go#L160处让程序继续执行,而不是直接杀死进程。阿里云盘Open
、又拍云存储
、本地存储
和SFTP
上测试了不缓存模式的解压,在又拍云存储
、本地存储
上通过了预览相关各项功能的测试,在百度网盘
、阿里云盘Open
上没有通过预览相关功能的测试Closes #7573
Closes #5114