轻量文件服务器 Dufs ,NAS 部署攻略!

2025-08-26 16:09:38 2点赞 16收藏 2评论

Dufs:

一个功能丰富的实用文件服务器,支持静态文件服务、上传、搜索、访问控制、WebDAV 等多种功能。

轻量文件服务器 Dufs ,NAS 部署攻略!

核心功能:

  • 提供静态文件服务

  • 支持将文件夹打包为 zip 文件下载

  • 允许文件和文件夹上传(支持拖放操作)

  • 支持文件创建、编辑和搜索

  • 支持可恢复的上传和下载

  • 具备访问控制功能

  • 支持 HTTPS 协议

  • 兼容 WebDAV 协议

  • 易于通过 curl 工具使用

安装

Docker Compose

services: dufs: image: sigoden/dufs:latest container_name: dufs command: /data -A ports: - 5000:5000 volumes: - /vol1/1000/docker/dufs/dufs/data:/data restart: always

参数说明(更多参数建议去看文档)

/data -A(命令):允许 data 目录所有操作

使用

浏览器中输入 http://NAS的IP:5000 就能看到界面

轻量文件服务器 Dufs ,NAS 部署攻略!

TIP:还有比较多高级功能使用没说到,可以自行查看文档

https://github.com/sigoden/dufs

Dufs is a distinctive utility file server - https://github.com/sigoden/dufs Usage: dufs [OPTIONS] [serve-path] Arguments: [serve-path] Specific path to serve [default: .] Options: -c, --config Specify configuration file -b, --bind Specify bind address or unix socket -p, --port Specify port to listen on [default: 5000] --path-prefix Specify a path prefix --hidden Hide paths from directory listings, e.g. tmp,*.log,*.lock -a, --auth Add auth roles, e.g. user:pass@/dir1:rw,/dir2 -A, --allow-all Allow all operations --allow-upload Allow upload files/folders --allow-delete Allow delete files/folders --allow-search Allow search files/folders --allow-symlink Allow symlink to files/folders outside root directory --allow-archive Allow zip archive generation --enable-cors Enable CORS, sets `Access-Control-Allow-Origin: *` --render-index Serve index.html when requesting a directory, returns 404 if not found index.html --render-try-index Serve index.html when requesting a directory, returns directory listing if not found index.html --render-spa Serve SPA(Single Page Application) --assets Set the path to the assets directory for overriding the built-in assets --log-format Customize http log format --log-file Specify the file to save logs to, other than stdout/stderr --compress Set zip compress level [default: low] [possible values: none, low, medium, high] --completions Print shell completion script for [possible values: bash, elvish, fish, powershell, zsh] --tls-cert Path to an SSL/TLS certificate to serve with HTTPS --tls-key Path to the SSL/TLS certificate's private key -h, --help Print help -V, --version Print version

简单功能

界面功能还是非常简单,从左到右分别是:下载,上传,创建文件夹,创建文件和搜索

轻量文件服务器 Dufs ,NAS 部署攻略!

上传文件会显示进度,完成后需要手动刷新才能进行更多操作

轻量文件服务器 Dufs ,NAS 部署攻略!

NAS 端对应的文件夹,也能看到上传的文件

轻量文件服务器 Dufs ,NAS 部署攻略!

可以对文件进行:下载,移动,删除和编辑

轻量文件服务器 Dufs ,NAS 部署攻略!

图片可以作为图床使用(根据文件夹目录结构存放的)

轻量文件服务器 Dufs ,NAS 部署攻略!

常见的 TXT 文本也可以在线查看

轻量文件服务器 Dufs ,NAS 部署攻略!

Webdav

自带 Webdav 功能,可以直接进行挂载到本地

轻量文件服务器 Dufs ,NAS 部署攻略!

TIP:有时候可能提示无效(应该是不太稳定),可以用 RaiDrive 进行挂载

轻量文件服务器 Dufs ,NAS 部署攻略!

挂载到电脑以后,可以直接进行操作

轻量文件服务器 Dufs ,NAS 部署攻略!

设置账号

修改“命令”参数

/data -a user:pass@/:rw

设置完成,刷新页面就显示要账号和密码才能访问

轻量文件服务器 Dufs ,NAS 部署攻略!

总结

Dufs 的 UI 界面较为简陋,但对于有能力的用户而言,完全可以自行重写界面。它提供的功能十分实用,且对性能要求不高,即便在配置较弱的小型服务器上也能流畅运行,非常适合作为简单的文件管理器使用。此外,映射路径的文件与网页端显示保持一致,不会打乱原有的文件结构。

综合推荐:⭐⭐⭐(适合作为小型文件服务器)

使用体验:⭐⭐⭐(界面简陋,功能实用)

部署难易:⭐⭐(简单)︎

作者声明本文无利益相关,欢迎值友理性交流,和谐讨论~

展开 收起
2评论

  • 精彩
  • 最新
  • 这个真的好用,docker 占用只有几百 Kb 内存!该有的功能都有了,打开速度极快。最适合的就是配合各种脚本、定时任务、工作流程序等使用。

    校验提示文案

    提交
  • 怒抢群晖端口

    校验提示文案

    提交
提示信息

取消
确认
评论举报

相关文章推荐

更多精彩文章
更多精彩文章
最新文章 热门文章
16
扫一下,分享更方便,购买更轻松