feat: Add download option for PGP public key
All checks were successful
Build Docker / BuildImage (push) Successful in 43s

This commit is contained in:
2024-09-30 16:19:49 +10:00
parent 9552df4b4e
commit 496205c6b4
4 changed files with 91 additions and 1 deletions

View File

@@ -42,6 +42,10 @@ restricted = ["ascii"]
redirects = {
"contact":"/#contact"
}
downloads = {
"pgp": "data/nathanwoodburn.asc"
}
sites = []
if os.path.isfile("data/sites.json"):
@@ -789,6 +793,14 @@ def supersecretpath():
ascii_art_html = converter.convert(ascii_art)
return render_template("ascii.html", ascii_art=ascii_art_html)
@app.route("/download/<path:path>")
def download(path):
# Check if file exists
if path in downloads:
path = downloads[path]
if os.path.isfile(path):
return send_file(path)
return render_template("404.html"), 404
@app.route("/<path:path>")
def catch_all(path: str):