]> git.mxchange.org Git - fba.git/blob - docs/README.md
Continued:
[fba.git] / docs / README.md
1 # Fedi block API
2
3 Used to see which instances block yours.
4
5 ## software used:
6
7 - python 3.10.2
8
9 ## Installation
10
11 ```bash
12 sudo useradd --home-dir=/opt/fedi-block-api --comment "Fedi Block API" --user-group --create-home fba
13 sudo mkdir -p /opt/fedi-block-api
14 sudo chown -R fba:fba /opt/fedi-block-api
15 sudo -Hu fba git clone git://git.mxchange.org/fba.git /opt/fedi-block-api/
16 cd /opt/fedi-block-api/
17 sudo -Hu fba pip3 install -r requirements.txt
18 sudo -Hu fba cp blocks_empty.db blocks.db
19 sudo -Hu fba cp config.defaults.json config.json
20 sudo -Hu fba ./fba.py fetch_instances --domain=mastodon.social # try a bunch of large servers here
21 ```
22
23 ### Alter configuration file
24 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:
25
26 ```
27     "critical"
28     "error"
29     "warning"
30     "info"
31     "debug"
32     "trace"
33 ```
34
35 ### Fetch blocklists locally (WIP)
36 To save yourself bandwidth and codeberg, too, you want to clone the blocklists from some folks:
37
38 ```
39 sudo -Hu fba git clone https://codeberg.org/oliphant/blocklists.git blocklists/oliphant/
40 ```
41
42 WIP notice: This feature is not implemented yet.
43
44 ### Install the services
45
46 ```bash
47 sudo cp services/* /etc/systemd/system
48 ```
49
50 ### start the services
51
52 ```bash
53 systemctl enable --now fetch_blocks
54 systemctl enable --now fedi_block_api
55 ```
56
57 ## Try it out
58
59 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.
60
61 ## Maintenance
62
63 Run these SQL queries from time to time. They always should return zero.
64
65 ```sql
66 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;
67 SELECT COUNT(domain) AS cnt FROM instances WHERE nodeinfo_url IS NOT NULL AND software IS NULL LIMIT 1;
68 ```
69 ## License
70
71 [AGPLv3](https://gnu.org)