feat: add option --allow-archive (#152)

BREAKING CHANGE: explicitly allow download folder as zip file
This commit is contained in:
sigoden
2022-12-10 11:09:42 +08:00
committed by GitHub
parent 7eef4407fc
commit 8d9705caa4
8 changed files with 60 additions and 11 deletions

View File

@@ -108,6 +108,12 @@ pub fn build_cli() -> Command {
.action(ArgAction::SetTrue)
.help("Allow symlink to files/folders outside root directory"),
)
.arg(
Arg::new("allow-archive")
.long("allow-archive")
.action(ArgAction::SetTrue)
.help("Allow zip archive generation"),
)
.arg(
Arg::new("enable-cors")
.long("enable-cors")
@@ -191,6 +197,7 @@ pub struct Args {
pub allow_delete: bool,
pub allow_search: bool,
pub allow_symlink: bool,
pub allow_archive: bool,
pub render_index: bool,
pub render_spa: bool,
pub render_try_index: bool,
@@ -244,6 +251,7 @@ impl Args {
let allow_delete = matches.get_flag("allow-all") || matches.get_flag("allow-delete");
let allow_search = matches.get_flag("allow-all") || matches.get_flag("allow-search");
let allow_symlink = matches.get_flag("allow-all") || matches.get_flag("allow-symlink");
let allow_archive = matches.get_flag("allow-all") || matches.get_flag("allow-archive");
let render_index = matches.get_flag("render-index");
let render_try_index = matches.get_flag("render-try-index");
let render_spa = matches.get_flag("render-spa");
@@ -286,6 +294,7 @@ impl Args {
allow_upload,
allow_search,
allow_symlink,
allow_archive,
render_index,
render_try_index,
render_spa,