Coder Social home page Coder Social logo

sigoden / dufs Goto Github PK

View Code? Open in Web Editor NEW
4.7K 35.0 230.0 618 KB

A file server that supports static serving, uploading, searching, accessing control, webdav...

License: Other

Rust 83.34% CSS 1.78% HTML 2.93% JavaScript 11.64% Dockerfile 0.16% Shell 0.15%
cloud-disk command-line file-upload-server static-server rust webdav webdav-server file-sharing

dufs's Introduction

Dufs

CI Crates Docker Pulls

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)
  • Create/Edit/Search files
  • Resumable/partial uploads/downloads
  • 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 sigoden/dufs /data -A
brew install dufs

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] [serve-path]

Arguments:
  [serve-path]  Specific path to serve [default: .]

Options:
  -c, --config <file>        Specify configuration file
  -b, --bind <addrs>         Specify bind address or unix socket
  -p, --port <port>          Specify port to listen on [default: 5000]
      --path-prefix <path>   Specify a path prefix
      --hidden <value>       Hide paths from directory listings, e.g. tmp,*.log,*.lock
  -a, --auth <rules>         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 <path>        Set the path to the assets directory for overriding the built-in assets
      --log-format <format>  Customize http log format
      --compress <level>     Set zip compress level [default: low] [possible values: none, low, medium, high]
      --completions <shell>  Print shell completion script for <shell> [possible values: bash, elvish, fish, powershell, zsh]
      --tls-cert <path>      Path to an SSL/TLS certificate to serve with HTTPS
      --tls-key <path>       Path to the SSL/TLS certificate's private key
  -h, --help                 Print help
  -V, --version              Print version

Examples

Serve current working directory in read-only mode

dufs

Allow all operations like upload/delete/search/create/edit...

dufs -A

Only allow upload operation

dufs --allow-upload

Serve a specific directory

dufs Downloads

Serve a single file

dufs linux-distro.iso

Serve a single-page application like react/vue

dufs --render-spa

Serve a static website with index.html

dufs --render-index

Require username/password

dufs -a admin:123@/:rw

Listen on specific host:ip

dufs -b 127.0.0.1 -p 80

Listen on unix socket

dufs -b /tmp/dufs.socket

Use https

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

API

Upload a file

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

Download a file

curl http://127.0.0.1:5000/path-to-file           # download the file
curl http://127.0.0.1:5000/path-to-file?hash      # retrieve the sha256 hash of the file

Download a folder as zip file

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

Delete a file/folder

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

Create a directory

curl -X MKCOL http://127.0.0.1:5000/path-to-folder

Move the file/folder to the new path

curl -X MOVE http://127.0.0.1:5000/path -H "Destination: http://127.0.0.1:5000/new-path"

List/search directory contents

curl http://127.0.0.1:5000?q=Dockerfile           # search for files, similar to `find -name Dockerfile`
curl http://127.0.0.1:5000?simple                 # output names only, similar to `ls -1`
curl http://127.0.0.1:5000?json                   # output paths in json format

With authorization (Both basic or digest auth works)

curl http://127.0.0.1:5000/file --user user:pass                 # basic auth
curl http://127.0.0.1:5000/file --user user:pass --digest        # digest auth

Resumable downloads

curl -C- -o file http://127.0.0.1:5000/file

Resumable uploads

upload_offset=$(curl -I -s http://127.0.0.1:5000/file | tr -d '\r' | sed -n 's/content-length: //p')
dd skip=$upload_offset if=file status=none ibs=1 | \
  curl -X PATCH -H "X-Update-Range: append" --data-binary @- http://127.0.0.1:5000/file

Advanced topics

Access Control

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

dufs -a admin:admin@/:rw -a guest:guest@/
dufs -a user:pass@/:rw,/dir1 -a @/
  1. Use @ to separate the account and paths. No account means anonymous user.
  2. Use : to separate the username and password of the account.
  3. Use , to separate paths.
  4. Use path suffix :rw/:ro set permissions: read-write/read-only. :ro can be omitted.
  • -a admin:admin@/:rw: admin has complete permissions for all paths.
  • -a guest:guest@/: guest has read-only permissions for all paths.
  • -a user:pass@/:rw,/dir1: user has read-write permissions for /*, has read-only permissions for /dir1/*.
  • -a @/: All paths is publicly accessible, everyone can view/download it.

There are no restrictions on using ':' and '@' characters in a password. For example, user:pa:ss@1@/:rw is valid, the password is pa:ss@1.

Hashed Password

DUFS supports the use of sha-512 hashed password.

Create hashed password

$ mkpasswd  -m sha-512 -s
Password: 123456 
$6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/

Use hashed password

dufs -a 'admin:$6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/@/:rw'

Two important things for hashed passwords:

  1. Dufs only supports sha-512 hashed passwords, so ensure that the password string always starts with $6$.
  2. Digest authentication does not function properly with hashed passwords.

Hide Paths

Dufs supports hiding paths from directory listings via option --hidden <glob>,....

dufs --hidden .git,.DS_Store,tmp

The glob used in --hidden only matches file and directory names, not paths. So --hidden dir1/file is invalid.

dufs --hidden '.*'                          # hidden dotfiles
dufs --hidden '*/'                          # hidden all folders
dufs --hidden '*.log,*.lock'                # hidden by exts
dufs --hidden '*.log' --hidden '*.lock'

Log Format

Dufs supports customize http log format with option --log-format.

The log format can use following variables.

variable description
$remote_addr client address
$remote_user user name supplied with authentication
$request full original request line
$status response status
$http_ arbitrary request header field. examples: $http_user_agent, $http_referer

The default log format is '$remote_addr "$request" $status'.

2022-08-06T06:59:31+08:00 INFO - 127.0.0.1 "GET /" 200

Disable http log

dufs --log-format=''

Log user-agent

dufs --log-format '$remote_addr "$request" $status $http_user_agent'
2022-08-06T06:53:55+08:00 INFO - 127.0.0.1 "GET /" 200 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Log remote-user

dufs --log-format '$remote_addr $remote_user "$request" $status' -a /@admin:admin -a /folder1@user1:pass1
2022-08-06T07:04:37+08:00 INFO - 127.0.0.1 admin "GET /" 200

Environment variables

All options can be set using environment variables prefixed with DUFS_.

[serve-path]                DUFS_SERVE_PATH="."
    --config <file>         DUFS_CONFIG=config.yaml
-b, --bind <addrs>          DUFS_BIND=0.0.0.0
-p, --port <port>           DUFS_PORT=5000
    --path-prefix <path>    DUFS_PATH_PREFIX=/static
    --hidden <value>        DUFS_HIDDEN=tmp,*.log,*.lock
-a, --auth <rules>          DUFS_AUTH="admin:admin@/:rw|@/" 
-A, --allow-all             DUFS_ALLOW_ALL=true
    --allow-upload          DUFS_ALLOW_UPLOAD=true
    --allow-delete          DUFS_ALLOW_DELETE=true
    --allow-search          DUFS_ALLOW_SEARCH=true
    --allow-symlink         DUFS_ALLOW_SYMLINK=true
    --allow-archive         DUFS_ALLOW_ARCHIVE=true
    --enable-cors           DUFS_ENABLE_CORS=true
    --render-index          DUFS_RENDER_INDEX=true
    --render-try-index      DUFS_RENDER_TRY_INDEX=true
    --render-spa            DUFS_RENDER_SPA=true
    --assets <path>         DUFS_ASSETS=/assets
    --log-format <format>   DUFS_LOG_FORMAT=""
    --compress <compress>   DUFS_COMPRESS="low"
    --tls-cert <path>       DUFS_TLS_CERT=cert.pem
    --tls-key <path>        DUFS_TLS_KEY=key.pem

Configuration File

You can specify and use the configuration file by selecting the option --config <path-to-config.yaml>.

The following are the configuration items:

serve-path: '.'
bind: 0.0.0.0
port: 5000
path-prefix: /dufs
hidden:
  - tmp
  - '*.log'
  - '*.lock'
auth:
  - admin:admin@/:rw
  - user:pass@/src:rw,/share
  - '@/'  # According to the YAML spec, quoting is required.
allow-all: false
allow-upload: true
allow-delete: true
allow-search: true
allow-symlink: true
allow-archive: true
enable-cors: true
render-index: true
render-try-index: true
render-spa: true
assets: ./assets/
log-format: '$remote_addr "$request" $status $http_user_agent'
compress: low
tls-cert: tests/data/cert.pem
tls-key: tests/data/key_pkcs1.pem

Customize UI

Dufs allows users to customize the UI with your own assets.

dufs --assets my-assets-dir/

Your assets folder must contains a index.html file.

index.html can use the following placeholder variables to retrieve internal data.

  • __INDEX_DATA__: directory listing data
  • __ASSETS_PREFIX__: assets url prefix

License

Copyright (c) 2022-2024 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.

dufs's People

Contributors

aneeshusa avatar davidpolitis avatar elmtran avatar figsoda avatar horizon0514 avatar jessehu avatar jkoop avatar kianmeng avatar lqs avatar moonfruit avatar muxiu1997 avatar nq5 avatar plantatorbob avatar ragebflame avatar ryanrussell avatar sigoden avatar sprat avatar tieway59 avatar tinytinni avatar tobyp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dufs's Issues

[Suggestion] Add icon

Duf does not have an icon, a logo, a favicon in the browser. It would be interesting to add one.

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.

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?

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 里面访问。

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

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

Generate completion file

Specific Demand

dufs has almost 20 options, it is necessary to generate completion files.

Implement Suggestion

We will use clap_complete crate to generate completion scripts.

A new option --completions will be added.

auth timeout question

Hi sigoden,

I'm wondering if there is a time limit for the auth.

Cuz sometimes after several minutes, the auth dialog pops up again. The duration is not quite sure, so that's why I inquire.

And due to the circumstances above, When I upload a large number of files, the latter parts may fail. After the failure shows up, I refresh the page, and the auth dialog pops up, so I guess losing the auth session caused that, maybe.

Please share your opinion on this, Thanks.

Limit the number of concurrent uploads

Specific Demand

Why limit number of concurrent uploads?

  1. allow some uploads to finish faster
  2. chrome seems to allow 6 concurrent uploads
  3. reduce the probability of upload failure in poor network connectivity

Maybe we should limit the number of concurrent uploads to 3.

retry when upload fail

while uploading a whole folder, some files may fail.
image
Maybe a retry button could be helpful, or auto retry could be better.

Search sometimes results in "fatal runtime error"

Problem

With some search terms I run into the following error:

$ dufs --allow-search -p 8080 -b 192.168.0.1
Listening on:
  http://192.168.0.1:8080/

2022-07-02T14:53:42+02:00 INFO - 192.168.0.113 "GET /" - 200

thread 'tokio-runtime-worker' has overflowed its stack
fatal runtime error: stack overflow
Aborted
$

I don't see why this happens: some search terms don't work even though they yield fewer results than others that do work.

Whatever the cause might be, I think dufs should try to return an error page with (maybe with HTTP 500 or 503) instead of terminating completely. I'd rather not start dufs in a while (true) loop. 😉

Log

See above.

Environment:

  • Dufs version: 0.23.1
  • Browser/Webdav Info: Chrome/101.0.4951.67
  • OS Info: Win10 21H2

[Feature request] File encryption

Hello,
Thanks for this amazing work.
It would be nice to have an option to encrypt files in place providing a key as argument.
That should be probably achievable with something like described here : https://kerkour.com/rust-file-encryption, apart from the tricky part of working out the real file size from the encrypted file size... and to store a generated per file nonce as an encrypted file header, so that the nonce is not the same for each file, but recoverable from the file itself...
Best regards.

Not Found when file name contains HTML escape code

Steps to reproduce

  1. Create a file whose name contains an HTML escape code:
    echo hello > 'abc&amp;def.txt'
  2. Run dufs to serve the folder that contains the created file.
  3. Open https://localhost:5000/ in Google Chrome.
  4. The file with name abc&amp;def.txt is nowhere to be found. Instead, there is abc&def.txt. Click the file.

Expected behavior

  • After step 3, the file with name abc&amp;def.txt should appear.
  • After clicking abc&amp;def.txt, the text hello should appear.

Actual behavior

  • The file with the correct name does not appear.
  • The file with the incorrect predictably leads to Not Found.

Notes

Using Nautilus to access the file via WebDAV (dav://localhost:5000/) works fine.

Additional suggestions

This flaw is probably caused by text being inserted directly to the constructed HTML page without escape, sanitization, or any form of text processing. This is dangerous as it could lead to some form of code injection attack. I am not just referring to this one bug, I am referring to other potential bugs that are similar to this.

Request:

  • Examine the whole codebase to find similar bugs.
  • Use a proven library/framework to generate the directory page instead of doing it manually. For example, miniserve (a similar program to dufs) uses maud to generate its directory page.

Support move file

Specific Demand

I use dufs to manage my auto downloads folder, I need to arrange the files from the default download folder when downloaded, so if there is a move action, allow me moving file from one path to another path.

Implement Suggestion

maybe offer a move action, and allow to choose target folder

Can I hidden all hidden files?

Specific Demand

Can I hidden all hidden files?

Implement Suggestion

--hidden .* or other option
If you have any suggestion for complete this feature, you can tell us.
I want to hidden all hidden files, but not I can only hidden them by names.

[Feature Request] enhance --render-index functionality

First of all, this is a very cool tool, so thank you for the development efforts. The addition of the --render-index argument is great. This might not be a common use case, but I've got a file server that is probably 50/50 split, where half of the directories contain an index.html and half do not. Currently, when I set that flag, any directory that doesn't have an index.html file just renders a blank page (404 from the server, since the file wasn't found).

Is there any way to make that argument kick in when there is a index.html file present, but fall back to the default rendering of a directory if not? Would be a very nice enhancement.

suggestion: support SPA fallback in duf

It can be very useful to setup a simple server for SPA (Single Page Application)

  1. similar to "--spa" switch in miniserve
  2. try_files in Nginx
location / {
    root .../dist
    index ...index.html
    try_files $uri $uri/ /index.html;
}

Render index.html

It would be great if there was an option like miniserve's:

--index <index_file>
The name of a directory index file to serve, like "index.html"

CORS needs 'Access-Control-Allow-Methods' header

Problem
Im trying to upload files to a Dufs server from an other server over http.
For this I run the Dufs server with this command, to anable CORS: dufs -A --enable-cors
But the PUT Request I send to the Server is blocked with the following error message:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at xxx. (Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’).

After looking in to the server.rs I found that in the add_cors function only the AccessControlAllowOrigin, AccessControlAllowCredentials and AccessControlAllowHeaders headers are set. However WebDav needs the PUT method and therefor the AccessControlAllowMethods header is needed.

Environment:

  • Dufs version: 0.25.0
  • Browser/Webdav Info: Firefox Version 102.0.1
  • OS Info: Windows 11

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

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

[Suggestion] Web static directory support

I tried to write a web page suitable for "duf" by myself. The main layout was referenced from h5ai, and it was packaged with Webpack, but the packaged pictures were scattered. Can Web Static Directory Support be Added? When the browser requests any file, it requests the files in the "assets" directory.

qnap挂载webdav问题(小众)

Problem
./dufs --enable-cors -a /temp@admin:admin@* -a /@admin:admin -A -- folder
比较奇怪的问题, 账号权限都对, 在威联通挂载根目录 http://aa.com:5000/ 不行, 但是 http://aa.com:5000/temp 就可以

可能是qnap比较特殊,因为手机mixplorer就没问题. 问题比较小众, 只是想挂载为目录用, 对大部分不影响

Log

2022-07-11T08:12:57Z INFO - 18ip9 "PROPFIND /" - 401
2022-07-11T08:13:11Z INFO - 18ip9 "PROPFIND /temp" - 207

Environment:

  • Dufs version: 0.26
  • Browser/Webdav Info: qnap
  • OS Info: qnap

单个文件不能共享,能否解决一下 谢谢

duf.exe -p 9999 -- "Q:\ONEDRIVE\5T\OneDrive - automation\plc\松下a4a5接线.xlsx"
duf.exe -p 9999 -- Q:\ONEDRIVE\15G\OneDrive\USB设备共享\网盘\miniserver\CMD.bat

单个文件不能共享,能否解决一下 谢谢

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

直接在chrome上浏览文本文件,中文显示乱码

Problem

  • 创建F:\测试文件.txt,并往里面填入中文,保存为utf8格式
  • win10的cmd运行:.\dufs.exe -p 80 F:\测试文件.txt
  • Chrome的地址栏输入:127.0.0.1即可显示测试文件.txt的内容,但是中文部分是乱码。

乱码如下截图
image

测试文件.txt文件内容为:

中文字体
english

如果将测试文件.txt另存为带有BOM的UTF-8,则Chrome上显示正常。

Environment:

  • Dufs version: 0.26.0
  • Browser/Webdav Info: Chrome 103.0.5060.114
  • OS Info: Windows 10

日志时间

日志时间为世界时间,能不能启用北京时间啊,哪怕给个参数也可以

suggestion: webdav support

It doesn't need to be fancy, just respond correctly to OPTIONS and PROPFIND for readonly support. Although, of couse, full support would be nice.

image

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.

safari not show layout correctly

Problem

The Safari browser seems to not show the layout correctly (both macOS and iOS Safari). The spacing between two lines is too big and the "Actions" logo is not aligned either.
Here is Safari:
image
Here is the normal Chrome:
image

Environment:

  • Dufs version: 0.23.0
  • Browser/Webdav Info: Safari 15.5 (17613.2.7.1.8)
  • OS Info: macOS 12.4

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.

bug: filenames aren't properly escaped in WebDAV PROPFIND

To reproduce the issue, create a folder with a file called This & that. Try to mount the folder via WebDAV. See it fail (possibly with an XML parse error).

Excerpts from the PROPFIND response from duf and apache2:

<!-- duf -->
<D:href>/path/to/This & that</D:href>
<D:displayname>This & that</D:displayname>
<!-- apache2 -->
<D:href>/path/to/This%20&amp;%20that</D:href>

Search not working with `--render-try-index`

First of all: thanks for this amazing little tool. I just discovered it a few minutes ago, but I already fell in love with it. Small, standalone, feature-rich aaaaand, at last, a file server with an easy upload function! Ticking all the right boxes for me! 👍

Now for the small problem I have...


Problem

I ran dufs with the following parameters:

$ dufs -A -p 8080 --render-try-index

Unfortunately, the search didn't work: whatever search term I entered, it would always just show the current directory's index. Also, it didn't matter if the search result would be within the current folder or in some directories below it.

Out of curiosity, I tried without --render-try-index and now the search function does work as expected (even recursively as I had hoped 🤓 ).

It would be great if we could use --render-try-index together with --allow-search. Index pages would take precedence and would deny any further processing of URL query parameters, such as ?q=.... But if no index file is found, the search should just work as if the --render-try-index option had not been set.

Log

N/A

Environment:

  • Dufs version: 0.23.1
  • Browser/Webdav Info: Chrome/101.0.4951.67
  • OS Info: Win10 21H2

使用idm+工具下载进度卡在99%

  • 版本:0.16和0.17
  • 操作系统:windows10
  • 下载文件:视频文件(mkv和mp4都有出现)
  • 现象:使用多线程下载,进度卡在99%,对比文件大小缺失3个字节。服务端这边一直重复打印

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.