from flask import render_template, Blueprint, Response from flask.typing import ResponseReturnValue from sqlalchemy import desc from app.models.base import Group from app.models.onions import Eotk bp = Blueprint("eotk", __name__) @bp.route("/list") def eotk_list() -> ResponseReturnValue: instances = Eotk.query.filter(Eotk.destroyed == None).order_by(desc(Eotk.added)).all() return render_template("list.html.j2", section="eotk", title="EOTK Instances", item="eotk", items=instances) @bp.route("/conf/") def eotk_conf(group_id: int) -> ResponseReturnValue: from app import app group = Group.query.filter(Group.id == group_id).first() return Response(render_template("sites.conf.j2", bypass_token=app.config["BYPASS_TOKEN"], group=group), content_type="text/plain")