from fba import database
from fba import utils
+from fba.helpers import blacklist
from fba.helpers import config
from fba.helpers import json as json_helper
from fba.helpers import tidyup
},
})
+@router.get(config.get("base_url") + "/api/v1/instance/domain_blocks", response_class=JSONResponse)
+def api_domain_blocks(request: Request):
+ blocked = blacklist.get_all()
+ blocking = list()
+
+ for block in blocked:
+ blocking.append({
+ "domain" : block,
+ "digest" : utils.get_hash(block),
+ "severity": "suspend",
+ "comment" : blocked[block],
+ })
+
+ return JSONResponse(status_code=200, content=blocking)
+
@router.get(config.get("base_url") + "/api/v1/instance/peers", response_class=JSONResponse)
def api_peers(request: Request):
database.cursor.execute("SELECT domain FROM instances WHERE nodeinfo_url IS NOT NULL")