Blocker is a service that blocklists all abusive skylinks on the current server. The service exposes a REST API that allows callers to request the blocking of new skylinks. The blocklist is shared between the servers that make up a portal cluster via MongoDB.
The blocker will convert the Skylink to a hash of its merkle root as soon as possible. This to prevent the persistence of abusive skylinks in the database and/or log files.
A portal operator can bootstrap his portal's blocklist by defining a set of
portal urls to sync with. The portal urls have to be defined in the environment
variable BLOCKER_PORTALS_SYNC, which is a comma separated list of portal URLs.
The blocker will periodically sync the blocklist and merge it with the local database of hashes.
The blocker service can only block hashes which are not in the allow list. To add a hash to the allow list, one has to manually query the database and perform the follow operation:
db.getCollection('allowlist').insertOne({
hash: "[INSERT HASH OF V1 SKYLINK HERE]",
description: "[INSERT DESCRIPTION]",
timestamp_added: new Date(),
})
This service depends on the following environment variables:
API_HOST, defaults tosiaAPI_PORT, defaults to9980SIA_API_PASSWORDSKYNET_DB_HOSTSKYNET_DB_PORTSKYNET_DB_USERSKYNET_DB_PASSSKYNET_ACCOUNTS_HOST, defaults toaccountsSKYNET_ACCOUNTS_PORT, defaults to3000SERVER_UID, e.g.94743e8e2673a176BLOCKER_LOG_LEVEL, defaults toinfoBLOCKER_PORTALS_SYNC