Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav...

Overview

Dufs (Old Name: Duf)

CI Crates

Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav...

demo

Features

  • Serve static files
  • Download folder as zip file
  • Upload files and folders (Drag & Drop)
  • Search files
  • Partial responses (Parallel/Resume download)
  • Path level access control
  • Support https
  • Support webdav
  • Easy to use with curl

Install

With cargo

cargo install dufs

With docker

docker run -v `pwd`:/data -p 5000:5000 --rm -it sigoden/dufs /data

Binaries on macOS, Linux, Windows

Download from Github Releases, unzip and add dufs to your $PATH.

CLI

Dufs is a distinctive utility file server - https://github.com/sigoden/dufs

USAGE:
    dufs [OPTIONS] [--] [path]

ARGS:
        Specific path to serve [default: .]

OPTIONS:
    -b, --bind ...         Specify bind address
    -p, --port             Specify port to listen on [default: 5000]
        --path-prefix      Specify an path prefix
    -a, --auth ...         Add auth for path
        --auth-method     Select auth method [default: digest] [possible values: basic, digest]
    -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
        --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 file listing if not found index.html
        --render-spa             Serve SPA(Single Page Application)
        --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 information
    -V, --version                Print version information

Examples

Serve current working directory

dufs

Explicitly allow all operations including upload/delete

dufs -A

Only allow upload operation

dufs --allow-upload

Serve a directory

dufs Downloads

Serve a single file

dufs linux-distro.iso

Serve index.html when requesting a directory

dufs --render-index

Serve SPA(Single Page Application)

dufs --render-spa

Require username/password

dufs -a /@admin:123

Listen on a specific port

dufs -p 80

Use https

dufs --tls-cert my.crt --tls-key my.key

API

Download a file

curl http://127.0.0.1:5000/path-to-file

Download a folder as zip file

curl -o path-to-folder.zip http://127.0.0.1:5000/path-to-folder?zip

Upload a file

curl --upload-file path-to-file http://127.0.0.1:5000/path-to-file

Delete a file/folder

curl -X DELETE http://127.0.0.1:5000/path-to-file

Access Control

Dufs supports path level access control. You can control who can do what on which path with --auth/-a.

dufs -a @[@]
  • : Path to protected
  • : Account with readwrite permission, required
  • : Account with readonly permission, optional

can be * means is public, everyone can access/download it.

For example:

dufs -a /@admin:pass@* -a /ui@designer:pass1 -A
  • All files/folders are public to access/download.
  • Account admin:pass can upload/delete/download any files/folders.
  • Account designer:pass1 can upload/delete/download any files/folders in the ui folder.

License

Copyright (c) 2022 dufs-developers.

dufs is made available under the terms of either the MIT License or the Apache License 2.0, at your option.

See the LICENSE-APACHE and LICENSE-MIT files for license details.

Comments
  • corrupted files in zipped files

    corrupted files in zipped files

    I'm experiencing issues when extracting files form an zip-archive. Downloading the individual .jpg files works fine, but they become corrupted during the zipping process and/or download.

    Version: 0.22.0 OS: Ubuntu 18.04 Browser: FF 99.0

    opened by juliangaal 14
  • Full webdav support

    Full webdav support

    Specific Demand

    It would seem that running the litmus test suite (https://github.com/tolsen/litmus / http://webdav.org/neon/litmus/) gives only a very partial webdav support (a lot of errors with copy and move, notably non support of directories, etc.).

    It seems that the partial support causes problems when for example copying from command line in linux on a mounted (with gnome file manager) dav : the copy is stuck...

    Implement Suggestion

    It would be nice that the webdav server complies with (at least), the "http basic copymove locks props" tests of the litmus test suite.

    Best regards.

    opened by nicolaspernoud 8
  • webdav 无法在 Koreader 里面打开

    webdav 无法在 Koreader 里面打开

    您好,我最近发现这个项目挺高兴的,下载了可执行文件后,就可以在我的电脑上开启 web 服务,将里面的文件分享出来。

    然后我平时有一个需求,就是使用开源的阅读器 https://github.com/koreader/koreader 来阅读。这个软件有手机版本,也有 kindle 版本,所以我平时使用频率挺高的。

    里面有一个云存储的功能,可以添加 webdav 地址,这样就可以在手机或者 kindle,直接下载 webdav 服务器里面的书籍了。但是我发现在软件里,无法访问 dufs 开启的 webdav 服务。

    如果我不设置密码,使用手机访问,电脑终端这边会显示

    2022-06-24T13:46:55+08:00 INFO - 192.168.68.211 "PROPFIND //" - 404
    

    如果我添加账号密码,则会显示这样

    $dufs --allow-upload -a /@admin:123
    Listening on:
      http://127.0.0.1:5000/
      http://192.168.68.4:5000/
      http://[::1]:5000/
    
    2022-06-24T13:58:00+08:00 INFO - ::1 "GET /" - 401
    2022-06-24T13:58:06+08:00 INFO - ::1 "GET /" - 200
    2022-06-24T13:58:23+08:00 INFO - 192.168.68.211 "PROPFIND //" - 401
    2022-06-24T14:00:14+08:00 INFO - 192.168.68.211 "PROPFIND //" - 401
    

    我使用过另外一个 webdav 应用 https://github.com/hacdias/webdav 这个可以在 Koreader 里面访问。

    不知道问题出现在哪,期待大佬的解答。

    opened by powersee 8
  • symbolic links to external drives are not listed

    symbolic links to external drives are not listed

    Problem

    as the title suggests, symbolic links linked to external disks are not listed.

    Environment:

    • Dufs version: 0.26.0
    • Browser/Webdav Info: brave on android and librewolf on linux
    • OS Info: Arch Linux
    opened by notjedi 7
  • Rename duf to dufs

    Rename duf to dufs

    There's another tool also called duf whose command is also duf.

    Various Linux distributions (Arch Linux, Debian, Nix, etc) already provide a package named duf that provides the other duf.

    Proposal: Rename this tool to allow users to use it without name/file conflict.

    opened by KSXGitHub 7
  • Cannot handle shortcuts in windows very well

    Cannot handle shortcuts in windows very well

    Just tried shortcuts in Windows and I suppose it cannot deal with symbol link very well in Linux or Mac.

    Error Message: Internal Server Error ENV: Firefox Windows

    image

    help wanted 
    opened by piaoger 7
  • create/delete folder

    create/delete folder

    Hi sigoden, thanks for your development, this tool helps me a lot. Just love it.

    Sometimes, when I upload new files and want to classify them from previous ones, I will create a folder and put them is there. Since dufs does not support creating new folder on web UI, I have to go to the terminal and run mkdir command. So if create/delete folder is supported on web UI, it will be very helpful.

    Hope to hear your opinion. Thanks in advance.

    opened by leolulu 6
  • cannot bind address 0.0.0.0

    cannot bind address 0.0.0.0

    I cannot bind address 0.0.0.0, as a result, i cannot use the public IP to access the file server. I found out the source code of args.rs just filter out the address, why?

    opened by changcui 5
  • bug反馈,当分享目标是单个文件的时候,--path-prefix参数失去作用

    bug反馈,当分享目标是单个文件的时候,--path-prefix参数失去作用

    bug反馈,当分享目标是单个文件的时候,--path-prefix参数失去作用。 举例说明:dufs.exe -p 80 --path-prefix 001 f:\dir123\123.mp4 此时http://127.0.0.1:80/001/ 和 http://127.0.0.1:80/ 均可访问到123.mp4文件

    若分享目标是文件夹的时候,一切正常。

    另,建议提供--random-route参数,随机生成字符串

    opened by vip123456789 4
  • Docker pull 镜像出现 500 网络错误

    Docker pull 镜像出现 500 网络错误

    (base) [root@tx_01 ~]# docker pull sigoden/dufs
    Using default tag: latest
    latest: Pulling from sigoden/dufs
    5d874ac73acd: Pulling fs layer 
    error pulling image configuration: received unexpected HTTP status: 500 Internal Server Error
    

    分别在阿里和腾讯以及本地服务器都尝试进行镜像下拉,全部报这个错误。

    opened by howie6879 4
  • The dufs docker image does not terminate properly

    The dufs docker image does not terminate properly

    Problem

    The dufs docker image does not terminate properly: the dufs server seems to shutdown only with the Ctrl+C (SIGINT) signal, but docker send a SIGTERM signal to stop the process by default. Since the process does not shut down, docker send a SIGKILL signal after 10s which stops the process without any cleanup.

    Either dufs should react to the SIGTERM signal, or the dufs docker image should specify a SIGINT signal as stop signal (via the STOPSIGNAL directive in the Dockerfile).

    Log

    When I stop the container, it takes 10s to shutdown instead of shutting down immediately.

    Environment:

    • Dufs version: 0.31.0
    • Browser/Webdav Info: NA
    • OS Info: docker image on amd64 host
    opened by sprat 3
  • Support webdav, what does that mean?

    Support webdav, what does that mean?

    Problem I have a WebDAV server using Rclone which works great. Is Dufs able to forward/proxy that internal WebDAV proxy?

    Or is Dufs just a server for external applications?

    opened by FunDeckHermit 0
  • Ability to hide all directories, but not files

    Ability to hide all directories, but not files

    Specific Demand

    Currently, we are able to hide all files by simply passing * to --hidden, but there is no way to distinguish between files and directories and more complex globbing patterns don't seem to be working (such as */). I'd like to have a setup where all the directories are hidden, but once an user has the link to a directory, then he can see all files inside it. Now, this is achievable by just listing out all directories as an input to --hidden, but such configuration would have to get updated each time a new directory is added.

    Implement Suggestion

    I think the best way to have this implemented would be to have support for globbing patterns such as */. Another approach would be to add 2 new commands --hidden-files and --hidden-dirs where --hidden would be a combination of these two. I'm not sure if I like that personally, but that's definitely an option.

    opened by Jlll1 0
  • Clearing the search input doesn't clear the query

    Clearing the search input doesn't clear the query

    Problem If I enter anything into the search box, it is impossible to clear the search box afterwards. Repro:

    1. Open dufs
    2. Enter anything into the search box
    3. Press enter
    4. Delete everything from the search box
    5. You'll get a dialog: Please fill out this field and the query won't be cleared

    This means that once you enter a query, it's impossible to clear it and see all results. Expected behavior: After I press enter when the search box is empty, the query is cleared.

    Environment:

    • Dufs version: v0.31.0
    • Browser/Webdav Info: Firefox 107.0.1
    • OS Info: Artix Linux
    opened by Jlll1 0
  • Use environment variables for configuration

    Use environment variables for configuration

    Specific Demand

    If I wish to run it in Docker or Kubernetes, it would be nice to use env vars or a config file to configure the features

    Implement Suggestion

    Parse env vars with names like DUFS_FEATURE_WITH_DASH_REPLACED_WITH_UNDERSCORES like DUFS_ALLOW_ALL=true or DUFS_AUTH_METHOD=digest and possibly support also a config file, with the cli flags in lowercase and with dash replaced by underscores, YAML or INI format. In this case it would be nice to have a CLI flag like --config <configfile> and an env var like DUFS_CONFIGFILE=<configfile> and, maybe, a default path like ./config.yaml

    opened by akelge 0
  • suggestion for Debian 11 Systemd Service

    suggestion for Debian 11 Systemd Service

    Tested for debian 11

    Please loggin as root

    1.Create folder for www datas

    mkdir -p /www_dufs

    2.Create folder for certs

    mkdir -p /www_dufs_certsOnly

    3.Write a starup script

    echo "dufs /www_dufs/ --bind 0.0.0.0 --port 443 --allow-search --enable-cors --tls-key /www_dufs_certsOnly/xx.key --tls-cert /www_dufs_certsOnly/xx.cert >> /var/log/dufs.log" > /startDufs.sh chmod ugo+rwx /startDufs.sh

    4.Write systemd service

    tee /etc/systemd/system/dufs.service <<-"EOF" [Unit] Description=dufs After=network.target auditd.service

    [Service] ExecStart=sh /startDufs.sh

    [Install] WantedBy=multi-user.target EOF

    chmod ugo+wrx /etc/systemd/system/dufs.service systemctl daemon-reload systemctl enable dufs.service

    5.reboot, then dufs service will auto startup on boot.

    shutdown -r now

    6.Check log:

    tail -f /var/log/dufs.log

    7.Alive check:

    netstat -nlap | grep "LISTEN" | grep ":443"

    8.Control Dufs Service:

    systemctl status dufs systemctl start dufs systemctl restart dufs

    opened by laminux29 0
  • Some suggestions for log in option.

    Some suggestions for log in option.

    Suggestion:

    1. Add a user login button if no one log in.

    2.Add a logout button if someone logged in.

    3.Add a Label that displays the userName. Display Guest if no log in.

    opened by laminux29 0
Releases(v0.31.0)
Owner
null
Serve-live: static directory server with change notification

Serve a directory of static files, with server-sent events for automatic refresh.

Jim Blandy 3 Dec 15, 2022
Simple utility to backup/sync data between devices to the cloud

RSink Simple utility to backup/sync data between devices to the cloud Features ?? Blazingly Fast ⛽ Lightweight ?? Cross-platform, runs everywhere ?? S

Abdulrahman Salah 4 Sep 3, 2022
Temporary file library for rust

tempfile A secure, cross-platform, temporary file library for Rust. In addition to creating temporary files, this library also allows users to securel

Steven Allen 782 Dec 27, 2022
Zero-details, privacy-focused in-app file system.

ZboxFS ZboxFS is a zero-details, privacy-focused in-app file system. Its goal is to help application store files securely, privately and reliably. By

Zbox 1.4k Jan 2, 2023
the file filesystem: mount semi-structured data (like JSON) as a Unix filesystem

ffs: the file filesystem ffs, the file filessytem, let's you mount semi-structured data as a fileystem---a tree structure you already know how to work

Michael Greenberg 176 Dec 31, 2022
⚡ Garry's Mod module that boosts performance by moving -condebug file I/O to a separate thread

This is a Garry's Mod server module that moves -condebug file I/O out of the main thread, which should significantly improve performance for noisy servers.

William 32 Dec 28, 2022
fftp is the "Fast File Transport Protocol". It transfers files quickly between computers on a network with low overhead.

fftp fftp is the "Fast File Transport Protocol". It transfers files quickly between computers on a network with low overhead. Motivation FTP uses two

leo 4 May 12, 2022
rswatch 🔎 is simple, efficient and reliable file watcher.

rswatch File watcher rswatch is a simple, reliable and efficient file watcher, it can watch a single file or a directory and run arbitrary commands wh

Eugene 3 Sep 23, 2022
Open your operating system's file browser from Garry's Mod.

Open your operating system's file browser from Garry's Mod.

Earu 5 Apr 13, 2022
Rustronomy-fits - a Rustronomy tool for FITS file I/O

Rustronomy-fits - a Rustronomy tool for FITS file I/O Rustronomy-fits provides I/O tools for reading, writing and parsing FITS files. It is currently

Raúl 3 Dec 8, 2022
Minty is an amazingly fast file deduplication app built in rust with a rust user interface.

minty Project Minty has a new look and feel!!! Minty is an amazingly fast file deduplication app built in rust with a rust user interface. I say super

null 26 Nov 20, 2022
Spacedrive is an open source cross-platform file explorer, powered by a virtual distributed filesystem written in Rust.

Spacedrive A file explorer from the future. spacedrive.com » Download for macOS · Windows · Linux · iOS · watchOS · Android ~ Links will be added once

Spacedrive 16.2k Jan 7, 2023
Cobra is a HITMAN™: Absolution server replacement.

Cobra Cobra is a HITMAN: Absolution server replacement developed by The Peacock Project. It restores all online functionality to the game. This projec

The Peacock Project 2 Jul 13, 2023
A file server that supports static serving, uploading, searching, accessing control, webdav...

Dufs Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav... Features Serve static

null 3.6k Oct 30, 2023
Dav-server-rs - Rust WebDAV server library. A fork of the webdav-handler crate.

dav-server-rs A fork of the webdav-handler-rs project. Generic async HTTP/Webdav handler Webdav (RFC4918) is defined as HTTP (GET/HEAD/PUT/DELETE) plu

messense 30 Dec 29, 2022
Crates Registry is a tool for serving and publishing crates and serving rustup installation in offline networks.

Crates Registry Description Crates Registry is a tool for serving and publishing crates and serving rustup installation in offline networks. (like Ver

TalYRoni 5 Jul 6, 2023
🐱‍👤 Cross-language static library for accessing the Lua state in Garry's Mod server plugins

gmserverplugin This is a utility library for making Server Plugins that access the Lua state in Garry's Mod. Currently, accessing the Lua state from a

William 5 Feb 7, 2022
Hot reload static web server for deploying mutiple static web site with version control.

SPA-SERVER It is to provide a static web http server with cache and hot reload. 中文 README Feature Built with Hyper and Warp, fast and small! SSL with

null 7 Dec 18, 2022
Searchbuddy is a browser extension that lets you chat with people that are searching for what you're searching for.

searchbuddy Make friends while searching! Searchbuddy is a browser extension that lets you chat with people that are searching for what you're searchi

Joseph Gerber 14 May 23, 2022
Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries. Supports openssl and diesel crates.

rust-musl-builder: Docker container for easily building static Rust binaries Source on GitHub Changelog UPDATED: Major updates in this release which m

Eric Kidd 1.3k Jan 1, 2023