import requests
import validators
-from fba import config
from fba import fba
from fba import network
+from fba.helpers import config
from fba.helpers import tidyup
router = fastapi.FastAPI(docs_url=config.get("base_url") + "/docs", redoc_url=config.get("base_url") + "/redoc")
# Main packages:
'boot',
'commands',
- 'config',
'csrf',
'federation',
'fba',
import reqto
import validators
-from fba import config
from fba import federation
from fba import fba
from fba import network
from fba.helpers import blacklist
+from fba.helpers import config
from fba.helpers import cookies
from fba.helpers import locking
from fba.helpers import tidyup
+++ /dev/null
-# Fedi API Block - An aggregator for fetching blocking data from fediverse nodes
-# Copyright (C) 2023 Free Software Foundation
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-import json
-
-with open("config.json") as f:
- # DEBUG: print("DEBUG: Loading configuration file ...")
- _config = json.loads(f.read())
-
-def get(key: str) -> any:
- # DEBUG: print(f"DEBUG: key[{type(key)}]={key} - CALLED!")
- if not isinstance(key, str):
- raise ValueError(f"Parameter key[]='{type(key)}' is not 'str'")
- elif key == "":
- raise ValueError("Parameter 'key' is empty")
- elif not key in _config:
- raise KeyError(f"key='{key}' does not exist in _config array")
-
- # DEBUG: print(f"DEBUG: _config[{key}]={_config[key]} - EXIT!")
- return _config[key]
import reqto
import validators
-from fba import config
from fba import network
+from fba.helpers import config
from fba.helpers import cookies
def determine(domain: str, headers: dict) -> dict:
import bs4
import validators
-from fba import config
from fba import csrf
from fba import network
from fba.helpers import blacklist
+from fba.helpers import config
from fba.helpers import tidyup
from fba.helpers import version
__all__ = [
'blacklist',
'cache',
+ 'config',
'cookies',
'dicts',
'locking',
--- /dev/null
+# Fedi API Block - An aggregator for fetching blocking data from fediverse nodes
+# Copyright (C) 2023 Free Software Foundation
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+import json
+
+with open("config.json") as f:
+ # DEBUG: print("DEBUG: Loading configuration file ...")
+ _config = json.loads(f.read())
+
+def get(key: str) -> any:
+ # DEBUG: print(f"DEBUG: key[{type(key)}]={key} - CALLED!")
+ if not isinstance(key, str):
+ raise ValueError(f"Parameter key[]='{type(key)}' is not 'str'")
+ elif key == "":
+ raise ValueError("Parameter 'key' is empty")
+ elif not key in _config:
+ raise KeyError(f"key='{key}' does not exist in _config array")
+
+ # DEBUG: print(f"DEBUG: _config[{key}]={_config[key]} - EXIT!")
+ return _config[key]
import json
import time
-from fba import config
from fba import fba
+from fba.helpers import config
+
def add(domain: str, error: dict):
# DEBUG: print("DEBUG: domain,error[]:", domain, type(error))
if not isinstance(domain, str):
import requests
import validators
-from fba import config
from fba import fba
from fba import federation
from fba import network
from fba.helpers import blacklist
from fba.helpers import cache
+from fba.helpers import config
from fba.models import error_log
import urllib3
import validators
-from fba import config
from fba import fba
+from fba.helpers import config
from fba.helpers import cookies
from fba.models import instances
import bs4
import validators
-from fba import config
from fba import network
from fba.helpers import blacklist
+from fba.helpers import config
from fba.helpers import tidyup
from fba.models import instances
import bs4
import validators
-from fba import config
from fba import csrf
from fba import fba
from fba import federation
from fba import network
from fba.helpers import blacklist
+from fba.helpers import config
from fba.helpers import tidyup
from fba.models import blocks
import bs4
import validators
-from fba import config
from fba import csrf
from fba import fba
from fba import network
from fba.helpers import blacklist
+from fba.helpers import config
from fba.helpers import tidyup
from fba.models import blocks
import json
-from fba import config
from fba import csrf
from fba import network
from fba.helpers import blacklist
+from fba.helpers import config
from fba.helpers import dicts
from fba.helpers import tidyup
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-from fba import config
from fba import csrf
from fba import network
+from fba.helpers import config
+
from fba.models import instances
def fetch_peers(domain: str) -> list:
import bs4
import validators
-from fba import config
from fba import fba
from fba import federation
from fba import network
from fba.helpers import blacklist
+from fba.helpers import config
from fba.helpers import tidyup
from fba.models import blocks