add upload_pass config option

This commit is contained in:
blek 2023-10-27 00:41:43 +10:00
parent e81a5e3ec3
commit 6617efc9fe
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,11 @@ allow_pass_protection=true
# This is shown only if allow_uploads = false # This is shown only if allow_uploads = false
# upload_disable_reason="File uploads were disabled because of an ongoing attack." # upload_disable_reason="File uploads were disabled because of an ongoing attack."
# If you want to restrict the uploads
# To only the people who have a password,
# uncomment this field
# upload_pass=super_secret_pass
# Timeout for deleting a user uploaded file # Timeout for deleting a user uploaded file
file_del_timeout=1800 file_del_timeout=1800

View File

@ -22,6 +22,10 @@ pub struct FilesPolicy {
#[serde(default)] #[serde(default)]
pub upload_disable_reason: Option<String>, pub upload_disable_reason: Option<String>,
/// Upload password
#[serde(default)]
pub upload_pass: Option<String>,
/// Default time for file to be deleted /// Default time for file to be deleted
#[serde(default)] #[serde(default)]
pub file_del_timeout: usize, pub file_del_timeout: usize,
@ -42,6 +46,7 @@ impl Default for FilesPolicy {
allow_custom_names: true, allow_custom_names: true,
allow_pass_protection: true, allow_pass_protection: true,
upload_disable_reason: None, upload_disable_reason: None,
upload_pass: None,
file_del_timeout: 1800, file_del_timeout: 1800,
type_whitelist: None, type_whitelist: None,
type_blacklist: None, type_blacklist: None,