src/dnsbl/sources.py \
src/dnsbl/util.py
+dist_pkgpython_api_PYTHON = \
+ src/dnsbl/api/__init__.py
+
+pkgpython_apidir = $(pkgpythondir)/api
+
# ------------------------------------------------------------------------------
CLEANFILES += \
AX_PYTHON_MODULE([dns], [fatal])
AX_PYTHON_MODULE([babel], [fatal])
+AX_PYTHON_MODULE([fastapi], [fatal])
AX_PYTHON_MODULE([httpx], [fatal])
AX_PYTHON_MODULE([rich], [fatal])
AX_PYTHON_MODULE([sqlmodel], [fatal])
--- /dev/null
+###############################################################################
+# #
+# dnsbl - A DNS Blocklist Compositor For IPFire #
+# Copyright (C) 2025 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+import fastapi
+
+# Import the backend
+from .. import Backend
+
+# Initialize the app
+app = fastapi.FastAPI(
+ title = "IPFire DNSBL API",
+
+ # Enable debug mode
+ debug = True,
+)
+
+# Initialize the backend
+app.state.backend = Backend(
+ config = "/etc/dnsbl.conf",
+ debug = True,
+)