diff --git a/CHANGELOG.md b/CHANGELOG.md index 6368584..3dc518b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project will be documented in this file. +## [0.34.0] - 2023-06-01 + +### Bug Fixes + +- URL-encoded filename when downloading in safari ([#203](https://github.com/sigoden/dufs/issues/203)) +- Ui path table show move action ([#219](https://github.com/sigoden/dufs/issues/219)) +- Ui set default max uploading to 1 ([#220](https://github.com/sigoden/dufs/issues/220)) + +### Features + +- Webui editing support multiple encodings ([#197](https://github.com/sigoden/dufs/issues/197)) +- Add timestamp metadata to generated zip file ([#204](https://github.com/sigoden/dufs/issues/204)) +- Show precise file size with decimal ([#210](https://github.com/sigoden/dufs/issues/210)) +- [**breaking**] New auth ([#218](https://github.com/sigoden/dufs/issues/218)) + +### Refactor + +- Cli positional rename root => SERVE_PATH([#215](https://github.com/sigoden/dufs/issues/215)) + ## [0.33.0] - 2023-03-17 ### Bug Fixes diff --git a/Cargo.lock b/Cargo.lock index 313509b..52c7c9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -436,7 +436,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dufs" -version = "0.33.0" +version = "0.34.0" dependencies = [ "alphanumeric-sort", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 85237e2..bde68c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dufs" -version = "0.33.0" +version = "0.34.0" edition = "2021" authors = ["sigoden "] description = "Dufs is a distinctive utility file server" diff --git a/README.md b/README.md index 3ff314d..8fe5d04 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Dufs is a distinctive utility file server that supports static serving, uploadin - Upload files and folders (Drag & Drop) - Create/Edit/Search files - Partial responses (Parallel/Resume download) -- Path level access control +- Access control - Support https - Support webdav - Easy to use with curl @@ -48,17 +48,17 @@ Download from [Github Releases](https://github.com/sigoden/dufs/releases), unzip ``` Dufs is a distinctive utility file server - https://github.com/sigoden/dufs -Usage: dufs [OPTIONS] [root] +Usage: dufs [OPTIONS] [serve_path] Arguments: - [root] Specific path to serve [default: .] + [serve_path] Specific path to serve [default: .] Options: -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, separated by `,` - -a, --auth Add auth for path + -a, --auth Add auth role --auth-method Select auth method [default: digest] [possible values: basic, digest] -A, --allow-all Allow all operations --allow-upload Allow upload files/folders @@ -75,8 +75,8 @@ Options: --tls-key Path to the SSL/TLS certificate's private key --log-format Customize http log format --completions Print shell completion script for [possible values: bash, elvish, fish, powershell, zsh] - -h, --help Print help information - -V, --version Print version information + -h, --help Print help + -V, --version Print version ``` ## Examples @@ -203,41 +203,45 @@ curl --user user:pass http://192.168.8.10:5000/file # basic auth ### Access Control -Dufs supports path level access control. You can control who can do what on which path with `--auth`/`-a`. +Dufs supports account based access control. You can control who can do what on which path with `--auth`/`-a`. ``` -dufs -a @ -dufs -a @@ -dufs -a @@* +dufs -a [user:pass]@path[:rw][,path[:rw]...][|...] ``` - -- ``: Protected url path -- ``: Account with readwrite permissions. If dufs is run with `dufs --allow-all`, the permissions are upload/delete/search/view/download. If dufs is run with `dufs --allow-upload`, the permissions are upload/view/download. -- ``: Account with readonly permissions. The permissions are search/view/download if dufs allow search, otherwise view/download.. +1: Multiple rules are separated by "|" +2: User and pass are the account name and password, if omitted, it is an anonymous user +3: One rule can set multiple paths, separated by "," +4: Add `:rw` after the path to indicate that the path has read and write permissions, otherwise the path has readonly permissions. ``` -dufs -A -a /@admin:admin +dufs -A -a admin:admin@/:rw ``` `admin` has all permissions for all paths. ``` -dufs -A -a /@admin:admin@guest:guest +dufs -A -a admin:admin@/:rw -a guest:guest@/ ``` `guest` has readonly permissions for all paths. ``` -dufs -A -a /@admin:admin@* +dufs -A -a admin:admin@/:rw -a @/ ``` All paths is public, everyone can view/download it. ``` -dufs -A -a /@admin:admin -a /user1@user1:pass1 -a /user2@pass2:user2 +dufs -A -a admin:admin@/:rw -a user1:pass1@/user1:rw -a user2:pass2@/user2 +dufs -A -a "admin:admin@/:rw|user1:pass1@/user1:rw|user2:pass2@/user2" ``` -`user1` has all permissions for `/user1*` path. -`user2` has all permissions for `/user2*` path. +`user1` has all permissions for `/user1/*` path. +`user2` has all permissions for `/user2/*` path. ``` -dufs -a /@admin:admin +dufs -A -a user:pass@/dir1:rw,/dir2:rw,dir3 +``` +`user` has all permissions for `/dir1/*` and `/dir2/*`, has readonly permissions for `/dir3/`. + +``` +dufs -a admin:admin@/ ``` Since dufs only allows viewing/downloading, `admin` can only view/download files. @@ -302,7 +306,29 @@ dufs --log-format '$remote_addr $remote_user "$request" $status' -a /@admin:admi All options can be set using environment variables prefixed with `DUFS_`. -`dufs --port 8080 --allow-all` is equal to `DUFS_PORT=8080 DUFS_ALLOW_ALL=true dufs`. +``` + [ROOT_DIR] DUFS_ROOT_DIR=/dir + -b, --bind DUFS_BIND=0.0.0.0 + -p, --port DUFS_PORT=5000 + --path-prefix DUFS_PATH_RREFIX=/path + --hidden DUFS_HIDDEN=*.log + -a, --auth DUFS_AUTH="admin:admin@/:rw|@/" + --auth-method DUFS_AUTH_METHOD=basic + -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 DUFS_ASSETS=/assets + --tls-cert DUFS_TLS_CERT=cert.pem + --tls-key DUFS_TLS_KEY=key.pem + --log-format DUFS_LOG_FORMAT="" +``` ### Customize UI