@@ -74,6 +74,8 @@ Here is a batch of usefull commands.
|
||||
docker compose down -v # Remove volume containings results
|
||||
docker compose -f docker-compose-dev.yml up # Start application in developpement mode
|
||||
rm -rf aperisolve/results # Remove results from developpement mode
|
||||
docker exec -it postgres psql -U aperiuser -d aperisolve # Get postgresql shell
|
||||
docker exec -it aperisolve-web bash # Get shell in running web app
|
||||
```
|
||||
|
||||
> Note, if you used [docker-compose-dev.yml](docker-compose-dev.yml), you must remove "results" when switching to [production docker](docker-compose.yml).
|
||||
|
||||
@@ -38,6 +38,11 @@ def too_large(_: Any) -> tuple[Response, int]:
|
||||
return jsonify({"error": "Image size exceeded"}), 413
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def not_found(e):
|
||||
return render_template("error.html", message="Ressource not found", statuscode=404)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index() -> str:
|
||||
"""Render the main index page."""
|
||||
|
||||
@@ -47,4 +47,9 @@ def cleanup_old_entries() -> None:
|
||||
shutil.rmtree(RESULT_FOLDER / img.hash) # type: ignore
|
||||
db.session.delete(img)
|
||||
|
||||
# Delete Images with missing submission
|
||||
if len(img.submissions) == 0 and delay > MAX_PENDING_TIME:
|
||||
shutil.rmtree(RESULT_FOLDER / img.hash) # type: ignore
|
||||
db.session.delete(img)
|
||||
|
||||
db.session.commit()
|
||||
|
||||
@@ -407,4 +407,11 @@ footer a i {
|
||||
.glow-border {
|
||||
border: 1px solid var(--theme-green);
|
||||
box-shadow: 0 0 10px var(--theme-green-shadow);
|
||||
}
|
||||
|
||||
#httperror{
|
||||
padding-top: 100px;
|
||||
}
|
||||
#httperror h1, #httperror h2{
|
||||
text-align: center;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block body_content %}
|
||||
<div id="httperror">
|
||||
<h1>{{ statuscode }}</h1>
|
||||
<br>
|
||||
<h2>{{ message }}</h2>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user