Recommended File Sharing Software: Dufs
File sharing is a common need, such as downloading files from a computer via a home router, accessing a directory on a computer via a mobile phone, or sharing a large file with colleagues on the design team within a local area network. In these situations, starting a file sharing service with a single command is a simple solution. dufs is a small and beautiful software that does just that.
There are many similar software programs, but I like this one the most. Python 2's python -m SimpleHTTPServer
and Python 3's python3 -m http.server
also have their advantages. After all, most Linux systems come with them, making them very useful in terminal emergencies. However, their disadvantages are limited functionality, low performance, and support for file uploads. dufs provides static file services, supporting file uploads, searching, permission control, directory package downloads, and even WebDAV support.
If you've ever used Nginx to set up a static file server, you'll understand how crucial these features are. I have to say, the author understands users. If uploads aren't supported, file content sources are limited; search isn't available, making file retrieval a hassle when the file count increases; and without permission control, bad actors can secretly download sensitive files from your disk. Downloading directories automatically creates a zip archive when saving as a file—a thoughtful touch. WebDAV and Joplin also work well together. If the default web UI isn't pretty, you can customize it. The author is a real expert!
Back to the topic: Installation and usage steps are as follows:
1. Installation
Install directly with cargo from Rust:
1cargo install dufs
For other operating systems, you can download the installation package directly from the official release page.
2. Example
- Read-only mode
1dufs
- Full-featured mode
1dufs -A
- Upload only
1dufs --allow-upload
- Specify a directory
1dufs Downloads
- Single-file mode
1dufs linux-distro.iso
- Single-page application mode, similar to react/vue
1dufs --render-spa
- Static site, index file is index.html
1dufs --render-index
- Enable permissions
1dufs -a /@admin:123
- Specify an IP and port
1dufs -b 127.0.0.1 -p 80
- Listen on a Unix socket. This feature is available.
1dufs -b /tmp/dufs.socket
- Enable HTTPS
1dufs --tls-cert my.crt --tls-key my.key
For more advanced examples, see the official documentation.
You can also view the help directly
1➜ ~dufs --help
2Dufs is a distinctive utility file server - https://github.com/sigoden/dufs
3
4Usage: dufs [OPTIONS] [serve_path]
5
6Arguments:
7[serve_path] Specific path to serve [default: .]
8
9Options:
10-b, --bind <addrs> Specify bind address or unix socket
11-p, --port <port> Specify port to listen on [default: 5000]
12--path-prefix <path> Specify a path prefix
13--hidden <value> Hide paths from directory listings, separated by `,`
14-a, --auth <rules> Add auth role
15--auth-method <value> Select auth method [default: digest] [possible values: basic, digest]
16-A, --allow-all Allow all operations
17--allow-upload Allow upload files/folders
18--allow-delete Allow delete files/folders
19--allow-search Allow search files/folders
20--allow-symlink Allow symlink to files/folders outside root directory
21--allow-archive Allow zip archive generation
22--enable-cors Enable CORS, sets `Access-Control-Allow-Origin: *`
23--render-index Serve index.html when requesting a directory, returns 404 if not found index.html
24--render-try-index Serve index.html when requesting a directory, returns directory listing if not found index.html
25--render-spa Serve SPA(Single Page Application)
26--assets <path> Use custom assets to override builtin assets
27--tls-cert <path> Path to an SSL/TLS certificate to serve with HTTPS
28--tls-key <path> Path to the SSL/TLS certificate's private key
29--log-format <format> Customize http log format
30--completions <shell> Print shell completion script for <shell> [possible values: bash, elvish, fish, PowerShell, zsh]
31-h, --help Print help
32-V, --version Print version
3. Screenshots
First, start:
1➜ alacritty git:(master) dufs -b 127.0.0.1 -A
2Listening on http://127.0.0.1:5000/
Screenshots with simple captions
Overall, dufs is compact and powerful, simple and concise. The author's speed in fixing issues is also amazing. A suggestion I made that day was immediately addressed and resolved. Just like the Flask author, he's a highly efficient person!
Copyright statement:
- All content that is not sourced is original., please do not reprint without authorization (because the typesetting is often disordered after reprinting, the content is uncontrollable, and cannot be continuously updated, etc.);
- For non-profit purposes, to deduce any content of this blog, please give the relevant webpage address of this site in the form of 'source of original text' or 'reference link' (for the convenience of readers).
See Also:
- Nginx webdav for Joplin
- Summary of How to Install Chrome in Ubuntu
- Snipe it Asset Import
- Application launcher yofi configuration
- Snipe it asset management system installation and use
- Speeding Up Ubuntu Boot
- Manually Upgrading LibreOffice in Ubuntu
- Batch conversion of Simplified Chinese articles to Traditional Chinese
- Use Inkscape to resize svg images
- Practical Commands