From b39f94aa5f5631a5dcc32527e5397d788d3bedfe Mon Sep 17 00:00:00 2001 From: Mateusz779 Date: Tue, 25 Apr 2023 09:21:53 +0200 Subject: [PATCH] dodanie pobierania klucza publicznego --- app.py | 10 ++++++++++ templates/images.html | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/app.py b/app.py index 7358cbf..f8f2a44 100644 --- a/app.py +++ b/app.py @@ -155,6 +155,16 @@ def delete(image_id): return redirect(url_for('list_images')) + +@app.route('/download_key/', methods=['POST']) +@login_required +def download_key(image_id): + filename = db.get_conf_image_id(image_id) + + return send_file(os.path.join( + app.config['UPLOAD_FOLDER'], filename.split(".")[0]+".pub")) + + @app.route("/api/getconf") def get_image(): try: diff --git a/templates/images.html b/templates/images.html index 48bfa69..9d3f202 100644 --- a/templates/images.html +++ b/templates/images.html @@ -13,6 +13,7 @@ Token Nazwa IP VPN + Pobierz klucz Usuń @@ -22,6 +23,11 @@ {{ image.token }} {{ image.name }} {{ image.vpn_ip }} + +
+ +
+