X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=README.md;h=db37a0e0881fac22fa75b0958491ace86daed4c8;hb=c8effc80bb534acec55edd0705be4e5d3a964b32;hp=e90aa5b390b51114fc984ff9c6df98f5bbee3d99;hpb=19abc18f903c28f57ad357858fb4dd2bd3a65f50;p=fba.git diff --git a/README.md b/README.md index e90aa5b..db37a0e 100644 --- a/README.md +++ b/README.md @@ -3,28 +3,69 @@ Used to see which instances block yours. ## software used: + - python 3.10.2 -- node v17.6.0 -- yarn 1.22.17 -## how to use: +## Installation + +```bash +sudo useradd -m fba +sudo mkdir -p /opt/fedi-block-api +sudo chown -R fba:fba /opt/fedi-block-api +sudo -Hu fba git clone git://git.mxchange.org/fba.git /opt/fedi-block-api/ +cd /opt/fedi-block-api/ +sudo -Hu fba pip3 install -r requirements.txt +sudo -Hu fba cp blocks_empty.db blocks.db +sudo -Hu fba cp config.defaults.json config.json +sudo -Hu fba ./fba.py fetch_instances --domain=mastodon.social # try a bunch of large servers here +``` -Copy the preloaded database to the live database +### Alter configuration file +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: -`cp blocks_preloaded.db blocks.db` +``` + "critical" + "error" + "warning" + "info" + "debug" + "trace" +``` -Start the mastodon API +### Fetch blocklists locally (WIP) +To save yourself bandwidth and codeberg, too, you want to clone the blocklists from some folks: ``` -cd mastodon_api -yarn install -node . +sudo -Hu fba git clone https://codeberg.org/oliphant/blocklists.git blocklists/oliphant/ ``` -Fill the database with blocks. +WIP notice: This feature is not implemented yet. + +### Install the services + +```bash +sudo cp services/* /etc/systemd/system +``` -`python fetch_blocks.py` +### start the services +```bash +systemctl enable --now fetch_blocks +systemctl enable --now fedi_block_api +``` + +## Try it out + +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. + +## Maintenance + +Run these SQL queries from time to time. They always should return zero. + +```sql +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; +SELECT COUNT(domain) AS cnt FROM instances WHERE nodeinfo_url IS NOT NULL AND software IS NULL LIMIT 1; +``` ## License -[AGPLv3+NIGGER](https://plusnigger.autism.exposed/) \ No newline at end of file +[AGPLv3](https://gnu.org)