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 }} + +
+ +
+