add ui banner wall when file uploads are disabled
This commit is contained in:
parent
e72a556394
commit
93d94b8431
|
@ -17,6 +17,10 @@ allow_custom_names=true
|
||||||
# Allow password protection
|
# Allow password protection
|
||||||
allow_pass_protection=true
|
allow_pass_protection=true
|
||||||
|
|
||||||
|
# Reson why the uploads are disabled
|
||||||
|
# This is shown only if allow_uploads = false
|
||||||
|
# upload_disable_reason="File uploads were disabled because of an ongoing attack."
|
||||||
|
|
||||||
# How much files can one
|
# How much files can one
|
||||||
# user have uploaded to the server.
|
# user have uploaded to the server.
|
||||||
# Note that it does not include expired files
|
# Note that it does not include expired files
|
||||||
|
|
|
@ -17,6 +17,11 @@ pub struct FilesPolicy {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub allow_pass_protection: bool,
|
pub allow_pass_protection: bool,
|
||||||
|
|
||||||
|
/// Reson why the uploads are disabled
|
||||||
|
/// This is shown only if allow_uploads = false
|
||||||
|
#[serde(default)]
|
||||||
|
pub upload_disable_reason: Option<String>,
|
||||||
|
|
||||||
/// Max uploads for IP (doesn't include deleted uploads)
|
/// Max uploads for IP (doesn't include deleted uploads)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub max_per_ip: usize,
|
pub max_per_ip: usize,
|
||||||
|
@ -40,6 +45,7 @@ impl Default for FilesPolicy {
|
||||||
allow_uploads: true,
|
allow_uploads: true,
|
||||||
allow_custom_names: true,
|
allow_custom_names: true,
|
||||||
allow_pass_protection: true,
|
allow_pass_protection: true,
|
||||||
|
upload_disable_reason: None,
|
||||||
max_per_ip: 8,
|
max_per_ip: 8,
|
||||||
file_del_timeout: 1800,
|
file_del_timeout: 1800,
|
||||||
type_whitelist: None,
|
type_whitelist: None,
|
||||||
|
|
|
@ -85,12 +85,23 @@
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
{%- if ! conf.files.allow_uploads -%}
|
{%- if ! conf.files.allow_uploads -%}
|
||||||
<div class="alert danger" style="margin-bottom:4px">
|
<div class="alert danger" style="width:426px">
|
||||||
<h1 class="alert-title">
|
<h1 class="alert-title">
|
||||||
Error
|
Error
|
||||||
</h1>
|
</h1>
|
||||||
<p class="alert-text">
|
<p class="alert-text">
|
||||||
Uploads are temporarily disabled by the administrator.
|
Uploads are temporarily disabled by the administrator
|
||||||
|
{%- if let Some(disable_reason) = conf.files.upload_disable_reason -%}
|
||||||
|
{{- " " -}} because of the following reason:
|
||||||
|
<span style="display:block;font-family:monospace;padding:12px 0">
|
||||||
|
{{- disable_reason -}}
|
||||||
|
</span>
|
||||||
|
{%- else -%}
|
||||||
|
.
|
||||||
|
{%- endif -%}
|
||||||
|
<span style="display:block">
|
||||||
|
Check again in a few minutes.
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
|
|
Loading…
Reference in New Issue