Add main application page, key generation and download is working

This commit is contained in:
Julio Cesar
2025-07-09 16:54:14 +02:00
parent 276fceee68
commit 67a0c83965
3 changed files with 982 additions and 22 deletions

29
app.py
View File

@@ -1,6 +1,6 @@
# gpg_api.py
from flask import Flask, Request, request, jsonify, send_file
from flask import Flask, Request, render_template, request, jsonify, send_file
import gnupg
import tempfile
import os
@@ -74,27 +74,12 @@ def find_key_by_email(email, secret=False):
# @app.route("/api/setup/gnupg", methods=["GET"])
# def setup_gnupg():
# """Check if GnuPG is available through python-gnupg"""
# try:
# # Try to get version info
# version_info = gpg_instance.version
# logger.info("GnuPG accessible through python-gnupg")
# return jsonify(
# {
# "status": "GnuPG is available through python-gnupg",
# "version": version_info,
# }
# )
# except Exception as e:
# logger.warning(f"GnuPG not accessible: {e}")
# return (
# jsonify(
# {
# "error": "GnuPG is not accessible. Please ensure it's properly installed."
# }
# ),
# 404,
# )
@app.route("/")
def index():
"""Render the main application page"""
return render_template("index.html")
@app.route("/api/generate-key", methods=["POST"])