mirror of
https://github.com/sigoden/dufs.git
synced 2026-06-07 23:16:54 +03:00
feat: add option --allow-hash to allow/disallow file hashing (#657)
This commit is contained in:
+12
@@ -148,6 +148,14 @@ pub fn build_cli() -> Command {
|
||||
.action(ArgAction::SetTrue)
|
||||
.help("Allow download folders as archive file"),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("allow-hash")
|
||||
.env("DUFS_ALLOW_HASH")
|
||||
.hide_env(true)
|
||||
.long("allow-hash")
|
||||
.action(ArgAction::SetTrue)
|
||||
.help("Allow ?hash query to get file sha256 hash"),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("enable-cors")
|
||||
.env("DUFS_ENABLE_CORS")
|
||||
@@ -281,6 +289,7 @@ pub struct Args {
|
||||
pub allow_search: bool,
|
||||
pub allow_symlink: bool,
|
||||
pub allow_archive: bool,
|
||||
pub allow_hash: bool,
|
||||
pub render_index: bool,
|
||||
pub render_spa: bool,
|
||||
pub render_try_index: bool,
|
||||
@@ -375,6 +384,9 @@ impl Args {
|
||||
if !args.allow_symlink {
|
||||
args.allow_symlink = allow_all || matches.get_flag("allow-symlink");
|
||||
}
|
||||
if !args.allow_hash {
|
||||
args.allow_hash = allow_all || matches.get_flag("allow-hash");
|
||||
}
|
||||
if !args.allow_archive {
|
||||
args.allow_archive = allow_all || matches.get_flag("allow-archive");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user