]> OzVa Git service - ozva-cloud/commitdiff
feat: rename to dufs (#59)
authorsigoden <sigoden@gmail.com>
Sun, 19 Jun 2022 14:53:51 +0000 (22:53 +0800)
committerGitHub <noreply@github.com>
Sun, 19 Jun 2022 14:53:51 +0000 (22:53 +0800)
close #50

BREAKING CHANGE: rename duf to dufs

Cargo.lock
Cargo.toml
Dockerfile
README.md
src/auth.rs
src/server.rs
tests/args.rs
tests/bind.rs
tests/fixtures.rs
tests/tls.rs

index 912f22c07ab7949a88bd574125b5737a2a411a05..1b04dd5ebbd3992aebccc8e39308f004402bfc9c 100644 (file)
@@ -570,7 +570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
 
 [[package]]
-name = "duf"
+name = "dufs"
 version = "0.18.0"
 dependencies = [
  "assert_cmd",
index 7b714a67c96d99114375e99d9d24d561c72eedeb..217dcc8e3a404708fde4a9556776d0950f002150 100644 (file)
@@ -1,12 +1,12 @@
 [package]
-name = "duf"
+name = "dufs"
 version = "0.18.0"
 edition = "2021"
 authors = ["sigoden <sigoden@gmail.com>"]
-description = "Duf is a simple file server."
+description = "Dufs is a simple file server."
 license = "MIT OR Apache-2.0"
-homepage = "https://github.com/sigoden/duf"
-repository = "https://github.com/sigoden/duf"
+homepage = "https://github.com/sigoden/dufs"
+repository = "https://github.com/sigoden/dufs"
 categories = ["command-line-utilities", "web-programming::http-server"]
 keywords = ["static", "file", "server", "webdav", "cli"]
 
index b9d47640cfb88a92abea6cd11fe85be783d43da7..657b60617886c67ba86727780fffb2aec14912ea 100644 (file)
@@ -6,5 +6,5 @@ COPY . .
 RUN cargo build --target x86_64-unknown-linux-musl --release
 
 FROM scratch
-COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/duf /bin/
-ENTRYPOINT ["/bin/duf"]
\ No newline at end of file
+COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/dufs /bin/
+ENTRYPOINT ["/bin/dufs"]
\ No newline at end of file
index 4fbdb2975ebad7fac620212afbc8dcd3361ad169..02af983a1e2f7c896283a1f130e67746a382af98 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
-# Duf
+# Dufs (Old Name: Duf)
 
-[![CI](https://github.com/sigoden/duf/actions/workflows/ci.yaml/badge.svg)](https://github.com/sigoden/duf/actions/workflows/ci.yaml)
-[![Crates](https://img.shields.io/crates/v/duf.svg)](https://crates.io/crates/duf)
+[![CI](https://github.com/sigoden/dufs/actions/workflows/ci.yaml/badge.svg)](https://github.com/sigoden/dufs/actions/workflows/ci.yaml)
+[![Crates](https://img.shields.io/crates/v/dufs.svg)](https://crates.io/crates/dufs)
 
-Duf is a simple file server. Support static serve, search, upload, webdav...
+Dufs is a simple file server. Support static serve, search, upload, webdav...
 
-![demo](https://user-images.githubusercontent.com/4012553/171526189-09afc2de-793f-4216-b3d5-31ea408d3610.png)
+![demo](https://user-images.githubusercontent.com/4012553/174486522-7af350e6-0195-4f4a-8480-d9464fc6452f.png)
 
 ## Features
 
@@ -24,26 +24,26 @@ Duf is a simple file server. Support static serve, search, upload, webdav...
 ### With cargo
 
 ```
-cargo install duf
+cargo install dufs
 ```
 
 ### With docker
 
 ```
-docker run -v `pwd`:/data -p 5000:5000 --rm -it sigoden/duf /data
+docker run -v `pwd`:/data -p 5000:5000 --rm -it sigoden/dufs /data
 ```
 
 ### Binaries on macOS, Linux, Windows
 
-Download from [Github Releases](https://github.com/sigoden/duf/releases), unzip and add duf to your $PATH.
+Download from [Github Releases](https://github.com/sigoden/dufs/releases), unzip and add dufs to your $PATH.
 
 ## CLI
 
 ```
-Duf is a simple file server. - https://github.com/sigoden/duf
+Dufs is a simple file server. - https://github.com/sigoden/dufs
 
 USAGE:
-    duf [OPTIONS] [--] [path]
+    dufs [OPTIONS] [--] [path]
 
 ARGS:
     <path>    Path to a root directory for serving files [default: .]
@@ -72,31 +72,31 @@ OPTIONS:
 Serve current working directory, no upload/delete
 
 ```
-duf
+dufs
 ```
 
 Allow upload/delete
 
 ```
-duf -A
+dufs -A
 ```
 
 Listen on a specific port
 
 ```
-duf -p 80
+dufs -p 80
 ```
 
 For a single page application (SPA)
 
 ```
-duf --render-spa
+dufs --render-spa
 ```
 
 Use https
 
 ```
-duf --tls-cert my.crt --tls-key my.key
+dufs --tls-cert my.crt --tls-key my.key
 ```
 
 ## API
@@ -156,7 +156,7 @@ The `--render-*` options change the render logic:
 </summary>
 
 ```
-duf -a <path>@<readwrite>[@<readonly>]
+dufs -a <path>@<readwrite>[@<readonly>]
 ```
 
 - `<path>`: Path to protected
@@ -168,7 +168,7 @@ duf -a <path>@<readwrite>[@<readonly>]
 For example:
 
 ```
-duf -a /@admin:pass@* -a /ui@designer:pass1 -A
+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.
@@ -184,8 +184,8 @@ curl --digest -u designer:pass1 http://127.0.0.1:5000/ui/path-to-file
 
 ## License
 
-Copyright (c) 2022 duf-developers.
+Copyright (c) 2022 dufs-developers.
 
-duf is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
+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.
\ No newline at end of file
index b3d47bbd248a6674b98bf291350fcc938efb71fe..683a9a344af241c83bd30b789974c221ed85c19e 100644 (file)
@@ -11,7 +11,7 @@ use uuid::Uuid;
 use crate::utils::encode_uri;
 use crate::BoxResult;
 
-const REALM: &str = "DUF";
+const REALM: &str = "DUFS";
 
 lazy_static! {
     static ref NONCESTARTHASH: Context = {
index 81460d7d858dd6106b666e5d353de24307c1377b..2c72ab98ae4c0c4720b615c466446b87b4c773a1 100644 (file)
@@ -698,7 +698,7 @@ impl Server {
             "__SLOT__",
             &format!(
                 r#"
-<title>Index of {} - Duf</title>
+<title>Index of {} - Dufs</title>
 <style>{}</style>
 <script>
 const DATA = 
index e67ecc615ab243cbcf32198e74b3312e75fa3592..81f7ecb155f17e267c1f2b11abb4ea675817b8b6 100644 (file)
@@ -35,7 +35,7 @@ fn path_prefix_propfind(
 #[rstest]
 #[case("index.html")]
 fn serve_single_file(tmpdir: TempDir, port: u16, #[case] file: &str) -> Result<(), Error> {
-    let mut child = Command::cargo_bin("duf")?
+    let mut child = Command::cargo_bin("dufs")?
         .env("RUST_LOG", "false")
         .arg(tmpdir.path().join(file))
         .arg("-p")
index 488a1ef95c61381478b08fa55d480edc446ffbd6..4b9c8634645979c0bd396cbb09f2998832ed740e 100644 (file)
@@ -12,7 +12,7 @@ use std::process::{Command, Stdio};
 #[rstest]
 #[case(&["-b", "20.205.243.166"])]
 fn bind_fails(tmpdir: TempDir, port: u16, #[case] args: &[&str]) -> Result<(), Error> {
-    Command::cargo_bin("duf")?
+    Command::cargo_bin("dufs")?
         .env("RUST_LOG", "false")
         .arg(tmpdir.path())
         .arg("-p")
@@ -50,7 +50,7 @@ fn bind_ipv4_ipv6(
 #[case(&[] as &[&str])]
 #[case(&["--path-prefix", "/prefix"])]
 fn validate_printed_urls(tmpdir: TempDir, port: u16, #[case] args: &[&str]) -> Result<(), Error> {
-    let mut child = Command::cargo_bin("duf")?
+    let mut child = Command::cargo_bin("dufs")?
         .env("RUST_LOG", "false")
         .arg(tmpdir.path())
         .arg("-p")
index c60747ccf6b9f66bb103d939379637fa93fee049..5dab32f13da2f19e26d0dbc10de4587b9f90613a 100644 (file)
@@ -83,7 +83,7 @@ pub fn port() -> u16 {
     free_local_port().expect("Couldn't find a free local port")
 }
 
-/// Run duf as a server; Start with a temporary directory, a free port and some
+/// Run dufs as a server; Start with a temporary directory, a free port and some
 /// optional arguments then wait for a while for the server setup to complete.
 #[fixture]
 #[allow(dead_code)]
@@ -94,7 +94,7 @@ where
 {
     let port = port();
     let tmpdir = tmpdir();
-    let child = Command::cargo_bin("duf")
+    let child = Command::cargo_bin("dufs")
         .expect("Couldn't find test binary")
         .env("RUST_LOG", "false")
         .arg(tmpdir.path())
@@ -122,7 +122,7 @@ where
 {
     let port = port();
     let tmpdir = tmpdir();
-    let child = Command::cargo_bin("duf")
+    let child = Command::cargo_bin("dufs")
         .expect("Couldn't find test binary")
         .env("RUST_LOG", "false")
         .arg(tmpdir.path())
index 6b9e6bd017093e414fff4088c613e6caa371ad12..94c7ab876636ec10ef1710264961d93c0afff2d8 100644 (file)
@@ -29,7 +29,7 @@ fn tls_works(#[case] server: TestServer) -> Result<(), Error> {
 /// Wrong path for cert throws error.
 #[rstest]
 fn wrong_path_cert() -> Result<(), Error> {
-    Command::cargo_bin("duf")?
+    Command::cargo_bin("dufs")?
         .args(&["--tls-cert", "wrong", "--tls-key", "tests/data/key.pem"])
         .assert()
         .failure()
@@ -41,7 +41,7 @@ fn wrong_path_cert() -> Result<(), Error> {
 /// Wrong paths for key throws errors.
 #[rstest]
 fn wrong_path_key() -> Result<(), Error> {
-    Command::cargo_bin("duf")?
+    Command::cargo_bin("dufs")?
         .args(&["--tls-cert", "tests/data/cert.pem", "--tls-key", "wrong"])
         .assert()
         .failure()