Add main application page, key generation and download is working
This commit is contained in:
29
app.py
29
app.py
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user