]> 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 Create role-based user:
12
13 ```bash
14 sudo useradd --home-dir=/opt/fedi-block-api --comment "Fedi Block API" --user-group --create-home fba
15 sudo mkdir -p /opt/fedi-block-api
16 sudo chown -R fba:fba /opt/fedi-block-api
17 ```
18
19 Install software:
20
21 ```bash
22 # Change to role-based user 'fba'
23 sudo -Hu fba su -
24
25 # Clone code
26 git clone git://git.mxchange.org/fba.git
27
28 # You MUST create a virtual environment:
29 python3 -m venv venv
30
31 # Add this to your ~/.bashrc file
32 source "${HOME}/fba/venv/bin/activate"
33
34 # Install all requirements
35 pip3 install -r requirements.txt
36
37 # Create blocks.db
38 cp blocks_empty.db blocks.db
39
40 # Create configuration file
41 cp config.defaults.json config.json
42 ```
43
44 Run commands, they should not fail!
45
46 ```bash
47 # Run commands, they should not fail!
48 ./fba.py fetch_instances --domain=mastodon.social # try a bunch of large servers here
49 ```
50
51 ### Alter configuration file
52 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:
53
54 ```
55     "critical"
56     "error"
57     "warning"
58     "info"
59     "debug"
60     "trace"
61 ```
62
63 ### Fetch blocklists locally (WIP)
64 To save yourself bandwidth and codeberg, too, you want to clone the blocklists from some folks:
65
66 ```
67 git clone https://codeberg.org/oliphant/blocklists.git blocklists/oliphant/
68 ```
69
70 WIP notice: This feature is not implemented yet.
71
72 ### Install the services
73
74 ```bash
75 sudo cp services/* /etc/systemd/system
76 ```
77
78 ### start the services
79
80 ```bash
81 systemctl enable --now fetch_blocks
82 systemctl enable --now fedi_block_api
83 ```
84
85 ## Try it out
86
87 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.
88
89 ## Maintenance
90
91 Run these SQL queries from time to time. They always should return zero.
92
93 ```sql
94 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;
95 SELECT COUNT(domain) AS cnt FROM instances WHERE nodeinfo_url IS NOT NULL AND software IS NULL LIMIT 1;
96 ```
97 ## License
98
99 [AGPLv3](https://gnu.org)