3 Used to see which instances block yours.
9 - python3-fastapi (and all dependencies)
11 - python3-aiofiles needs to be installed unter Python 3.9
15 Create role-based user:
18 sudo useradd --home-dir=/opt/fedi-block-api --comment "Fedi Block API" --user-group --create-home fba
19 sudo mkdir -p /opt/fedi-block-api
20 sudo chown -R fba:fba /opt/fedi-block-api
26 # Change to role-based user 'fba'
30 git clone git://git.mxchange.org/fba.git
35 # You MUST create a virtual environment:
36 python3 -m venv --system-site-packages venv
38 # Add this to your ~/.bashrc file
39 source "${HOME}/fba/venv/bin/activate"
41 # Install all requirements
42 pip3 install -r requirements.txt
45 cp blocks_empty.db blocks.db
47 # Create configuration file
48 cp config.defaults.json config.json
51 Run commands, they should not fail!
54 # Run commands, they should not fail!
55 ./fba.py fetch_instances --domain=mastodon.social # try a bunch of large servers here
58 ### Alter configuration file
59 You maybe wish to change the configuration file, e.g. log_level is set to "info" which is the default but invates privacy of your users, but your choice:
70 ### Fetch blocklists locally (WIP)
71 To save yourself bandwidth and codeberg, too, you want to clone the blocklists from some folks:
74 git clone https://codeberg.org/oliphant/blocklists.git blocklists/oliphant/
77 WIP notice: This feature is not implemented yet.
79 ### Install the services
82 sudo cp services/* /etc/systemd/system
85 ### start the services
88 systemctl enable --now fetch_blocks
89 systemctl enable --now fedi_block_api
94 https://fba.ryona.agency/ uses an older code than this one. So it doesn't reflect this code here. My FBA sub-domain is currently password-protected as I still need to fix some performance issues with large blocking lists.
98 Run these SQL queries from time to time. They always should return zero.
101 SELECT COUNT(blocked) AS cnt FROM blocks LEFT JOIN instances ON blocks.blocked = instances.domain OR blocks.blocker = instances.domain WHERE domain IS NULL LIMIT 1;
102 SELECT COUNT(domain) AS cnt FROM instances WHERE nodeinfo_url IS NOT NULL AND software IS NULL LIMIT 1;
106 [AGPLv3](https://gnu.org)