add debug mode notice

This commit is contained in:
blek 2023-10-23 13:17:40 +10:00
parent 8d3b81244d
commit 5d8b8648cb
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 22 additions and 0 deletions

View File

@ -19,6 +19,7 @@ pub async fn uploaded((file, state): (String, SharedState), authorization: Optio
.map_err(|x| warp::reject::custom(HttpReject::StringError(x.to_string())))?; .map_err(|x| warp::reject::custom(HttpReject::StringError(x.to_string())))?;
if file_res.is_none() { if file_res.is_none() {
log::debug!("Trying to find by name");
file_res = state.file_mgr.find_by_name(file.clone()) file_res = state.file_mgr.find_by_name(file.clone())
.map_err(|x| warp::reject::custom(HttpReject::StringError(x.to_string())))?; .map_err(|x| warp::reject::custom(HttpReject::StringError(x.to_string())))?;
} }

View File

@ -17,6 +17,10 @@
<style> .footer svg { height: 32px; margin: 10px 0 } </style> <style> .footer svg { height: 32px; margin: 10px 0 } </style>
{%- if cfg!(debug_assertions) -%}
<link rel="stylesheet" href="/alert.css" />
{%- endif -%}
{%- include "seotags.html" %} {%- include "seotags.html" %}
{% block head %}{% endblock -%} {% block head %}{% endblock -%}
</head> </head>
@ -36,6 +40,23 @@
</div> </div>
<div class='content-box'> <div class='content-box'>
<div class="content"> <div class="content">
{%- if cfg!(debug_assertions) -%}
<div class="alert danger" style="margin:var(--margin-y) auto;width:fit-content;margin-bottom:calc(var(--margin-y) * 3)">
<h1 class="alert-title">
Website running in debug mode
</h1>
<div class="alert-text">
<p>
Website is running in development mode that is supposed <br/>
to be used only for local development purposes.
</p>
<p>
If you see this in a public instance, <br/>
Please inform the maintainers of the instance of the issue.
</p>
</div>
</div>
{%- endif -%}
{%- block body %}{% endblock -%} {%- block body %}{% endblock -%}
</div> </div>
<div class="footer"> <div class="footer">