feat: Add api route to get domain info
All checks were successful
Build Docker / BuildImage (push) Successful in 42s

This commit is contained in:
2025-07-02 22:32:14 +10:00
parent d30aa6e427
commit be5327ddf4

View File

@@ -68,6 +68,26 @@ def wellknown(path):
req.content, 200, {"Content-Type": req.headers["Content-Type"]} req.content, 200, {"Content-Type": req.headers["Content-Type"]}
) )
@app.route("/verify", methods=["GET"])
def verify_domain():
# Get the domain from the query string
domain = request.args.get("domain")
if not domain:
return jsonify({"error": "No domain provided"}), 400
# Get path from env
apiKEY = os.getenv("API_KEY")
# Get host or use 127.0.0.1
host = os.getenv("HSD_HOST", "127.0.0.1")
nameInfo = requests.post(
f"http://x:{apiKEY}@{host}:12037",
json={
"method": "getnameinfo",
"params": [domain]
}
)
return jsonify(nameInfo.json()), 200
@app.route("/renew", methods=["POST"]) @app.route("/renew", methods=["POST"])
def renew(): def renew():
# Get post data # Get post data